Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 23rd May 2013, 05:42
jrossi90 jrossi90 is offline
Junior Member
 
Join Date: May 2013
Posts: 5
Thanks: 1
Thanked 3 Times in 2 Posts
Default uWSGI error: "Error opening file for reading: Permission denied'

I am having a problem with my SpamSnake 12.04.
The server is running Django/Nginx/uWSGI. uWSGI keeps giving me the error mentioned in the title: "Error opening file for reading: Permission denied'

I believe it may be related to the following bug: https://bugs.launchpad.net/ubuntu/+s...o/+bug/1031718

I am not sure how to resolve the issue. Can anyone help?

uWSGI Logs:

[uWSGI] getting INI configuration from /usr/share/uwsgi/conf/default.ini
[uWSGI] getting INI configuration from /etc/uwsgi/apps-enabled/baruwa.ini
Wed May 22 22:04:16 2013 - option "module" found in plugin python_plugin.so
Wed May 22 22:04:16 2013 - *** Starting uWSGI 1.0.3-debian (32bit) on [Wed May 22 22:04:16 2013] ***
Wed May 22 22:04:16 2013 - compiled with version: 4.6.3 on 17 July 2012 02:24:04
Wed May 22 22:04:16 2013 - current working directory: /
Wed May 22 22:04:16 2013 - writing pidfile to /run/uwsgi/app/baruwa/pid
Wed May 22 22:04:16 2013 - detected binary path: /usr/bin/uwsgi-core
Wed May 22 22:04:16 2013 - setgid() to 33
Wed May 22 22:04:16 2013 - setuid() to 33
Wed May 22 22:04:16 2013 - your memory page size is 4096 bytes
Wed May 22 22:04:16 2013 - uwsgi socket 0 bound to UNIX address /run/uwsgi/app/baruwa/socket fd 5
Wed May 22 22:04:16 2013 - Python version: 2.7.3 (default, Aug 1 2012, 05:27:35) [GCC 4.6.3]
Wed May 22 22:04:16 2013 - Python main interpreter initialized at 0x9dcccb0
Wed May 22 22:04:16 2013 - your server socket listen backlog is limited to 100 connections
Wed May 22 22:04:16 2013 - *** Operational MODE: preforking ***
Wed May 22 22:04:16 2013 - WSGI application 0 (mountpoint='') ready on interpreter 0x9dcccb0 pid: 14026 (default app)
Wed May 22 22:04:16 2013 - *** uWSGI is running in multiple interpreter mode ***
Wed May 22 22:04:16 2013 - spawned uWSGI master process (pid: 14026)
Wed May 22 22:04:16 2013 - spawned uWSGI worker 1 (pid: 14038, cores: 1)
Wed May 22 22:04:16 2013 - spawned uWSGI worker 2 (pid: 14039, cores: 1)
Error opening file for reading: Permission denied
Reply With Quote
The Following User Says Thank You to jrossi90 For This Useful Post:
LinuxUser80 (29th May 2013)
Sponsored Links
  #2  
Old 30th May 2013, 17:45
LinuxUser81 LinuxUser81 is offline
Junior Member
 
Join Date: May 2013
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Same problem here

Hi, I have the same exact problem as jrossi90.
I wonder if a furture ubuntu patch will solve the problem ?
Any thoughts other than a future patch to sole the issue ?

Thanks
Reply With Quote
  #3  
Old 30th May 2013, 18:05
jrossi90 jrossi90 is offline
Junior Member
 
Join Date: May 2013
Posts: 5
Thanks: 1
Thanked 3 Times in 2 Posts
Default

LinuxUser81 - I solved my problem. After much testing, I realized that although those uwsgi error messages were a nuisance, they were not what were causing the timeout. It ended up being that the Celery worker was starting up before the message broker. I had to run (assuming you are wokring with a SpamSnake)
Code:
update-rc.d -f baruwa remove
update-rc.d baruwa defaults 91
to fix it.
If the uwsgi messages really bother you, Ubuntu addressed it in 12.10. Upgrading from 12.04 to 12.10 will get rid of them.

-jrossi90

Quote:
Originally Posted by LinuxUser81 View Post
Hi, I have the same exact problem as jrossi90.
I wonder if a furture ubuntu patch will solve the problem ?
Any thoughts other than a future patch to sole the issue ?

Thanks
Reply With Quote
The Following 2 Users Say Thank You to jrossi90 For This Useful Post:
Kwambus (21st June 2013), Rocky (30th May 2013)
  #4  
Old 30th May 2013, 18:31
LinuxUser81 LinuxUser81 is offline
Junior Member
 
Join Date: May 2013
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Thanks

Thanks a lot.
This fix totally solved my issue.
You made my day
Reply With Quote
  #5  
Old 17th June 2013, 17:15
Kwambus Kwambus is offline
Junior Member
 
Join Date: Jun 2013
Posts: 2
Thanks: 1
Thanked 2 Times in 1 Post
Default

In exactly the same situation with these timeout issues and have hit a brick wall. Everything was working perfectly until I patched 12.04 LTS at the weekend now I get the same timeouts.

Have tried all suggestions above and no joy. No errors are reported anywhere in any logs other than the infamous 'Error opening file for reading'.

Seems a shame to scrap everything when this is the only thing not working. I have been using Rocky's excellent guides since the early days, never had a problem before.

Any tips or help appreciated.
Reply With Quote
  #6  
Old 18th June 2013, 12:33
Kwambus Kwambus is offline
Junior Member
 
Join Date: Jun 2013
Posts: 2
Thanks: 1
Thanked 2 Times in 1 Post
 
Default

FIXED:

Strange one this-

OK so I could train HAM/SPAM/Release/Delete from anywhere except the message details screen which would cause a hang and timeout. Most times I would have to restart uwsgi.

I poured over this for hours and implemented everything jrossi90 appeared to find out about this problem, I also conversed with jrossi90 yesterday but we hit a dead end. Thanks for the help by the way.

There was little in the logs to help, but seeing the release mechanism work everywhere but this screen I knew it could not be permissions of interactions with MailScanner/SpamAssassin/Baruwa.

As other have I saw this in the uwsgi log files:

/usr/lib/python2.7/dist-packages/djcelery/managers.py:173: TxIsolationWarning: Polling results with transaction isolation level repeatable

After some research I found this:

https://code.djangoproject.com/ticket/13906

And after inserting the following into /etc/baruwa/settings.py:

# Recommended for MySQL. See http://code.djangoproject.com/ticket/13906
'OPTIONS': {'init_command': 'SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED'},

In the section starting:

DATABASES = {
'default': {

I rebooted and everything is working! No idea why other than the 'not returning error code' is a possible reason as to why the session was hanging.

I really hope this helps others, this problem was a nightmare. I have rebooted several times and thus far it appears fixed.
Reply With Quote
The Following 2 Users Say Thank You to Kwambus For This Useful Post:
jrossi90 (18th June 2013), Rocky (26th November 2013)
Reply

Bookmarks

Tags
django, nginx baruwa, python, uwsgi

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Email problem 'Cannot set my user or group id.' (using ISPConfig 3 + OpenSuSE 11.2) urosm Installation/Configuration 5 19th June 2010 23:41
ISP Config hesitation when opening web pages frankb Installation/Configuration 7 15th December 2008 14:06
Apache Ownership cybereatl General 2 26th March 2008 13:25
Chroot SSH + ISPConfig Norman Installation/Configuration 27 26th March 2007 04:40
Verify email setup meekish Installation/Configuration 28 27th October 2006 16:36


All times are GMT +2. The time now is 20:21.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.