Closed Bug 1628498 Opened 4 years ago Closed 4 years ago

Frequent OSError: [Errno 40] Too many levels of symbolic links: '/builds/worker/checkouts/gecko/obj-x86_64-pc-linux-gnu/_virtualenvs/init/bin/python'

Categories

(Firefox Build System :: Task Configuration, defect)

defect
Not set
normal

Tracking

(firefox77 fixed)

RESOLVED FIXED
mozilla77
Tracking Status
firefox77 --- fixed

People

(Reporter: intermittent-bug-filer, Assigned: glandium)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: intermittent-failure, regression, Whiteboard: [stockwell disable-recommended])

Attachments

(2 files)

Filed by: nbeleuzu [at] mozilla.com
Parsed log: https://treeherder.mozilla.org/logviewer.html#?job_id=296852481&repo=autoland
Full log: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/flKUIfnASmiOu2KiXEalMg/runs/0/artifacts/public/logs/live_backing.log


[task 2020-04-08T22:13:11.062Z] Running: /builds/worker/checkouts/gecko/mach python /builds/worker/workspace/mozharness/scripts/web_platform_tests.py --config-file /builds/worker/workspace/mozharness/configs/web_platform_tests/prod_config.py --config-file /builds/worker/workspace/mozharness/configs/remove_executables.py --test-type=testharness --setpref=media.peerconnection.mtransport_process=false --setpref=network.process.enabled=false --allow-software-gl-layers --total-chunk=12 --this-chunk=3 --download-symbols=ondemand
[task 2020-04-08T22:13:11.503Z] Error running mach:
[task 2020-04-08T22:13:11.503Z]
[task 2020-04-08T22:13:11.503Z] ['python', '/builds/worker/workspace/mozharness/scripts/web_platform_tests.py', '--config-file', '/builds/worker/workspace/mozharness/configs/web_platform_tests/prod_config.py', '--config-file', '/builds/worker/workspace/mozharness/configs/remove_executables.py', '--test-type=testharness', '--setpref=media.peerconnection.mtransport_process=false', '--setpref=network.process.enabled=false', '--allow-software-gl-layers', '--total-chunk=12', '--this-chunk=3', '--download-symbols=ondemand']
[task 2020-04-08T22:13:11.503Z]
[task 2020-04-08T22:13:11.503Z] The error occurred in code that was called by the mach command. This is either
[task 2020-04-08T22:13:11.503Z] a bug in the called code itself or in the way that mach is calling it.
[task 2020-04-08T22:13:11.503Z] You can invoke |./mach busted| to check if this issue is already on file. If it
[task 2020-04-08T22:13:11.503Z] isn't, please use |./mach busted file| to report it. If |./mach busted| is
[task 2020-04-08T22:13:11.503Z] misbehaving, you can also inspect the dependencies of bug 1543241.
[task 2020-04-08T22:13:11.503Z]
[task 2020-04-08T22:13:11.503Z] If filing a bug, please include the full output of mach, including this error
[task 2020-04-08T22:13:11.503Z]
[task 2020-04-08T22:13:11.503Z] OSError: [Errno 40] Too many levels of symbolic links: '/builds/worker/checkouts/gecko/obj-x86_64-pc-linux-gnu/_virtualenvs/init/bin/python'
[task 2020-04-08T22:13:11.503Z]
[task 2020-04-08T22:13:11.503Z] File "/builds/worker/checkouts/gecko/python/mach_commands.py", line 66, in python
[task 2020-04-08T22:13:11.503Z] self._activate_virtualenv()
[task 2020-04-08T22:13:11.503Z] File "/builds/worker/checkouts/gecko/python/mozbuild/mozbuild/base.py", line 829, in _activate_virtualenv
[task 2020-04-08T22:13:11.503Z] self.virtualenv_manager.ensure()
[task 2020-04-08T22:13:11.503Z] File "/builds/worker/checkouts/gecko/python/mozbuild/mozbuild/virtualenv.py", line 193, in ensure
[task 2020-04-08T22:13:11.503Z] if self.up_to_date(python):
[task 2020-04-08T22:13:11.503Z] File "/builds/worker/checkouts/gecko/python/mozbuild/mozbuild/virtualenv.py", line 162, in up_to_date
[task 2020-04-08T22:13:11.503Z] if ((python, python_size) != (self.python_path, os.path.getsize(self.python_path)) and
[task 2020-04-08T22:13:11.503Z] File "/usr/lib/python2.7/genericpath.py", line 57, in getsize
[task 2020-04-08T22:13:11.503Z] return os.stat(filename).st_size
[task 2020-04-08T22:13:11.520Z] cleanup
[task 2020-04-08T22:13:11.520Z] + cleanup
[task 2020-04-08T22:13:11.520Z] + local rv=1
[task 2020-04-08T22:13:11.520Z] + [[ -s /builds/worker/.xsession-errors ]]
[task 2020-04-08T22:13:11.520Z] + cp /builds/worker/.xsession-errors /builds/worker/artifacts/public/xsession-errors.log
[task 2020-04-08T22:13:11.522Z] + true
[task 2020-04-08T22:13:11.522Z] + cleanup_xvfb
[task 2020-04-08T22:13:11.522Z] ++ pidof Xvfb
[task 2020-04-08T22:13:11.525Z] + local xvfb_pid=40
[task 2020-04-08T22:13:11.525Z] + local vnc=false
[task 2020-04-08T22:13:11.525Z] + local interactive=false
[task 2020-04-08T22:13:11.525Z] + '[' -n 40 ']'
[task 2020-04-08T22:13:11.525Z] + [[ false == false ]]
[task 2020-04-08T22:13:11.525Z] + [[ false == false ]]
[task 2020-04-08T22:13:11.525Z] + kill 40
[task 2020-04-08T22:13:11.525Z] + screen -XS xvfb quit
[task 2020-04-08T22:13:11.529Z] + exit 1
[fetches 2020-04-08T22:13:11.529Z] removing /builds/worker/fetches
[fetches 2020-04-08T22:13:11.532Z] finished
[taskcluster 2020-04-08 22:13:11.853Z] === Task Finished ===
[taskcluster 2020-04-08 22:13:13.048Z] Unsuccessful task run with exit code: 1 completed in 9.077 seconds

James, the failure seems to be caused by https://hg.mozilla.org/mozilla-central/rev/c4b80e083d0b .
Can you please take a look?

Flags: needinfo?(james)

I suspect somehow mach is trying to setup the init virtualenv with that environment activated, and is linking python in that environment to itself.

We may also have an old version of virtualenv and newer versions may handle that case more gracefully.

Component: General → web-platform-tests
Product: Release Engineering → Testing
QA Contact: catlee

Also affects awsy and GTest and only occurred on two workers: i-0f50e7448c6998851 and i-05ecddf318589cb95

This only failed commit access level 3 tasks and there it all it ran while Try ones were not failing.

Component: web-platform-tests → Task Configuration
Product: Testing → Firefox Build System

Both machines got provisioned between 22:10 and 22:15 UTC yesterday (2020-04-08).

There is something very wrong with that task. It has a checkout cache, and it uses it, while run-task doesn't have --gecko-checkout on its command line.

Yeah, this seems to be happening before any harness-specific code runs; it's mach python that's failing.

Flags: needinfo?(james)

I'm seeing this for some tasks in my try push https://treeherder.mozilla.org/#/jobs?repo=try&selectedJob=296934982&tier=1%2C2%2C3&revision=da023a92be364c1511a87a17b019d04a9a6b5187 on different workers to the ones that Aryx mentioned. Is there a chance that this is affecting more workers over time and we're going to end up with everything broken?

James' link is a machine (i-0f7094f6e9cfe0306) which first ran tasks successfully on Try and production and later failed the ones on Try.

3 more machines which failed on production:
i-083c3cefe33c1f81f
i-0a066f51530f28ba7
i-0a702fffd06ab973f

Flags: needinfo?(mozilla)
Severity: normal → critical
Priority: P5 → --

This also happened locally:

./mach wpt --no-preload --setpref marionette.log.level=Trace testing/web-platform/tests/infrastructure/reftest/reftest_match-print.html  --reftest-screenshot=always --timeout-multiplier 10000
New python executable in /home/jgraham/develop/gecko/obj-x86_64-pc-linux-gnu/_virtualenvs/init/bin/python2.7
Not overwriting existing python script /home/jgraham/develop/gecko/obj-x86_64-pc-linux-gnu/_virtualenvs/init/bin/python (you must use /home/jgraham/develop/gecko/obj-x86_64-pc-linux-gnu/_virtualenvs/init/bin/python2.7)
Traceback (most recent call last):
  File "/home/jgraham/develop/gecko/third_party/python/virtualenv/virtualenv.py", line 2634, in <module>
    main()
  File "/home/jgraham/develop/gecko/third_party/python/virtualenv/virtualenv.py", line 870, in main
    symlink=options.symlink,
  File "/home/jgraham/develop/gecko/third_party/python/virtualenv/virtualenv.py", line 1162, in create_environment
    install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages=site_packages, clear=clear, symlink=symlink)
  File "/home/jgraham/develop/gecko/third_party/python/virtualenv/virtualenv.py", line 1691, in install_python
    raise e
