Build cache from the default branch is not reused; "The job exceeded the maximum log length" but the log is short

Travis build is not always able to download the cached maven dependencies due to the following error:

Setting up build cache
$ export CASHER_DIR=${TRAVIS_HOME}/.casher
0.29s$ Installing caching utilities
0.00s2.54sattempting to download cache archive
fetching 1.6.2-jdk8/cache--linux-xenial-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855--jdk-openjdk8.tgz
fetching 1.6.2-jdk8/cache-linux-xenial-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855--jdk-openjdk8.tgz
fetching 1.6.2-jdk8/cache--jdk-openjdk8.tgz
fetching master/cache--linux-xenial-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855--jdk-openjdk8.tgz
fetching master/cache-linux-xenial-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855--jdk-openjdk8.tgz
fetching master/cache--jdk-openjdk8.tgz
could not download cache
0.00s1.19sadding /home/travis/.m2 to cache

The effect of this error is that all maven dependencies are downloaded from scratch at each job, producing an extremely long log that breaks the build as it exceeds the maximum size.
Please refer to those builds for having more details about the issue:

The build configuration is available at

Could you kindly help?

The cache is not downloaded for the 1.6.2-jdk8 branch from the master branch because it has a different configuration, so its cache cannot be reused. Note the different cache IDs:

The hash (which is a hash of an amalgam of all configuration-defined envvars (as of this writing)) is the same – but the JDK version is different – resulting in a different cache ID.

Your build needs be able to finish when there’s no cache – since a cache is generally treated as volatile.
If e.g. a build is taking too long, it can be split into stages.
But in your case, the problem is The job exceeded the maximum log length, and has been terminated. – despite a seemmingly short log of only 3282 lines in the job window.

If you look at the raw log for, the most of the log is taken up by download progress messages – which you don’t see in the job window because of terminal control characters they use (this is by design, Maven specifically arranges it so that they become invisible once a download is finished). So

Sounds great!! Thank you!!