Re: [web2py] Re: web2py crashing

2017-08-01 Thread Kiran Subbaraman
Can you provide more details on the issue you see on a newer thread? The 
thread you are posting on is almost 5 years old, so the issue you may be 
facing may not be because of what is listed in this old thread. In any 
case, this is the code referenced in this old thread: 
https://github.com/web2py/web2py/blob/5d8a25626c4e6608e99b84bd25d2b88535430537/gluon/rocket.py#L1386


In your new post / new thread, can you share the following:
Some information on your environment: Which version of web2py, OS 
platform, python version, etc.
And do you see stack-traces in the log file / console? Then can you post 
that here.

Also, what do you mean by "reset rocket"?


Kiran Subbaraman
http://subbaraman.wordpress.com/about/

On 01-Aug-17 6:59 PM, Fabiano Faver wrote:
I got too many of this error lately. And its getting worse every day. 
I have no idea what to do to stop these errors. I have to reset rocket 
every few hours.
Was this fix eventually reverted ? Someone knows the file it is this 
workaround?



--
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+unsubscr...@googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py crashing

2017-08-01 Thread Fabiano Faver
I got too many of this error lately. And its getting worse every day. I 
have no idea what to do to stop these errors. I have to reset rocket every 
few hours.
Was this fix eventually reverted ? Someone knows the file it is this 
workaround?


-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: web2py crashing

2012-06-27 Thread Massimo Di Pierro
We acn catch it but what do we do? Report this is a python bug?

On Tuesday, 26 June 2012 20:01:49 UTC-5, Jonathan Lundell wrote:

 On Jun 26, 2012, at 5:25 PM, Massimo Di Pierro wrote:

 Looks like a buggy socket.py or ssl.py. Is this an occasional error (which 
 may depend on parameters such as certificates) or it reproducible?


 This was fixed in Python 2.7. The underlying error is Transport endpoint 
 is not connected, which of course shouldn't cause a crash. I suppose we 
 could catch the exception in Rocket as a workaround.


 On Tuesday, 26 June 2012 12:30:58 UTC-5, msmagoo wrote:

 Hi all,

 I have a healthcheck web2py application that simply reads healthcheck 
 information from a database and makes a few REST api calls to a separate 
 web2py application. Over the past while the application has been crashing 
 at least once, sometimes twice a day with few errors in the logs. Most are 
 connection reset by peer errors, which I found out to be nothing that would 
 crash the application. An error I have been seeing frequently is:
 ERROR:Rocket.Errors.Thread-8:Traceback (most recent call last):

   File /opt/apps/web2py/gluon/rocket.py, line 1302, in run
 self.run_app(conn)

   File /opt/apps/web2py/gluon/rocket.py, line 1986, in run_app
 self.environ = environ = self.build_environ(sock_file, conn)

   File /opt/apps/web2py/gluon/rocket.py, line 1807, in build_environ
 request = self.read_request_line(sock_file)

   File /opt/apps/web2py/gluon/rocket.py, line 1363, in read_request_line
 d = sock_file.readline()

   File /usr/lib/python2.6/socket.py, line 406, in readline
 data = self._sock.recv(self._rbufsize)

   File /usr/lib/python2.6/ssl.py, line 96, in lambda
 self.recv = lambda buflen=1024, flags=0: SSLSocket.recv(self, buflen, 
 flags)

   File /usr/lib/python2.6/ssl.py, line 224, in recv
 return socket.recv(self, buflen, flags)

 TypeError: 'member_descriptor' object is not callable

 ERROR:Rocket.Errors.Thread-8:Tried to send 500 Server Error to client 
 but received socket error


 I have web2py running on https with some certs set up. Any help would be 
 very appreciated.

 Thanks!







-- 





Re: [web2py] Re: web2py crashing

2012-06-27 Thread Jonathan Lundell
On Jun 27, 2012, at 6:12 AM, Massimo Di Pierro wrote:
 We acn catch it but what do we do? Report this is a python bug?