OSError: [Errno 40] Too many levels of symbolic links
Error running mach:

    ['wpt', '--no-preload', '--setpref', 'marionette.log.level=Trace', 'testing/web-platform/tests/infrastructure/reftest/reftest_match-print.html', '--reftest-screenshot=always', '--timeout-multiplier', '10000']

The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.
You can invoke |./mach busted| to check if this issue is already on file. If it
isn't, please use |./mach busted file| to report it. If |./mach busted| is
misbehaving, you can also inspect the dependencies of bug 1543241.

If filing a bug, please include the full output of mach, including this error
message.

The details of the failure are as follows:

Exception: Failed to create virtualenv: /home/jgraham/develop/gecko/obj-x86_64-pc-linux-gnu/_virtualenvs/init (virtualenv.py retcode: 1)

  File "/home/jgraham/develop/gecko/testing/web-platform/mach_commands.py", line 375, in run_wpt
    return self.run_web_platform_tests(**params)
  File "/home/jgraham/develop/gecko/testing/web-platform/mach_commands.py", line 345, in run_web_platform_tests
    self.setup()
  File "/home/jgraham/develop/gecko/testing/web-platform/mach_commands.py", line 337, in setup
    self._activate_virtualenv()
  File "/home/jgraham/develop/gecko/python/mozbuild/mozbuild/base.py", line 829, in _activate_virtualenv
    self.virtualenv_manager.ensure()
  File "/home/jgraham/develop/gecko/python/mozbuild/mozbuild/virtualenv.py", line 195, in ensure
    return self.build(python)
  File "/home/jgraham/develop/gecko/python/mozbuild/mozbuild/virtualenv.py", line 499, in build
    self.create(python)
  File "/home/jgraham/develop/gecko/python/mozbuild/mozbuild/virtualenv.py", line 239, in create
    self.virtualenv_root, result))

