New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test_os: test_chown() started to fail on AMD64 FreeBSD 10-STABLE Non-Debug 3.* buildbots #81581
Comments
https://buildbot.python.org/all/#/builders/167/builds/1265 test_chown (test.test_os.ChownFileTests) ... ERROR ====================================================================== Traceback (most recent call last):
File "/usr/home/buildbot/python/3.x.koobs-freebsd10.nondebug/build/Lib/test/test_os.py", line 1327, in test_chown
os.chown(support.TESTFN, uid, gid_1)
PermissionError: [Errno 1] Operation not permitted: '@test_95158_tmp' Extract of the test: import grp
groups = [g.gr_gid for g in grp.getgrall() if getpass.getuser() in g.gr_mem]
if hasattr(os, 'getgid'):
process_gid = os.getgid()
if process_gid not in groups:
groups.append(process_gid)
Extract of test.pythoninfo: os.uid: 1002 I'm not sure that the code to manually get groups from grp.getgrall() is correct. Why not relying on the *current* groups, os.getgroups()? Note: there is also os.getgrouplist(), I'm not sure of the difference between os.getgroups() and os.getgrouplist(). I know that os.getgrouplist() was modified recently to use:
|
This looks like a reincarnation of bpo-27838 |
And I just remembered that I had to restart the build worker service on that host (koobs-freebsd10) this morning as I was receiving messaging that the worker had gone missing. I ran which is the same as the prevailing reproduction case in bpo-27838 I could restart the worker to make the issue go away, but I think the underlying issue should be fixed instead. Should we close this as a dupe and reopen the original? |
I merged my pythoninfo change, more complete pythoninfo from the buildbot: os.getgid: 1002 pwd.getpwuid(1002): pwd.struct_passwd(pw_name='buildbot', pw_passwd='*', pw_uid=1002, pw_gid=1002, pw_gecos='FreeBSD BuildBot', pw_dir='/home/buildbot', pw_shell='/bin/sh') IMHO the test is wrong: it should rely on os.getgroups() rather tan "discover" groups from pw.getpwall(). |
I'm connected to the FreeBSD CURRENT buildbot as the user "haypo". I'm unable to reproduce the bug: CURRENT-amd64% id CURRENT-amd64% ./python -m test test_os -m test_chown Moreover, it seems like something changes on the buildbot, since the user "buildbot" now has 0 group!? $ ./python
>>> [g.gr_gid for g in grp.getgrall() if 'buildbot' in g.gr_mem]
[] Or maybe as the user "haypo", I cannot see *all* groups. In case of doubt, I will blindly apply my fix PR 14374. |
I merged my fix. I close the issue and hope that the test will not fail again ;-) Python 2.7 is not affected: it doesn't have test_chown(). |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: