wsgi / apache error

189 views
Skip to first unread message

Johann Spies

unread,
May 27, 2015, 8:37:58 AM5/27/15
to web...@googlegroups.com
Most parts of the app work on our server running apache2.4 and wsgi but on after a query which takes some time I get this in the apache error log and 504 Gateway Timeout on my browser:

[Wed May 27 14:20:46.617759 2015] [wsgi:error] [pid 18286:tid 140225013630720] [remote x.x.x.x:10678] mod_wsgi (pid=18286): Exception occurred processing WSGI script '/home/www-data/web2py/wsgihandler.py'.
[Wed May 27 14:20:46.617850 2015] [wsgi:error] [pid 18286:tid 140225013630720] [remote x.x.x.x:10678] IOError: failed to write data

Now my question: where did wsgi try to write data?

Regards
Johann

--
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)

Marco Mansilla

unread,
May 27, 2015, 1:36:16 PM5/27/15
to web...@googlegroups.com
El Wed, 27 May 2015 14:37:43 +0200
Johann Spies <johann...@gmail.com> escribió:

> Most parts of the app work on our server running apache2.4 and wsgi
> but on after a query which takes some time I get this in the apache
> error log and 504 Gateway Timeout on my browser:
>
> [Wed May 27 14:20:46.617759 2015] [wsgi:error] [pid 18286:tid
> 140225013630720] [remote x.x.x.x:10678] mod_wsgi (pid=18286):
> Exception occurred processing WSGI script
> '/home/www-data/web2py/wsgihandler.py'. [Wed May 27 14:20:46.617850
> 2015] [wsgi:error] [pid 18286:tid 140225013630720] [remote
> x.x.x.x:10678] IOError: failed to write data
>
> Now my question: where did wsgi try to write data?
>
> Regards
> Johann
>

Check permissions of applications/[your-app], I think that's the only
place where wsgi should write something.

Something like this happened when I moved an app to a git repo and
pulled changes.

Marco.

Niphlod

unread,
May 27, 2015, 3:58:00 PM5/27/15
to web...@googlegroups.com
I suspect instead it's due to https://code.google.com/p/modwsgi/issues/detail?id=29&can=1


for reference (i.e. even if I don't think it's the issue at hand) web2py just needs to write:
- to the cache/ folder (if you're using cache.disk)
- the session/ folder (if you're using the default file-storage backend and not, e.g., memcache or redis)
- the uploads/ folder (if you're using "upload" Fields)


Johann Spies

unread,
May 28, 2015, 3:22:35 AM5/28/15
to web...@googlegroups.com
Thanks Marko and Niphlod.

I do not think it is a permissions problem in the app somewhere.   I did not have a cache/ directory but then I do not use cache.disk.

The issue Niphlod refers to seems to be related.  I could see no solution there though :(

My problem is not (as suggested in some message in that thread) that the message appears in the log.  The problem is that it breaks the app on that point. The user cannot continue with the task.

On our other server the same code works with the same code and data. The only difference as far as software goes is that we use nginx/uwsgi on the other server.

Regards
Johann

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

user123456

unread,
Aug 28, 2015, 6:24:04 PM8/28/15
to web2py-users
Hello,
   My web2py server stucks automatically and it gives 504 error.I have checked logs  in apache error.log file and its giving error "Script timed out before returning headers: wsgihandler.py".
Reply all
Reply to author
Forward
0 new messages