Closed Bug 1565314 Opened 5 months ago Closed 5 months ago

Mass failures on mozilla-central "mozinstall.mozinstall.InstallError: Failed to install "/builds/worker/workspace/build/target.tar.bz2 ([Errno 22] Invalid argument)""


(Release Engineering :: General, defect)

Not set


(firefox70 fixed)

Tracking Status
firefox70 --- fixed


(Reporter: nataliaCs, Assigned: mshal)




(1 file)

Push with failures:

*E.g. Failure log:

[task 2019-07-11T17:05:29.049Z] 17:05:29 INFO - Copy/paste: /builds/worker/workspace/build/venv/bin/mozinstall /builds/worker/workspace/build/installer.tar.bz2 --destination /builds/worker/workspace/build/application
[task 2019-07-11T17:05:29.328Z] 17:05:29 INFO - Reading from file tmpfile_stdout
[task 2019-07-11T17:05:29.329Z] 17:05:29 INFO - Output received:
[task 2019-07-11T17:05:29.329Z] 17:05:29 INFO - src: /builds/worker/workspace/build/installer.tar.bz2
[task 2019-07-11T17:05:29.330Z] 17:05:29 ERROR - Errors received:
[task 2019-07-11T17:05:29.330Z] 17:05:29 INFO - Reading from file tmpfile_stderr
[task 2019-07-11T17:05:29.330Z] 17:05:29 ERROR - Traceback (most recent call last):
[task 2019-07-11T17:05:29.330Z] 17:05:29 ERROR - File "/builds/worker/workspace/build/venv/bin/mozinstall", line 9, in <module>
[task 2019-07-11T17:05:29.330Z] 17:05:29 ERROR - load_entry_point('mozInstall==2.0.0', 'console_scripts', 'mozinstall')()
[task 2019-07-11T17:05:29.331Z] 17:05:29 ERROR - File "/builds/worker/workspace/build/venv/lib/python2.7/site-packages/mozinstall/", line 360, in install_cli
[task 2019-07-11T17:05:29.332Z] 17:05:29 ERROR - install_path = install(src, options.dest)
[task 2019-07-11T17:05:29.332Z] 17:05:29 ERROR - File "/builds/worker/workspace/build/venv/lib/python2.7/site-packages/mozinstall/", line 152, in install
[task 2019-07-11T17:05:29.333Z] 17:05:29 ERROR - reraise(InstallError, error, trbk)
[task 2019-07-11T17:05:29.333Z] 17:05:29 ERROR - File "/builds/worker/workspace/build/venv/lib/python2.7/site-packages/mozinstall/", line 133, in install
[task 2019-07-11T17:05:29.334Z] 17:05:29 ERROR - install_dir = mozfile.extract(src, dest)[0]
[task 2019-07-11T17:05:29.334Z] 17:05:29 ERROR - File "/builds/worker/workspace/build/venv/lib/python2.7/site-packages/mozfile/", line 97, in extract
[task 2019-07-11T17:05:29.335Z] 17:05:29 ERROR - namelist = extract_zip(src, dest)
[task 2019-07-11T17:05:29.335Z] 17:05:29 ERROR - File "/builds/worker/workspace/build/venv/lib/python2.7/site-packages/mozfile/", line 58, in extract_zip
[task 2019-07-11T17:05:29.335Z] 17:05:29 ERROR - bundle = zipfile.ZipFile(src)
[task 2019-07-11T17:05:29.336Z] 17:05:29 ERROR - File "/usr/lib/python2.7/", line 770, in init
[task 2019-07-11T17:05:29.337Z] 17:05:29 ERROR - self._RealGetContents()
[task 2019-07-11T17:05:29.337Z] 17:05:29 ERROR - File "/usr/lib/python2.7/", line 829, in _RealGetContents
[task 2019-07-11T17:05:29.337Z] 17:05:29 ERROR -, 0)
[task 2019-07-11T17:05:29.337Z] 17:05:29 ERROR - mozinstall.mozinstall.InstallError: Failed to install "/builds/worker/workspace/build/installer.tar.bz2 ([Errno 22] Invalid argument)"
[task 2019-07-11T17:05:29.337Z] 17:05:29 ERROR - Return code: 1
[task 2019-07-11T17:05:29.338Z] 17:05:29 WARNING - setting return code to 3
[task 2019-07-11T17:05:29.338Z] 17:05:29 FATAL - Halting on failure while running ['/builds/worker/workspace/build/venv/bin/mozinstall', '/builds/worker/workspace/build/installer.tar.bz2', '--destination', '/builds/worker/workspace/build/application']
[task 2019-07-11T17:05:29.339Z] 17:05:29 FATAL - Running post_fatal callback...
[task 2019-07-11T17:05:29.339Z] 17:05:29 FATAL - Exiting 3

Task details:

tomprince pointed out that it appears to be handling the tar.bz2 file as a zip file. We ran into this in mar repackaging as well in bug 1552672, and the fix there was to use is_tarfile as the trigger rather than is_zipfile. The is_zipfile call is too lenient and sometimes thinks a file is a zip just because it has a random set of 4 bytes at a particular location in the file.

We don't need to back anything out for this, it's just that we happened to get unlucky on this push and a target.tar.bz2 was created with the magic bytes that makes is_zipfile() return True. Still, we should fix the is_zipfile() calls so we don't stumble on it in the future.

Assignee: nobody → mshal
See Also: → 1552672

Similar to bug 1552672, very rarely is_zipfile() can return True on a
tarfile if the tarfile happens to contain a magic four byte sequence at
the right location in the file. By checking for is_zipfile() first, we
try to unzip the tar file and then fail. Instead we can call
is_tarfile() first, which is more robust, and call is_zipfile() last.

Pushed by
use is_tarfile() check before is_zipfile() in mozinstall; r=ahal
Closed: 5 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.