openworm / OpenWorm

Repository for the main Dockerfile with the OpenWorm software stack and project-wide issues
http://openworm.org
MIT License
2.55k stars 201 forks source link

Fix missing username for UID error. #302

Closed noahbliss closed 3 years ago

noahbliss commented 3 years ago

If the UID of the user who owns the "shared" directory does not correlate to a username inside of the container, the system experiences a critical stop. This change instructs the system to check for write access in the target directory regardless of current owner, fixing this issue and potentially preventing unnecessary permission modifications.

Error:

Unexpected error: <type 'exceptions.KeyError'>
Traceback (most recent call last):
  File "master_openworm.py", line 103, in <module>
    if pwd.getpwuid(os.stat(OW_OUT_DIR).st_uid).pw_name != os.environ['USER']:
KeyError: 'getpwuid(): uid not found: 1121600003'

To reproduce: Access shell inside container.

sudo chown -R 133700:133700 shared
python master_openworm.py
pgleeson commented 3 years ago

Thanks for this @noahbliss and sorry for the delay in testing/integrating it.