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)""

Categories

(Release Engineering :: General, defect)

defect
Not set

Tracking

(firefox70 fixed)

RESOLVED FIXED
Tracking Status
firefox70 --- fixed

People

(Reporter: nataliaCs, Assigned: mshal)

References

Details

Attachments

(1 file)

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=mozilla-central&revision=8013e87c08ac8b3a8d6912936f594a8219170b1e&selectedJob=255979922

*E.g. Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=255979922&repo=mozilla-central&lineNumber=1278

[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/mozinstall.py", 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/mozinstall.py", 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/mozinstall.py", 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/mozfile.py", 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/mozfile.py", 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/zipfile.py", 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/zipfile.py", line 829, in _RealGetContents
[task 2019-07-11T17:05:29.337Z] 17:05:29 ERROR - fp.seek(self.start_dir, 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: https://tools.taskcluster.net/groups/OTDvzxj4THmmBpw_jlQq6w/tasks/HLGOtu4LQwO94Vv6DzLrXA/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 mshal@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c28bc7d0b078
use is_tarfile() check before is_zipfile() in mozinstall; r=ahal
Status: NEW → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.