Closed Bug 564185 Opened 12 years ago Closed 12 years ago

[amo] File permission problem with pip updates

Categories

(mozilla.org Graveyard :: Server Operations, task)

All
Other
task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jbalogh, Assigned: jbalogh)

Details

I've been seeing this since 12:00pm yesterday:

Cron <apache@mradm02> rm -rf /data/virtualenvs/zamboni/build && /data/virtualenvs/zamboni/bin/pip -q install -U -i https://hudson.mozilla.org/pypi/ -r https://hudson.mozilla.org/pypi/pip-manifest.txt > /dev/null

Traceback (most recent call last):
 File "/data/virtualenvs/zamboni/bin/pip", line 3, in <module>
   sys.exit(pip.main())
 File "/data/virtualenvs/zamboni/lib/python2.6/site-packages/pip/__init__.py", line 75, in main
   return command.main(initial_args, args[1:], options)
 File "/data/virtualenvs/zamboni/lib/python2.6/site-packages/pip/basecommand.py", line 130, in main
   log_fp = open_logfile_append(log_fn)
 File "/data/virtualenvs/zamboni/lib/python2.6/site-packages/pip/basecommand.py", line 182, in open_logfile_append
   log_fp = open(filename, 'a')
IOError: [Errno 13] Permission denied: './pip-log.txt'
I'll bet the dir is owned by root.  It should be owned by apache.
I'll bet if you cleaned up the cruft left by pip in /tmp, you won't run into these issues again! :)
Assignee: server-ops → shyam
17G     total <- /tmp

Wiping it now.
Looks clean now. I thought the new version of pip (0.7.1) was supposed to clean up after itself.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
I've also chowned the virtualenv to apache, so this should work again.
Could this just be leftover cruft from an older pip?  0.7.1 includes tests for temporary file cleanup, so I feel somewhat confident it really is cleaning things up now.

Also as of pip 0.7 it should be putting the log file in ~/.pip/pip.log so that error seems indicative of an older pip being used.
Yeah, I misunderstood which box this was happening on.
Traceback (most recent call last):
 File "/data/virtualenvs/zamboni/bin/pip", line 3, in <module>
   sys.exit(pip.main())
 File "/data/virtualenvs/zamboni/lib/python2.6/site-packages/pip/__init__.py", line 94, in main
   return command.main(initial_args, args[1:], options)
 File "/data/virtualenvs/zamboni/lib/python2.6/site-packages/pip/basecommand.py", line 139, in main
   log_fp = open_logfile(log_fn, 'w')
 File "/data/virtualenvs/zamboni/lib/python2.6/site-packages/pip/basecommand.py", line 194, in open_logfile
   os.makedirs(dirname)
 File "/data/virtualenvs/zamboni/lib64/python2.6/os.py", line 157, in makedirs
   mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/var/www/.pip'
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee: shyam → jeremy.orem+bugs
That traceback was from 10:00am.
$HOME should be set to a writable location (/tmp is fine)
I opened a ticket in pip too (though I'd recommend just setting $HOME now): http://bitbucket.org/ianb/pip/issue/116/opening-log-file-shouldnt-fail
This is happening once an hour.  I don't think it's preview or next.  Is it the box that runs cron jobs?
That's coming from:
0 * * * * rm -rf /data/virtualenvs/zamboni/build && /data/virtualenvs/zamboni/bin/pip -q install -i https://hudson.mozilla.org/pypi/ -r https://hudson.mozilla.org/pypi/pip-manifest.txt > /dev/null


You'll just need to export HOME=/tmp in that cronjob.
Assignee: jeremy.orem+bugs → jbalogh
Not sure if there's any IT action here, closing.
Status: REOPENED → RESOLVED
Closed: 12 years ago12 years ago
Resolution: --- → FIXED
Done in http://github.com/jbalogh/zamboni/commit/88b6ee3fed6196cf5cd2796d2bca87ce7ba08c6d

The IT action here is to make sure it's using /tmp and not filling up the disk, I guess.
Looks fine so far.
Product: mozilla.org → mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.