Bug 1627163 looks a bit suspicious in that it's the only recent change to the virtualenv code.

Flags: needinfo?(mh+mozilla)

The tree is closed for this.

Severity: critical → blocker
Summary: Intermittent OSError: [Errno 40] Too many levels of symbolic links: '/builds/worker/checkouts/gecko/obj-x86_64-pc-linux-gnu/_virtualenvs/init/bin/python' → Trees closed - Frequent OSError: [Errno 40] Too many levels of symbolic links: '/builds/worker/checkouts/gecko/obj-x86_64-pc-linux-gnu/_virtualenvs/init/bin/python'

I did hit this locally and a clobber helped, fwiw.

Fwiw:

$ ls -la /home/emilio/src/moz/gecko/obj-debug/_virtualenvs/init/bin/                                                                                                                                                                       
total 56
drwxr-xr-x. 2 emilio emilio 4096 Apr  9 19:11 .
drwxr-xr-x. 5 emilio emilio 4096 Apr  8 12:24 ..
-rw-r--r--. 1 emilio emilio 2243 Apr  8 12:24 activate
-rw-r--r--. 1 emilio emilio 1462 Apr  8 12:24 activate.csh
-rw-r--r--. 1 emilio emilio 3127 Apr  8 12:24 activate.fish
-rw-r--r--. 1 emilio emilio 1751 Apr  8 12:24 activate.ps1
-rw-r--r--. 1 emilio emilio 1517 Apr  8 12:24 activate_this.py
-rwxr-xr-x. 1 emilio emilio  282 Apr  8 12:24 easy_install
-rwxr-xr-x. 1 emilio emilio  282 Apr  8 12:24 easy_install-2.7
-rwxr-xr-x. 1 emilio emilio  269 Apr  8 12:24 pip
-rwxr-xr-x. 1 emilio emilio  269 Apr  8 12:24 pip2
-rwxr-xr-x. 1 emilio emilio  269 Apr  8 12:24 pip2.7
lrwxrwxrwx. 1 emilio emilio    7 Apr  9 19:11 python -> python2
lrwxrwxrwx. 1 emilio emilio    9 Apr  8 12:24 python2 -> python2.7
lrwxrwxrwx. 1 emilio emilio    7 Apr  9 19:11 python2.7 -> python2
-rwxr-xr-x. 1 emilio emilio 2372 Apr  8 12:24 python-config
-rwxr-xr-x. 1 emilio emilio  260 Apr  8 12:24 wheel

