Large pip installs exceed maximum log length

I’m seeing the following error in my build log:

Collecting torch>=0.4 (from -r requirements.txt (line 7))
Downloading https://files.pythonhosted.org/packages/f5/3b/0b8de6e654c2983898564226792c6f09d9bcaba97b7b29c40e4ed4ae43ed/torch-1.0.0-cp37-cp37m-manylinux1_x86_64.whl (591.8MB)
73% |███████████████████████▌ | 434.3MB 36.8MB/s eta 0:00:05
The job exceeded the maximum log length, and has been terminated.

Any idea how to resolve this? My log is only 1042 lines long. Is it the relatively large size of the torch wheel that’s causing this problem?

1 Like

Try sending the output to a file (or in the extreme cases /dev/null).

I managed to track down the issue. I got lucky with one of the builds and got the following log output before it crashed:


If I use:

$ pip install --progress-bar off

it disables the progress bar, the maximum log length isn’t exceeded, and the build successfully completes. This is likely a bug in pip for very large downloads. I’ll see if anyone has ever reported it and submit a new issue if not.

Filed an issue with the pip developers: https://github.com/pypa/pip/issues/6101

Got a response from the pip developers:

It looks like Travis doesn’t handle terminal control characters the same way as a real terminal would: after seeing BS and CR, it doesn’t move a virtual “caret” backwards and overwrite characters on the current line with the following output.

So, this seems like Travis’ problem because without secret variables, Travis reports itself as an xterm terminal, thus giving pip the right to use terminal control characters.

For large downloads like pip install torch, the progress bar accrues so much cruft that it fills up the logs. Is there any way to resolve this terminal control character bug? If not, I think the default install for language: python should be changed to:

pip install --progress-bar off -r requirements.txt

Our logs are streams; it is not a true terminal. As there is no default install command for Python builds, it is entirely up to you to deal with this situation.

According to https://docs.travis-ci.com/user/languages/python/, the default is:

pip install -r requirements.txt

Ah, you are right about that. We welcome your PR to improve that.

@BanzaiMan I would love to submit a PR! Where can I find the appropriate repo and file that needs to be modified?

2 Likes

I have the same problem. I tried

- pip install --quiet --progress-bar off -r requirements.txt

and

- pip install --progress-bar off -r requirements.txt

in my config file but the progressbar still flooded the log.

Any ideas on how to mitigate this issue?

I created a PR since I couldn’t find another one and the code is still the same

The issue can be mitigated by adding ‘dist: xenial’ to your config file

This had been solved in

Note that this fix will only work out of the box since Xenial because Trusty’s stock Pip is too old to support the option, you’d need to upgrade it first (e.g. at the before_install: phase if you use the default install: command).