Error Opening File For Reading Permission Denied Apache
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of could not open file for reading permission denied this site About Us Learn more about Stack Overflow the company Business Learn could not open file for reading permission denied postgresql more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question postgres could not open file for reading permission denied x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Apache
Error Opening Trace File Permission Denied
says Error opening file for reading: Permission Denied up vote 6 down vote favorite I am trying to run a django (1.6) project with apache (2.2.22) and mod_wsgi (3.4). My python is 2.7.3, the ubuntu 12.04 default. I have set everything as chmod 777 from /var/www to downwards. Unfortunately it gives me Error opening file for reading: Permission Denied and then Premature end error opening trace file permission denied (13) of script headers: wsgi.py can anybody tell me what I am doing wrong? I am posting my error.log here root@whq-4:/var/www/Imse_dev2/Imse/Imse# tail -f /var/log/apache2/error.log [Tue Jan 14 14:16:04 2014] [notice] caught SIGTERM, shutting down [Tue Jan 14 14:16:08 2014] [notice] Apache/2.2.22 (Ubuntu) mod_wsgi/3.4 Python/2.7.3 configured -- resuming normal operations [Tue Jan 14 14:16:28 2014] [error] /var/www/Imse_dev2/Imse Error opening file for reading: Permission denied [Tue Jan 14 14:21:32 2014] [error] [client 127.0.0.1] Premature end of script headers: wsgi.py [Tue Jan 14 14:29:13 2014] [notice] caught SIGTERM, shutting down [Tue Jan 14 14:29:13 2014] [notice] Apache/2.2.22 (Ubuntu) mod_wsgi/3.4 Python/2.7.3 configured -- resuming normal operations [Tue Jan 14 14:29:17 2014] [error] /var/www/Imse_dev2/Imse Error opening file for reading: Permission denied [Tue Jan 14 14:34:21 2014] [error] [client 127.0.0.1] Premature end of script headers: wsgi.py And also my httpd.conf file #LimitRequestLine 200475 #LimitRequestFieldSize 200475 WSGIDaemonProcess imse_dev2_wsgi python-path=/var/www/Imse_dev2/Imse/Imse #LoadModule deflate_module modules/mod_deflate.so #LoadModule headers_module modules/mod_headers.so
users started deploying it and very soon ran into an annoying problem. The output of each ralph command was preceeded permission denied apache log with a meaningless message out of nowhere: Error opening file for reading: Permission denied Took me a while to identify the culprit and work around this. The funny part of this error message is how it doesn't specify which file couldn't be opened. To add insult to injury, the error does not show up when you actually try http://stackoverflow.com/questions/21114303/apache-says-error-opening-file-for-reading-permission-denied to debug the process with strace: $ ralph maxid Error opening file for reading: Permission denied Models from 'auth': Permission = 402 (297 objects) Group = 7 (7 objects) ... $ strace ralph maxid 2>&1 | grep "Permission" write(1, "Models from 'auth':\n Permission "..., 3498Models from 'auth': Permission = 402 (297 objects) Ditto when you try investigating the problem http://lukasz.langa.pl/5/error-opening-file-for-reading-permission-denied/ with gdb: $ gdb --quiet --args ~/bin/python -m ralph maxid Reading symbols from /home/ralph/bin/python... (no debugging symbols found)...done. (gdb) r Starting program: /home/ralph/bin/python -m ralph maxid [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [New Thread 0x7fffed06b700 (LWP 20724)] [Thread 0x7fffed06b700 (LWP 20724) exited] Models from 'auth': Permission = 402 (297 objects) Group = 7 (7 objects) ... PIL, it's you again! Needless to say, it wasn't easy to find the culprit. Fortunately, the -v option passed directly to the Python interpreter could at least tell me which import caused that error message to appear: $ python -v -m ralph maxid ... dlopen("/home/ralph/local/lib/python2.7/site-packages/_imaging.so", 2); Error opening file for reading: Permission denied import _imaging # dynamically loaded from /home/ralph/local/lib/python2.7/site-packages/_imaging.so ... So there it was! _imaging, the C extension module implementing parts of PIL. This way I could come up with a minimal example: $ python -c "import _imaging; print _imaging.__file__" Error opening file for reading: Permission denied /home/ralph/local/lib/python2.7/site-packages/_imaging.so The best part is that the import worked. Nothing of value was lost. So
communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings http://askubuntu.com/questions/159572/how-to-determine-file-in-error-opening-file-for-reading-error and policies of this site About Us Learn more about Stack Overflow https://groups.google.com/d/msg/django-users/Mxz2Y-I1UpA/mjmJhMkbWSsJ the company Business Learn more about hiring developers or posting ads with us Ask Ubuntu Questions Tags Users Badges Unanswered Ask Question _ Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute: Sign up Here's how it works: Anybody permission denied can ask a question Anybody can answer The best answers are voted up and rise to the top How to determine file in “Error opening file for reading” error up vote 0 down vote favorite Since Ubuntu 12.04, whenever I open aterm, I get the following error message: Error opening file for reading: Permission denied aterm still opens and runs correctly, but file for reading I get that error message. I'd like to figure out what all this is about. Is someone familiar with this specific error for aterm? Otherwise, is there some log that records files that are attempting to be opened so I can determine what file it's complaining about? I've grepped my log files for "aterm" without success. Other tips for determining what the issue is? permissions logging share|improve this question asked Jul 4 '12 at 14:44 Mark Hildreth 4181411 add a comment| 1 Answer 1 active oldest votes up vote 1 down vote accepted If it were me I would most likely use strace, as in: $ strace aterm That will print out all the system calls that aterm issues. It will be quite a lot of information. You may wish to limit it to just the open() system call like so: $ strace -etrace=open aterm though I suppose it is possible that this isn't the result of an open() syscall. share|improve this answer answered Jul 4 '12 at 17:55 grifferz 25918 Exactly what I was looking for! Looks like it's /var/run/utmp and /var/log&
von GoogleAnmeldenAusgeblendete FelderNach Gruppen oder Nachrichten suchen