Page MenuHomePhabricator

Scap "import scap.git" fails on beta in CI
Closed, ResolvedPublic

Description

20:56:07 Traceback (most recent call last):
20:56:07   File "/usr/bin/scap", line 32, in <module>
20:56:07     from scap import cli
20:56:07   File "/usr/lib/python2.7/dist-packages/scap/__init__.py", line 29, in <module>
20:56:07     from scap.main import (
20:56:07   File "/usr/lib/python2.7/dist-packages/scap/main.py", line 46, in <module>
20:56:07     import scap.tasks as tasks
20:56:07   File "/usr/lib/python2.7/dist-packages/scap/tasks.py", line 45, in <module>
20:56:07     import scap.git as git
20:56:07   File "/usr/lib/python2.7/dist-packages/scap/git.py", line 37, in <module>
20:56:07     GIT_VERSION = version()
20:56:07   File "/usr/lib/python2.7/dist-packages/scap/git.py", line 26, in version
20:56:07     v = gitcmd("version", cwd=".")
20:56:07   File "/usr/lib/python2.7/dist-packages/scap/runcmd.py", line 83, in gitcmd
20:56:07     return _runcmd(["git", subcommand] + list(args), **kwargs)
20:56:07   File "/usr/lib/python2.7/dist-packages/scap/runcmd.py", line 63, in _runcmd
20:56:07     p = subprocess.Popen(argv, **kwargs)
20:56:07   File "/usr/lib/python2.7/subprocess.py", line 390, in __init__
20:56:07     errread, errwrite)
20:56:07   File "/usr/lib/python2.7/subprocess.py", line 1024, in _execute_child
20:56:07     raise child_exception
20:56:07 OSError: [Errno 13] Permission denied: '.'

From e.g. https://integration.wikimedia.org/ci/job/beta-scap-eqiad/345259/ .

Event Timeline

Running scap as jenkins-deploy fails differently than if I run it with my own account (taavi), which seems to be caused by that on deployment-deploy01 some files in /srv/mediawiki-staging/php-master/cache/gitinfo are group writable (rw-rw-r--) and some are not (rw-r--r--). scap-cdb-rebuild is being executed via sudo as l10nupdate.

I believe that error message in task description is coming from another deploy server (strace doesn't show any file reading before the crash, but does some network activity), and for some reason deployment-deploy[02-03] are running Scap 3.16 instead of 3.17.

Change 678027 had a related patch set uploaded (by Ahmon Dancy; author: Ahmon Dancy):

[mediawiki/tools/scap@master] Don't pass cwd="." to gitcmd()

https://gerrit.wikimedia.org/r/678027

Change 678027 merged by jenkins-bot:

[mediawiki/tools/scap@master] Don't pass cwd="." to gitcmd()

https://gerrit.wikimedia.org/r/678027