In the already-clobbered build:

$ ls -la /home/emilio/src/moz/mozilla-unified/obj-debug/_virtualenvs/init/bin/                                                                                                                                                             
total 72
drwxr-xr-x. 2 emilio emilio  4096 Apr  9 19:04 .
drwxr-xr-x. 5 emilio emilio  4096 Apr  9 19:04 ..
-rw-r--r--. 1 emilio emilio  2253 Apr  9 19:04 activate
-rw-r--r--. 1 emilio emilio  1472 Apr  9 19:04 activate.csh
-rw-r--r--. 1 emilio emilio  3137 Apr  9 19:04 activate.fish
-rw-r--r--. 1 emilio emilio  1751 Apr  9 19:04 activate.ps1
-rw-r--r--. 1 emilio emilio  1517 Apr  9 19:04 activate_this.py
-rwxr-xr-x. 1 emilio emilio   290 Apr  9 19:04 easy_install
-rwxr-xr-x. 1 emilio emilio   290 Apr  9 19:04 easy_install-2.7
-rwxr-xr-x. 1 emilio emilio   277 Apr  9 19:04 pip
-rwxr-xr-x. 1 emilio emilio   277 Apr  9 19:04 pip2
-rwxr-xr-x. 1 emilio emilio   277 Apr  9 19:04 pip2.7
lrwxrwxrwx. 1 emilio emilio     7 Apr  9 19:04 python -> python2
-rwxr-xr-x. 1 emilio emilio 16056 Apr  9 19:04 python2
lrwxrwxrwx. 1 emilio emilio     7 Apr  9 19:04 python2.7 -> python2
-rwxr-xr-x. 1 emilio emilio  2382 Apr  9 19:04 python-config
-rwxr-xr-x. 1 emilio emilio   268 Apr  9 19:04 wheel
Assignee: nobody → emilio
Status: NEW → ASSIGNED
Pushed by malexandru@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/88d221a0324a
Hackaround: Try to build virtualenv from scratch if there was a previous one. r=rstewart
Assignee: emilio → mh+mozilla
Flags: needinfo?(mh+mozilla)
Regressed by: 1627163
Has Regression Range: --- → yes
Keywords: regression
Keywords: leave-open
Severity: blocker → normal
Summary: Trees closed - Frequent OSError: [Errno 40] Too many levels of symbolic links: '/builds/worker/checkouts/gecko/obj-x86_64-pc-linux-gnu/_virtualenvs/init/bin/python' → Frequent OSError: [Errno 40] Too many levels of symbolic links: '/builds/worker/checkouts/gecko/obj-x86_64-pc-linux-gnu/_virtualenvs/init/bin/python'

This also reverts the previous hack around the issue.

Keywords: leave-open
Flags: needinfo?(mozilla)
Pushed by mh@glandium.org:
https://hg.mozilla.org/integration/autoland/rev/81bc8ca6099a
Fix corner-case in virtualenv creation. r=rstewart
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla77
See Also: → 1633774
See Also: → 1658688
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: