-
Notifications
You must be signed in to change notification settings - Fork 11
.python_eggs
Issue: You're deploying the Manager for the first time and, upon running the init script you get a traceback that references .python_eggs directory permissions:
root@ubuntu-trusty-1:/home/toconnell/kdm-manager/v1# /etc/init.d/kdm-manager start
Starting kdm-manager...
User with uid 1000 does not have a 'python-eggs' directory!
Attempting to create ~/.python-eggs as 1000...
Traceback (most recent call last):
File "/etc/init.d/kdm-manager", line 96, in <module>
toggle_server()
File "/etc/init.d/kdm-manager", line 70, in toggle_server
os.mkdir(egg_cache)
OSError: [Errno 13] Permission denied: '/home/toconnell/.python-eggs/'
Cause: The settings.cfg
file feeds information to the Manager's init script about the user who will run the Manager as well as the path to that user's .python-eggs
folder. This information is used to set the PYTHON_EGG_CACHE
environment variable (which is used by some of the Manager's dependencies).
When you run the init script as root, the script checks for the existence of the folder as the user who will run the manager and, if the folder does not exist, it attempts to create it.
If this user does not have permission to create this directory in its own home directory, the init script will throw this traceback.
Resolution: Double-check your settings.cfg file. If you've got the wrong uid/gid for the user who wants to run the Manager (e.g. toconnell), you're going to get permission errors here.
The init script does some prints to stdout/stderr to help debug these types of issues but, at the end of the day, if your uid/gid stuff configs aren't correct, the init script won't run. It's designed to be very particular about which user runs the app.
Additional note/comment:
Ultimately, we have to do this because pymongo-3.2.2 wants to create an egg file of the user who is going to run the manager ('toconnell' above).
toconnell@mona:~$ ls -ltarh .python-eggs/
total 12K
drwxr-xr-x 3 toconnell toconnell 4.0K Jun 5 10:03 .
drwxr-xr-x 4 toconnell toconnell 4.0K Jun 5 10:03 pymongo-3.2.2-py2.7-linux-x86_64.egg-tmp
drwxr-xr-x 12 toconnell toconnell 4.0K Sep 4 12:24 ..
If your deployment wants to work differently, hit me up on the Issues tab and we can brainstorm.