Page MenuHomePhabricator

failed to upload patch
Closed, ResolvedPublic

Description

I use gerrit patch uploader to upload patch to file `families/wikipedia_family.py``` update ar namespace aliases in pywikibot compat, but I get error many times (attached).

I am logging in and fill:
Project: pywikibot/compat
Author : Zaher.Kadour <zaher.kadour@gmail.com>
Commit message: Update ar namespace aliases
Patch: paste the patch (attached)

Event Timeline

access(".git/hooks/commit-msg", X_OK)   = -1 EACCES (Permission denied)

yet

tools.gerrit-patch-uploader@tools-webgrid-lighttpd-1412:/tmp/218464.1.webgrid-lighttpd/tmpnut9z3$ ls -l .git/hooks/commit-msg
-rwxr-xr-x 1 tools.gerrit-patch-uploader tools.gerrit-patch-uploader 4662 Aug 27 11:49 .git/hooks/commit-msg

tools.gerrit-patch-uploader@tools-webgrid-lighttpd-1412:/tmp/218464.1.webgrid-lighttpd/tmpnut9z3$ .git/hooks/commit-msg
-bash: .git/hooks/commit-msg: Permission denied

This seems to be linked to the /tmp mount:

tools.gerrit-patch-uploader@tools-webgrid-lighttpd-1412:/tmp/218464.1.webgrid-lighttpd/tmpnut9z3/.git/hooks$ cat > test
#!/bin/sh
echo test
tools.gerrit-patch-uploader@tools-webgrid-lighttpd-1412:/tmp/218464.1.webgrid-lighttpd/tmpnut9z3/.git/hooks$ chmod 755 test
tools.gerrit-patch-uploader@tools-webgrid-lighttpd-1412:/tmp/218464.1.webgrid-lighttpd/tmpnut9z3/.git/hooks$ ./test
-bash: ./test: Permission denied
tools.gerrit-patch-uploader@tools-webgrid-lighttpd-1412:/tmp/218464.1.webgrid-lighttpd/tmpnut9z3/.git/hooks$ cd ~
tools.gerrit-patch-uploader@tools-webgrid-lighttpd-1412:~$ cat > test
#!/bin/sh
echo test
tools.gerrit-patch-uploader@tools-webgrid-lighttpd-1412:~$ chmod 755 test
tools.gerrit-patch-uploader@tools-webgrid-lighttpd-1412:~$ ./test
test
tools.gerrit-patch-uploader@tools-webgrid-lighttpd-1412:~$ cd /tmp
tools.gerrit-patch-uploader@tools-webgrid-lighttpd-1412:/tmp$ cat > test
#!/bin/sh
echo test
tools.gerrit-patch-uploader@tools-webgrid-lighttpd-1412:/tmp$ chmod 755 test
tools.gerrit-patch-uploader@tools-webgrid-lighttpd-1412:/tmp$ ./test
-bash: ./test: Permission denied
tools.gerrit-patch-uploader@tools-webgrid-lighttpd-1412:/tmp$ mount | grep '/tmp'
/dev/mapper/vd-separate--tmp on /tmp type ext4 (rw,noexec,nosuid,nodev)

Aha. Now why did that suddenly change...?

It *hasn't* changed recently. Uh?

https://github.com/wikimedia/operations-puppet/commit/dafe707988bfc773659211a023f8c93dc6628fef

At the same time, a simple solution is to install the hook as a global hook for the gerrit-patch-uploader user.

.. except that requires a new version of git. I'll just hack the 'Commit-Id: ...' into the message in Python >_<

valhallasw claimed this task.