The crash is a python bug. The connection failure isn't (near as I can tell). 
Just treat it as a dropped connection.

 
 On Tuesday, 26 June 2012 20:01:49 UTC-5, Jonathan Lundell wrote:
 On Jun 26, 2012, at 5:25 PM, Massimo Di Pierro wrote:
 Looks like a buggy socket.py or ssl.py. Is this an occasional error (which 
 may depend on parameters such as certificates) or it reproducible?
 
 This was fixed in Python 2.7. The underlying error is Transport endpoint is 
 not connected, which of course shouldn't cause a crash. I suppose we could 
 catch the exception in Rocket as a workaround.
 


-- 





Re: [web2py] Re: web2py crashing

2012-06-27 Thread Massimo Di Pierro
ok.please check the solution in trunk.

On Wednesday, 27 June 2012 08:20:12 UTC-5, Jonathan Lundell wrote:

 On Jun 27, 2012, at 6:12 AM, Massimo Di Pierro wrote:

 We acn catch it but what do we do? Report this is a python bug?


 The crash is a python bug. The connection failure isn't (near as I can 
 tell). Just treat it as a dropped connection.


 On Tuesday, 26 June 2012 20:01:49 UTC-5, Jonathan Lundell wrote:

 On Jun 26, 2012, at 5:25 PM, Massimo Di Pierro wrote:

 Looks like a buggy socket.py or ssl.py. Is this an occasional error 
 (which may depend on parameters such as certificates) or it reproducible?


 This was fixed in Python 2.7. The underlying error is Transport endpoint 
 is not connected, which of course shouldn't cause a crash. I suppose we 
 could catch the exception in Rocket as a workaround.






Re: [web2py] Re: web2py crashing

2012-06-27 Thread Jonathan Lundell
On Jun 27, 2012, at 3:45 PM, Massimo Di Pierro wrote:
 ok.please check the solution in trunk.

