{"action":"closed","issue":{"url":"https://api.github.com/repos/ParmEd/ParmEd/issues/956","repository_url":"https://api.github.com/repos/ParmEd/ParmEd","labels_url":"https://api.github.com/repos/ParmEd/ParmEd/issues/956/labels{/name}","comments_url":"https://api.github.com/repos/ParmEd/ParmEd/issues/956/comments","events_url":"https://api.github.com/repos/ParmEd/ParmEd/issues/956/events","html_url":"https://github.com/ParmEd/ParmEd/issues/956","id":298472426,"number":956,"title":"Enclose pwd.getpwuid() in a try...except clause?","user":{"login":"jchodera","id":3656088,"avatar_url":"https://avatars1.githubusercontent.com/u/3656088?v=4","gravatar_id":"","url":"https://api.github.com/users/jchodera","html_url":"https://github.com/jchodera","followers_url":"https://api.github.com/users/jchodera/followers","following_url":"https://api.github.com/users/jchodera/following{/other_user}","gists_url":"https://api.github.com/users/jchodera/gists{/gist_id}","starred_url":"https://api.github.com/users/jchodera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jchodera/subscriptions","organizations_url":"https://api.github.com/users/jchodera/orgs","repos_url":"https://api.github.com/users/jchodera/repos","events_url":"https://api.github.com/users/jchodera/events{/privacy}","received_events_url":"https://api.github.com/users/jchodera/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-20T05:02:16Z","updated_at":"2018-02-28T00:38:12Z","closed_at":"2018-02-28T00:38:12Z","author_association":"CONTRIBUTOR","body":"On [ORNL Titan](https://www.olcf.ornl.gov/for-users/system-user-guides/titan/system-overview/), the call to `getpwuid()` can be problematic when executing on a compute node:\r\n```\r\njchodera1@titan-batch3:~> aprun -n1 yank selftest\r\nTraceback (most recent call last):\r\n  File \"/var//opt/cray/alps/spool/16837882/yank\", line 11, in <module>\r\n    load_entry_point('yank==0.20.1', 'console_scripts', 'yank')()\r\n  File \"/lustre/atlas/scratch/jchodera1/chm126/miniconda3/lib/python3.6/site-packages/pkg_resources/__init__.py\", line 572, in load_entry_point\r\n    return get_distribution(dist).load_entry_point(group, name)\r\n  File \"/lustre/atlas/scratch/jchodera1/chm126/miniconda3/lib/python3.6/site-packages/pkg_resources/__init__.py\", line 2755, in load_entry_point\r\n    return ep.load()\r\n  File \"/lustre/atlas/scratch/jchodera1/chm126/miniconda3/lib/python3.6/site-packages/pkg_resources/__init__.py\", line 2408, in load\r\n    return self.resolve()\r\n  File \"/lustre/atlas/scratch/jchodera1/chm126/miniconda3/lib/python3.6/site-packages/pkg_resources/__init__.py\", line 2414, in resolve\r\n    module = __import__(self.module_name, fromlist=['__name__'], level=0)\r\n  File \"/lustre/atlas/scratch/jchodera1/chm126/miniconda3/lib/python3.6/site-packages/yank/__init__.py\", line 13, in <module>\r\n    from . import utils\r\n  File \"/lustre/atlas/scratch/jchodera1/chm126/miniconda3/lib/python3.6/site-packages/yank/utils.py\", line 39, in <module>\r\n    import parmed\r\n  File \"/lustre/atlas/scratch/jchodera1/chm126/miniconda3/lib/python3.6/site-packages/parmed/__init__.py\", line 25, in <module>\r\n    from parmed import amber, charmm, gromacs, namd, openmm, rosetta, tinker\r\n  File \"/lustre/atlas/scratch/jchodera1/chm126/miniconda3/lib/python3.6/site-packages/parmed/gromacs/__init__.py\", line 45, in <module>\r\n    from parmed.gromacs.gromacstop import GromacsTopologyFile\r\n  File \"/lustre/atlas/scratch/jchodera1/chm126/miniconda3/lib/python3.6/site-packages/parmed/gromacs/gromacstop.py\", line 41, in <module>\r\n    _username = pwd.getpwuid(os.getuid())[0]\r\nKeyError: 'getpwuid(): uid not found: 14280'\r\nApplication 16837882 exit codes: 1\r\nApplication 16837882 resources: utime ~2s, stime ~2s, Rss ~60536, inblocks ~28865, outblocks ~5\r\n```\r\nSince the username is non-essential in importing [`gromacstop.py`](https://github.com/ParmEd/ParmEd/blob/master/parmed/gromacs/gromacstop.py#L41), it would be useful to catch `KeyError` in an `except` branch."}}
{"actor":{"display_login":"swails"}}