Skip to content

Commit 76a37b5

Browse files
committed
Merge pull request #453 from travis-ci/sw-faq
Merge FAQs and add container-based builds troubleshooting
2 parents 057599a + 0245ca6 commit 76a37b5

8 files changed

+147
-118
lines changed

_includes/sidebar.html

+6-7
Original file line numberDiff line numberDiff line change
@@ -47,25 +47,30 @@ <h2>Menu</h2>
4747
<ul>
4848
<li><a href="/user/getting-started/">Getting started</a></li>
4949
<li><a href="/user/customizing-the-build/">Customizing Your Build</a></li>
50+
<li><a href="/user/common-build-problems/">Common Build Problems</a></li>
5051
<li><a href="/user/installing-dependencies/">Installing Dependencies</a></li>
52+
<li><a href="/user/caching/">Caching Dependencies</a></li>
53+
<li><a href="/user/private-dependencies/">Private Dependencies</a></li>
5154
<li><a href="/user/uploading-artifacts/">Uploading Build Artifacts</a></li>
5255
<li><a href="/user/database-setup/">Setting up Services and Databases</a></li>
5356
<li><a href="/user/gui-and-headless-browsers/">Headless Testing with Browsers</a></li>
5457
<li><a href="/user/speeding-up-the-build/">Speeding up the Build</a></li>
5558
<li><a href="/user/multi-os/">Building on Multiple Operating Systems</a></li>
5659
<li><a href="/user/docker/">Using Docker in your Build</a></li>
60+
<li><a href="/user/pull-requests">Building Pull Requests</a></li>
5761
<li><a href="/user/language-specific/">Language Guides</a></li>
5862
<li><a href="/user/deployment/">Deployment Guides</a></li>
5963
<li><a href="/user/integration/platformio/">Embedded Builds with PlatformIO</a></li>
6064
<li><a href="/user/encryption-keys/">Encrypting Sensitive Data</a></li>
6165
<li><a href="/user/encrypting-files/">Encrypting Files</a></li>
6266
<li><a href="/user/ci-environment/">CI Environment Reference</a></li>
6367
<li><a href="/user/osx-ci-environment/">OSX CI Environment Reference</a></li>
68+
<li><a href="/user/trusty-ci-environment/">Trusty CI Environment</a><li>
6469
<li><a href="/user/environment-variables/">Environment Variables</a></li>
65-
<li><a href="/user/common-build-problems/">Common Build Problems</a></li>
6670
<li><a href="/user/ssh-known-hosts/">Adding to SSH Known Hosts</a></li>
6771
<li><a href="/user/github-oauth-scopes/">GitHub Permissions used by Travis CI</a></li>
6872
<li><a href="/user/migrating-from-legacy/">Migrating to Container-Based Infrastructure</a></li>
73+
<li><a href="/user/travis-pro/">Travis CI for Private Projects</a></li>
6974
<li><a href="/user/build-environment-updates">Build Environment Updates (December 2014 and later)</a></li>
7075
</ul>
7176
<h2>Tools</h2>
@@ -94,12 +99,6 @@ <h2>3rd Party Tools and Resources</h2>
9499
<li><a href="/user/resources/">Links and Resources</a></li>
95100
<li><a href="https://scan.coverity.com/travis_ci">Coverity Scan</a></li>
96101
</ul>
97-
<h2>Travis Pro</h2>
98-
<ul>
99-
<li><a href="/user/travis-pro/">Frequently Asked Questions</a></li>
100-
<li><a href="/user/private-dependencies/">Private Dependencies</a></li>
101-
<li><a href="/user/caching/">Caching Dependencies</a></li>
102-
</ul>
103102
</nav>
104103
</section>
105104
<section>

index.html

+1-7
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,7 @@ <h2>Deployment Guides</h2>
3636
<section>
3737
<h2>Common Questions</h2>
3838
<ul>
39-
<li><a href="/user/speeding-up-the-build">How can I make my build faster?</a></li>
40-
<li><a href="/user/using-postgresql/#Selecting-a-PostgreSQL-Version">How do I choose a PostgreSQL version?</a></li>
41-
<li><a href="/user/using-postgresql/#Using-PostGIS">How do I configure PostGIS for my tests?</a></li>
42-
<li><a href="/user/pull-requests">How are pull requests tested?</a></li>
43-
<li><a href="/user/build-timeouts">My builds are timing out, what can I do?</a></li>
44-
<li><a href="/user/repository-providers">What repository providers can I use?</a></li>
45-
<li><a href="/user/pricing/">Why can't I find pricing information?</a></li>
39+
<li><a href="/user/customizing-the-build/#What-git-Repository-Providers-can-I-use">What repository providers can I use?</a></li>
4640
<li><a href="/user/trusty-ci-environment/">Can I use Ubuntu Trusty for my builds?</a><li>
4741
<li><a href="/user/notifications/#Changing-the-email-address-for-build-notifications">How do I change the notifcation email address?</a><li>
4842
</ul>

user/build-timeouts.md

-50
This file was deleted.