OK, but I think that SocketClosed might be a better exception. And maybe a 
comment pointing to this thread or something else explaining what it's doing 
there (it's a pretty odd piece of code otherwise).

 
 On Wednesday, 27 June 2012 08:20:12 UTC-5, Jonathan Lundell wrote:
 On Jun 27, 2012, at 6:12 AM, Massimo Di Pierro wrote:
 We acn catch it but what do we do? Report this is a python bug?
 
 The crash is a python bug. The connection failure isn't (near as I can tell). 
 Just treat it as a dropped connection.
 
 
 On Tuesday, 26 June 2012 20:01:49 UTC-5, Jonathan Lundell wrote:
 On Jun 26, 2012, at 5:25 PM, Massimo Di Pierro wrote:
 Looks like a buggy socket.py or ssl.py. Is this an occasional error (which 
 may depend on parameters such as certificates) or it reproducible?
 
 This was fixed in Python 2.7. The underlying error is Transport endpoint is 
 not connected, which of course shouldn't cause a crash. I suppose we could 
 catch the exception in Rocket as a workaround.
 
 
 




Re: [web2py] Re: web2py crashing

2012-06-27 Thread Massimo Di Pierro
I agree. Please check.

On Wednesday, 27 June 2012 17:53:25 UTC-5, Jonathan Lundell wrote:

 On Jun 27, 2012, at 3:45 PM, Massimo Di Pierro wrote:

 ok.please check the solution in trunk.


 OK, but I think that SocketClosed might be a better exception. And maybe a 
 comment pointing to this thread or something else explaining what it's 
 doing there (it's a pretty odd piece of code otherwise).


 On Wednesday, 27 June 2012 08:20:12 UTC-5, Jonathan Lundell wrote:

 On Jun 27, 2012, at 6:12 AM, Massimo Di Pierro wrote:

 We acn catch it but what do we do? Report this is a python bug?


 The crash is a python bug. The connection failure isn't (near as I can 
 tell). Just treat it as a dropped connection.


 On Tuesday, 26 June 2012 20:01:49 UTC-5, Jonathan Lundell wrote:

 On Jun 26, 2012, at 5:25 PM, Massimo Di Pierro wrote:

 Looks like a buggy socket.py or ssl.py. Is this an occasional error 
 (which may depend on parameters such as certificates) or it reproducible?


 This was fixed in Python 2.7. The underlying error is Transport 
 endpoint is not connected, which of course shouldn't cause a crash. I 
 suppose we could catch the exception in Rocket as a workaround.








Re: [web2py] Re: web2py crashing

2012-06-27 Thread Jonathan Lundell
On Jun 27, 2012, at 4:02 PM, Massimo Di Pierro wrote:
 I agree. Please check.

That's better; thanks.

 
 On Wednesday, 27 June 2012 17:53:25 UTC-5, Jonathan Lundell wrote:
 On Jun 27, 2012, at 3:45 PM, Massimo Di Pierro wrote:
 ok.please check the solution in trunk.
 
 OK, but I think that SocketClosed might be a better exception. And maybe a 
 comment pointing to this thread or something else explaining what it's doing 
 there (it's a pretty odd piece of code otherwise).
 
 
 On Wednesday, 27 June 2012 08:20:12 UTC-5, Jonathan Lundell wrote:
 On Jun 27, 2012, at 6:12 AM, Massimo Di Pierro wrote:
 We acn catch it but what do we do? Report this is a python bug?
 
 The crash is a python bug. The connection failure isn't (near as I can 
 tell). Just treat it as a dropped connection.
 
 
 On Tuesday, 26 June 2012 20:01:49 UTC-5, Jonathan Lundell wrote:
 On Jun 26, 2012, at 5:25 PM, Massimo Di Pierro wrote:
 Looks like a buggy socket.py or ssl.py. Is this an occasional error (which 
 may depend on parameters such as certificates) or it reproducible?
 
 This was fixed in Python 2.7. The underlying error is Transport endpoint 
 is not connected, which of course shouldn't cause a crash. I suppose we 
 could catch the exception in Rocket as a workaround.
 
 
 
 
 




[web2py] Re: web2py crashing

2012-06-26 Thread Massimo Di Pierro
Looks like a buggy socket.py or ssl.py. Is this an occasional error (which 
may depend on parameters such as certificates) or it reproducible?

On Tuesday, 26 June 2012 12:30:58 UTC-5, msmagoo wrote:

 Hi all,

 I have a healthcheck web2py application that simply reads healthcheck 
 information from a database and makes a few REST api calls to a separate 
 web2py application. Over the past while the application has been crashing 
 at least once, sometimes twice a day with few errors in the logs. Most are 
 connection reset by peer errors, which I found out to be nothing that would 
 crash the application. An error I have been seeing frequently is:
 ERROR:Rocket.Errors.Thread-8:Traceback (most recent call last):

   File /opt/apps/web2py/gluon/rocket.py, line 1302, in run
 self.run_app(conn)

   File /opt/apps/web2py/gluon/rocket.py, line 1986, in run_app
 self.environ = environ = self.build_environ(sock_file, conn)

   File /opt/apps/web2py/gluon/rocket.py, line 1807, in build_environ
 request = self.read_request_line(sock_file)

   File /opt/apps/web2py/gluon/rocket.py, line 1363, in read_request_line
 d = sock_file.readline()

   File /usr/lib/python2.6/socket.py, line 406, in readline
 data = self._sock.recv(self._rbufsize)

   File /usr/lib/python2.6/ssl.py, line 96, in lambda
 self.recv = lambda buflen=1024, flags=0: SSLSocket.recv(self, buflen, 
 flags)

   File /usr/lib/python2.6/ssl.py, line 224, in recv
 return socket.recv(self, buflen, flags)

 TypeError: 'member_descriptor' object is not callable

 ERROR:Rocket.Errors.Thread-8:Tried to send 500 Server Error to client 
 but received socket error


 I have web2py running on https with some certs set up. Any help would be 
 very appreciated.

 Thanks!


-- 





[web2py] Re: web2py crashing

2012-06-26 Thread msmagoo
It happens rather frequently. At least a few times a day, which 
consequently causes web2py to hang and forces me to restart it. I can't 
reproduce it manually.

On Tuesday, June 26, 2012 5:25:43 PM UTC-7, Massimo Di Pierro wrote:

 Looks like a buggy socket.py or ssl.py. Is this an occasional error (which 
 may depend on parameters such as certificates) or it reproducible?

 On Tuesday, 26 June 2012 12:30:58 UTC-5, msmagoo wrote:

 Hi all,

 I have a healthcheck web2py application that simply reads healthcheck 
 information from a database and makes a few REST api calls to a separate 
 web2py application. Over the past while the application has been crashing 
 at least once, sometimes twice a day with few errors in the logs. Most are 
 connection reset by peer errors, which I found out to be nothing that would 
 crash the application. An error I have been seeing frequently is:
 ERROR:Rocket.Errors.Thread-8:Traceback (most recent call last):

   File /opt/apps/web2py/gluon/rocket.py, line 1302, in run
 self.run_app(conn)

   File /opt/apps/web2py/gluon/rocket.py, line 1986, in run_app
 self.environ = environ = self.build_environ(sock_file, conn)

   File /opt/apps/web2py/gluon/rocket.py, line 1807, in build_environ
 request = self.read_request_line(sock_file)

   File /opt/apps/web2py/gluon/rocket.py, line 1363, in read_request_line
 d = sock_file.readline()

   File /usr/lib/python2.6/socket.py, line 406, in readline
 data = self._sock.recv(self._rbufsize)

   File /usr/lib/python2.6/ssl.py, line 96, in lambda
 self.recv = lambda buflen=1024, flags=0: SSLSocket.recv(self, buflen, 
 flags)

   File /usr/lib/python2.6/ssl.py, line 224, in recv
 return socket.recv(self, buflen, flags)

 TypeError: 'member_descriptor' object is not callable

 ERROR:Rocket.Errors.Thread-8:Tried to send 500 Server Error to client 
 but received socket error


 I have web2py running on https with some certs set up. Any help would be 
 very appreciated.

 Thanks!



-- 





Re: [web2py] Re: web2py crashing

2012-06-26 Thread Jonathan Lundell
On Jun 26, 2012, at 5:25 PM, Massimo Di Pierro wrote:
 Looks like a buggy socket.py or ssl.py. Is this an occasional error (which 
 may depend on parameters such as certificates) or it reproducible?

This was fixed in Python 2.7. The underlying error is Transport endpoint is 
not connected, which of course shouldn't cause a crash. I suppose we could 
catch the exception in Rocket as a workaround.

 
 On Tuesday, 26 June 2012 12:30:58 UTC-5, msmagoo wrote:
 Hi all,
 
 I have a healthcheck web2py application that simply reads healthcheck 
 information from a database and makes a few REST api calls to a separate 
 web2py application. Over the past while the application has been crashing at 
 least once, sometimes twice a day with few errors in the logs. Most are 
 connection reset by peer errors, which I found out to be nothing that would 
 crash the application. An error I have been seeing frequently is:
 ERROR:Rocket.Errors.Thread-8:Traceback (most recent call last):
 
   File /opt/apps/web2py/gluon/rocket.py, line 1302, in run
 self.run_app(conn)
 
   File /opt/apps/web2py/gluon/rocket.py, line 1986, in run_app
 self.environ = environ = self.build_environ(sock_file, conn)
 
   File /opt/apps/web2py/gluon/rocket.py, line 1807, in build_environ
 request = self.read_request_line(sock_file)
 
   File /opt/apps/web2py/gluon/rocket.py, line 1363, in read_request_line
 d = sock_file.readline()
 
   File /usr/lib/python2.6/socket.py, line 406, in readline
 data = self._sock.recv(self._rbufsize)
 
   File /usr/lib/python2.6/ssl.py, line 96, in lambda
 self.recv = lambda buflen=1024, flags=0: SSLSocket.recv(self, buflen, 
 flags)
 
   File /usr/lib/python2.6/ssl.py, line 224, in recv
 return socket.recv(self, buflen, flags)
 
 TypeError: 'member_descriptor' object is not callable
 
 ERROR:Rocket.Errors.Thread-8:Tried to send 500 Server Error to client but 
 received socket error
 
 
 I have web2py running on https with some certs set up. Any help would be very 
 appreciated.
 
 Thanks!
 
 


-- 





[web2py] Re: Web2py crashing

2010-05-07 Thread David Zejda
AFAIK web2py uses cherrypy webserver, which listens as a daemon on
certain port. With crashing I mean that the listening process (web2py
with cherrypy at the background) suddenly terminates. I use standard
Python v 2.5.2 as packaged for Debian.

David

On May 7, 2:52 pm, Timothy Farrell tfarr...@swgen.com wrote:
 Can you be more specific on what you mean by crashing?  Interpreted
 languages shouldn't crash and generally if they do it's something wrong
 with the interpreter.  Are you using cPython?

 On 5/7/2010 1:48 AM, David Zejda wrote:

  Hi,

  my web2py instance (about 1 pageviews, 30+ ajax requests
  daily) crashes about daily. As a workaround I have a script which
  (re)starts the server when either memory usage exceeds certain
  threshold or when the server is completely down. I run the script from
  cron every minute.

  #! /bin/sh

  A=`netstat -tlnp | grep 8000`
  TIME=`date`
  LOG='/var/log/web2py/keepalive.log'

  if [ $A ];
  then
       B=`echo $A | cut -d   -f 7`
       PID=${B%/*}
       MEM=`ps -p $PID -o vsz | tail -n 1`
       if [ $MEM -gt 200 ];
       then
           echo $TIME  $PID    $MEM    MEMORY  $LOG
           echo Web2py memory $MEM on $TIME =  restart. | mail
  m...@mail.com -s 'Web2py fail!'
           /etc/init.d/web2py restart
       else
           echo $TIME  $PID    $MEM    OK  $LOG
       fi
  else
       echo $TIME      FAIL  $LOG
       echo Web2py failed on $TIME | mail m...@mail.com -s 'Web2py fail!'
       /etc/init.d/web2py restart
  fi

  I know I should find time to try to examine cause of memory leaking
  with guppy-heapy. But I think the crashing is another issue, not
  directly related to the leaking. Access logs revealed no direct
  relation to any particular controller or function. Also, after web2py
  upgrade it has not changed.

  Do you have any idea how to reveal the cause of crashing?

  Thanks!
  David


Re: [web2py] Re: Web2py crashing

2010-05-07 Thread Timothy Farrell
Is this standard hardware?  The only place I've seen Python crash is on 
non-standard hardware (AS400) with a non-supported build of Python.


Web2py recent switched from Cherrypy's wsgiserver to Rocket (which I 
wrote) as of version 1.77.2 (I think).  Which version are you running?


With built-in web-servers, the listening for connections and the 
response processing all happens in the same Linux Process.  So if it 
stops listening, do you still see the process in 'top' or 'px ax'?  If 
so, then, Yes, the whole process crashed (in which case it is more 
likely the Python interpreter); otherwise, there would likely be a bug 
somewhere in web2py that we can address.


You could also try Apache+mod_wsgi to see if that changes things.

-tim

On 5/7/2010 8:36 AM, David Zejda wrote:

AFAIK web2py uses cherrypy webserver, which listens as a daemon on
certain port. With crashing I mean that the listening process (web2py
with cherrypy at the background) suddenly terminates. I use standard
Python v 2.5.2 as packaged for Debian.

David

On May 7, 2:52 pm, Timothy Farrelltfarr...@swgen.com  wrote:
   

Can you be more specific on what you mean by crashing?  Interpreted
languages shouldn't crash and generally if they do it's something wrong
with the interpreter.  Are you using cPython?

On 5/7/2010 1:48 AM, David Zejda wrote:

 

Hi,
   
 

my web2py instance (about 1 pageviews, 30+ ajax requests
daily) crashes about daily. As a workaround I have a script which
(re)starts the server when either memory usage exceeds certain
threshold or when the server is completely down. I run the script from
cron every minute.
   
 

#! /bin/sh
   
 

A=`netstat -tlnp | grep 8000`
TIME=`date`
LOG='/var/log/web2py/keepalive.log'
   
 

if [ $A ];
then
  B=`echo $A | cut -d   -f 7`
  PID=${B%/*}
  MEM=`ps -p $PID -o vsz | tail -n 1`
  if [ $MEM -gt 200 ];
  then
  echo $TIME  $PID$MEMMEMORY$LOG
  echo Web2py memory $MEM on $TIME =restart. | mail
m...@mail.com -s 'Web2py fail!'
  /etc/init.d/web2py restart
  else
  echo $TIME  $PID$MEMOK$LOG
  fi
else
  echo $TIME  FAIL$LOG
  echo Web2py failed on $TIME | mail m...@mail.com -s 'Web2py fail!'
  /etc/init.d/web2py restart
fi
   
 

I know I should find time to try to examine cause of memory leaking
with guppy-heapy. But I think the crashing is another issue, not
directly related to the leaking. Access logs revealed no direct
relation to any particular controller or function. Also, after web2py
upgrade it has not changed.
   
 

Do you have any idea how to reveal the cause of crashing?
   
 

Thanks!
David
   




[web2py] Re: Web2py crashing

2010-05-07 Thread David Zejda
Yes, vanilla hardware (some dual core Intel). I'm running the latest
web2py now, but it was crashing even with about half year old version
(1.73 or so), so the issue is probably not webserver specific. The
process is in ps ax no more when crashes. Currently the server is
being accessed through Apache proxy. Maybe I'll find a while to test
it with mod_wsgi.

Thanks :)

On May 7, 4:00 pm, Timothy Farrell tfarr...@swgen.com wrote:
 Is this standard hardware?  The only place I've seen Python crash is on
 non-standard hardware (AS400) with a non-supported build of Python.

 Web2py recent switched from Cherrypy's wsgiserver to Rocket (which I
 wrote) as of version 1.77.2 (I think).  Which version are you running?

 With built-in web-servers, the listening for connections and the
 response processing all happens in the same Linux Process.  So if it
 stops listening, do you still see the process in 'top' or 'px ax'?  If
 so, then, Yes, the whole process crashed (in which case it is more
 likely the Python interpreter); otherwise, there would likely be a bug
 somewhere in web2py that we can address.

 You could also try Apache+mod_wsgi to see if that changes things.

 -tim

 On 5/7/2010 8:36 AM, David Zejda wrote:

  AFAIK web2py uses cherrypy webserver, which listens as a daemon on
  certain port. With crashing I mean that the listening process (web2py
  with cherrypy at the background) suddenly terminates. I use standard
  Python v 2.5.2 as packaged for Debian.

  David

  On May 7, 2:52 pm, Timothy Farrelltfarr...@swgen.com  wrote:

  Can you be more specific on what you mean by crashing?  Interpreted
  languages shouldn't crash and generally if they do it's something wrong
  with the interpreter.  Are you using cPython?

  On 5/7/2010 1:48 AM, David Zejda wrote:

  Hi,

  my web2py instance (about 1 pageviews, 30+ ajax requests
  daily) crashes about daily. As a workaround I have a script which
  (re)starts the server when either memory usage exceeds certain
  threshold or when the server is completely down. I run the script from
  cron every minute.

  #! /bin/sh

  A=`netstat -tlnp | grep 8000`
  TIME=`date`
  LOG='/var/log/web2py/keepalive.log'

  if [ $A ];
  then
        B=`echo $A | cut -d   -f 7`
        PID=${B%/*}
        MEM=`ps -p $PID -o vsz | tail -n 1`
        if [ $MEM -gt 200 ];
        then
            echo $TIME  $PID    $MEM    MEMORY    $LOG
            echo Web2py memory $MEM on $TIME =    restart. | mail
  m...@mail.com -s 'Web2py fail!'
            /etc/init.d/web2py restart
        else
            echo $TIME  $PID    $MEM    OK    $LOG
        fi
  else
        echo $TIME      FAIL    $LOG
        echo Web2py failed on $TIME | mail m...@mail.com -s 'Web2py fail!'
        /etc/init.d/web2py restart
  fi

  I know I should find time to try to examine cause of memory leaking
  with guppy-heapy. But I think the crashing is another issue, not
  directly related to the leaking. Access logs revealed no direct
  relation to any particular controller or function. Also, after web2py
  upgrade it has not changed.

  Do you have any idea how to reveal the cause of crashing?

  Thanks!
  David


[web2py] Re: Web2py crashing

2010-05-07 Thread mdipierro
Let us know what you discover.

On May 7, 3:57 pm, David Zejda d...@atlas.cz wrote:
 Yes, vanilla hardware (some dual core Intel). I'm running the latest
 web2py now, but it was crashing even with about half year old version
 (1.73 or so), so the issue is probably not webserver specific. The
 process is in ps ax no more when crashes. Currently the server is
 being accessed through Apache proxy. Maybe I'll find a while to test
 it with mod_wsgi.

 Thanks :)

 On May 7, 4:00 pm, Timothy Farrell tfarr...@swgen.com wrote:

  Is this standard hardware?  The only place I've seen Python crash is on
  non-standard hardware (AS400) with a non-supported build of Python.

  Web2py recent switched from Cherrypy's wsgiserver to Rocket (which I
  wrote) as of version 1.77.2 (I think).  Which version are you running?

  With built-in web-servers, the listening for connections and the
  response processing all happens in the same Linux Process.  So if it
  stops listening, do you still see the process in 'top' or 'px ax'?  If
  so, then, Yes, the whole process crashed (in which case it is more
  likely the Python interpreter); otherwise, there would likely be a bug
  somewhere in web2py that we can address.

  You could also try Apache+mod_wsgi to see if that changes things.

  -tim

  On 5/7/2010 8:36 AM, David Zejda wrote:

   AFAIK web2py uses cherrypy webserver, which listens as a daemon on
   certain port. With crashing I mean that the listening process (web2py
   with cherrypy at the background) suddenly terminates. I use standard
   Python v 2.5.2 as packaged for Debian.

   David

   On May 7, 2:52 pm, Timothy Farrelltfarr...@swgen.com  wrote:

   Can you be more specific on what you mean by crashing?  Interpreted
   languages shouldn't crash and generally if they do it's something wrong
   with the interpreter.  Are you using cPython?

   On 5/7/2010 1:48 AM, David Zejda wrote:

   Hi,

   my web2py instance (about 1 pageviews, 30+ ajax requests
   daily) crashes about daily. As a workaround I have a script which
   (re)starts the server when either memory usage exceeds certain
   threshold or when the server is completely down. I run the script from
   cron every minute.

   #! /bin/sh

   A=`netstat -tlnp | grep 8000`
   TIME=`date`
   LOG='/var/log/web2py/keepalive.log'

   if [ $A ];
   then
         B=`echo $A | cut -d   -f 7`
         PID=${B%/*}
         MEM=`ps -p $PID -o vsz | tail -n 1`
         if [ $MEM -gt 200 ];
         then
             echo $TIME  $PID    $MEM    MEMORY    $LOG
             echo Web2py memory $MEM on $TIME =    restart. | mail
   m...@mail.com -s 'Web2py fail!'
             /etc/init.d/web2py restart
         else
             echo $TIME  $PID    $MEM    OK    $LOG
         fi
   else
         echo $TIME      FAIL    $LOG
         echo Web2py failed on $TIME | mail m...@mail.com -s 'Web2py 
   fail!'
         /etc/init.d/web2py restart
   fi

   I know I should find time to try to examine cause of memory leaking
   with guppy-heapy. But I think the crashing is another issue, not
   directly related to the leaking. Access logs revealed no direct
   relation to any particular controller or function. Also, after web2py
   upgrade it has not changed.

   Do you have any idea how to reveal the cause of crashing?

   Thanks!
   David