user/common-build-problems.md

+121-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
title: Common Build Problems
33
layout: en
44
permalink: /user/common-build-problems/
5+
redirect_from:
6+
- /user/build-timeouts/
57
---
68

79
<div id="toc"></div>
@@ -196,10 +198,128 @@ This can be done with the follow addition to your `.travis.yml`:
196198
The above addition will reinstall the en\_US language pack, as well as the de\_DE
197199
language pack.
198200

199-
## Linux: apt fails to install package with 404 error.
201+
## Linux: apt fails to install package with 404 error
200202

201203
This is often caused by old package database and can be fixed by adding the following to `.travis.yml`:
202204

203205
before_install:
204206
- sudo apt-get update
205207

208+
209+
## Travis CI does not Preserve State Between Builds
210+
211+
Travis CI uses virtual machine snapshotting to make sure no state is preserved between
212+
builds. If you modify CI environment by writing something to a data store, creating
213+
files or installing a package via apt, it does affect subsequent builds.
214+
215+
## SSH is not working as expected
216+
217+
Travis CI runs all commands over SSH in isolated virtual machines. Commands that
218+
modify SSH session state are "sticky" and persist throughout the build. For example,
219+
if you `cd` into a directory, all subsequent commands are run from that directory.
220+
221+
## Git Submodules are not updated correctly
222+
223+
Travis CI automatically initializes and updates submodules when there's a `.gitmodules` file in the root of the repository.
224+
225+
To turn this off, set:
226+
227+
```yml
228+
git:
229+
submodules: false
230+
```
231+
232+
If your project requires specific options for your Git submodules which Travis CI
233+
does not support out of the box, turn off the automatic integration and use the
234+
`before_install` hook to initializes and update them.
235+
236+
For example, to update nested submodules:
237+
238+
```yml
239+
before_install:
240+
- git submodule update --init --recursive
241+
```
242+
243+
## Git cannot clone my Submodules
244+
245+
If your project uses Git submodules, make sure you use public Git URLs. For example, on GitHub, instead of
246+
247+
[email protected]:someuser/somelibrary.git
248+
249+
use
250+
251+
https://github.com/someuser/somelibrary.git
252+
253+
Otherwise, Travis CI builders won't be able to clone your project because they don't have your private SSH key.
254+
255+
## My builds are timing out
256+
257+
Builds can unfortunately time out, either during installation of dependencies, or during the build itself, for instance because of a command that's taking a longer amount of time to run while not producing any output.
258+
259+
Our builds have a global timeout and a timeout that's based on the output. If no output is received from a build for 10 minutes, it's assumed to have stalled for unknown reasons and is subsequently killed.
260+
261+
At other times, installation of dependencies can timeout. Bundler and RubyGems are a relevant example. Network connectivity between our servers can sometimes affect connectivity to APT, Maven or other repositories.
262+
263+
There are few ways to work around that.
264+
265+
### Timeouts installing dependencies
266+
267+
Bundler can time out downloading RubyGems or talking to the APIs at rubygems.org. In the same way, pip can be affected by network connectivity issues to the PyPi mirrors or CDN endpoints.
268+
269+
Bundler itself now has a [built-in feature to retry](http://bundler.io/v1.5/bundle_install.html#retry) gem downloads or API calls when a network error or timeout occurs.
270+
271+
You can add the `--retry` option with the number of retries you'd like to use. *Note: this may become a default in the future on Travis CI.*
272+
273+
Here's what you can add to your .travis.yml:
274+
275+
bundler_args: --retry 3
276+
277+
Beyond Bundler, you can wrap commands using the function `travis_retry` which checks the return code of a command, retrying it three times if the return code is non-zero.
278+
279+
install: travis_retry bundle install
280+
281+
Note that with Bundler, using one or the other should be sufficient to catch network timeouts affecting your build. Using the new `--retry` option has the benefit of giving you finer control about the total amount of retries.
282+
283+
We recommend using `travis_retry` when you have commands that only install one or two RubyGems, for instance, or when they're timing out for other reasons.
284+
285+
Most of our build-internal commands are wrapped with `travis_retry` to reduce the impact of temporary network hiccups.
286+
287+
### Build times out because no output was received
288+
289+
When a long running command or compile step regularly takes longer than 10 minutes without producing any output, you can adjust your build configuration to take that into consideration.
290+
291+
The shell environment in our build system provides a function that helps to work around that, at least for longer than 10 minutes.
292+
293+
If you have a command that doesn't produce output for more than 10 minutes, you can prefix it with `travis_wait`, a function that's exported by our build environment.
294+
295+
install: travis_wait mvn install
296+
297+
`travis_wait` writes a short line to the build log every minute for 20 minutes, extending the amount of time your command has to finish.
298+
299+
We recommend careful use of `travis_wait`, as overusing it can extend your build time when there could be a deeper underlying issue. When in doubt, [file a ticket](https://github.com/travis-ci/travis-ci/issues/new) or [email us](mailto:[email protected]) first to see if something could be improved about this particular command first.
300+
301+
## Troubleshooting Locally in a Docker Image
302+
303+
If you're having trouble tracking down the exact problem in a build it often helps to run the build locally. To do this you need to be using our container based infrastructure (ie, have `sudo: false` in your `.travis.yml`), and to know which Docker image you are using on Travis CI.
304+
305+
### Running a Container Based Docker Image Locally
306+
307+
1. Download and install the Docker Engine:
308+
* [Windows](https://docs.docker.com/installation/windows)
309+
* [OS X](https://docs.docker.com/installation/mac)
310+
* [Ubuntu Linux](https://docs.docker.com/installation/ubuntulinux/)
311+
2. Select an image from [Quay.io](https://quay.io/organization/travisci). If you're not using a language-specific image pick `travis-ruby`. Open a terminal and start an interactive Docker session using the image URL:
312+
313+
```bash
314+
docker run -it quay.io/travisci/travis-ruby /bin/bash
315+
```
316+
317+
3. Switch to the `travis` user:
318+
319+
```bash
320+
su - travis
321+
```
322+
323+
3. Clone your git repository into the `/` folder of the image.
324+
4. Manually install any dependencies.
325+
5. Manually run your Travis CI build command.

user/customizing-the-build.md

+7-38
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ redirect_from:
66
- /user/build-configuration/
77
- /user/build-lifecycle/
88
- /user/how-to-skip-a-build/
9+
- /user/repository-providers/
910
---
1011

1112
<div id="toc"></div>
@@ -449,46 +450,14 @@ hostnames in `/etc/hosts` for both IPv4 and IPv6.
449450
- travis.dev
450451
- joshkalderimis.com
451452

453+
## What git Repository Providers can I use
452454

453-
## Build FAQ
455+
Build and test your open source projects hosted on Github on [travis-ci.org](https://travis-ci.org/).
454456

455-
### Travis CI Preserves No State Between Builds
457+
Build and test your private repositories hosted on Github on [travis-ci.com](https://travis-ci.com/).
456458

457-
Travis CI uses virtual machine snapshotting to make sure no state is left between builds. If you modify CI environment by writing something to a data store, creating files or installing a package via apt, it won't affect subsequent builds.
459+
Travis CI currently does not support repositories hosted on Bitbucket, Gitlab or Atlassian Stash.
458460

459-
### SSH
461+
## Troubleshooting
460462

461-
Travis CI runs all commands over SSH in isolated virtual machines. Commands that modify SSH session state are "sticky" and persist throughout the build.
462-
For example, if you `cd` into a particular directory, all the following commands will be executed from it. This may be used for good (e.g. building subprojects one
463-
after another) or affect tools like `rake` or `mvn` that may be looking for files in the current directory.
464-
465-
### Git Submodules
466-
467-
Travis CI automatically initializes and updates submodules when there's a `.gitmodules` file in the root of the repository.
468-
469-
This can be turned off by setting:
470-
471-
git:
472-
submodules: false
473-
474-
If your project requires some specific option for your Git submodules which Travis CI does not support out of the box, then you can turn the automatic integration off and use the `before_install` hook to initializes and update them.
475-
476-
For example:
477-
478-
before_install:
479-
- git submodule update --init --recursive
480-
481-
This will include nested submodules (submodules of submodules), in case there are any.
482-
483-
484-
### Use Public URLs For Submodules
485-
486-
If your project uses Git submodules, make sure you use public Git URLs. For example, on GitHub, instead of
487-
488-
[email protected]:someuser/somelibrary.git
489-
490-
use
491-
492-
https://github.com/someuser/somelibrary.git
493-
494-
Otherwise, Travis CI builders won't be able to clone your project because they don't have your private SSH key.
463+
Check out the list of [common build problems](/user/common-build-problems/).

user/pricing.md

-12
This file was deleted.

user/pull-requests.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Testing Pull Requests
2+
title: Building Pull Requests
33
layout: en
44
permalink: /user/pull-requests/
55
---

user/travis-pro.md

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
---
2-
title: Travis Pro - Frequently Asked Questions
2+
title: Travis Pro
33
layout: en
44
permalink: /user/travis-pro/
5+
redirect_from:
6+
- /user/pricing/
57
---
68

79
<div id="toc"></div>
810

9-
Note: These issues are related to [Travis Pro](http://travis-ci.com), our hosted
11+
Learn more about [Travis Pro](http://travis-ci.com), our hosted
1012
continuous integration solution for private repositories.
1113

1214
## Can I use pull request testing on Travis Pro?
@@ -35,3 +37,10 @@ You can find more information on this topic in our [Security Statement](https://
3537
## How can I encrypt files that include sensitive data?
3638

3739
You can follow our guide for [encrypting files](/user/encrypting-files/).
40+
41+
## Why can't I find information on pricing on [travis-ci.org](https://travis-ci.org)?
42+
43+
Travis CI is, and always will be, free for open source projects.
44+
45+
For a list of plans and prices for private repositories, look at
46+
[travis-ci.com/plans](https://travis-ci.com/plans).

0 commit comments

Comments
 (0)