Weird Error Message From Web2py - OSError: [Errno 24] Too many open files ???????

276 views
Skip to first unread message

Yannick

unread,
Feb 21, 2010, 2:28:55 PM2/21/10
to web2py-users, Massimo Di Pierro
Hello mate,
I'm using the latest version of Web2py and Mac OS and since few web2py
release I have been having this problem and I don't know what is the
cause of this...
When it happens I can't access my application anymore I got a this
message from the browser: "Internal error
Ticket issued: unrecoverable "
So basicallly I just have to reboot the server to get my appl working
again...

Here is the exceptions I got from Web2py:

###############################
Exception in thread Thread-106:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/threading.py", line 486, in __bootstrap_inner
self.run()
File "/Users/OnemeWs/App Server/web2py/gluon/contrib/cron.py", line
229, in run
shell=self.shell)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/subprocess.py", line 587, in __init__
errread, errwrite) = self._get_handles(stdin, stdout, stderr)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/subprocess.py", line 953, in _get_handles
errread, errwrite = os.pipe()
OSError: [Errno 24] Too many open files
################################
Exception in thread Thread-107:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/threading.py", line 486, in __bootstrap_inner
self.run()
File "/Users/OnemeWs/App Server/web2py/gluon/contrib/cron.py", line
229, in run
shell=self.shell)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/subprocess.py", line 587, in __init__
errread, errwrite) = self._get_handles(stdin, stdout, stderr)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/subprocess.py", line 933, in _get_handles
p2cread, p2cwrite = os.pipe()
OSError: [Errno 24] Too many open files
#####################################
Exception in thread Thread-1:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/threading.py", line 486, in __bootstrap_inner
self.run()
File "/Users/OnemeWs/App Server/web2py/gluon/contrib/cron.py", line
55, in run
s.run()
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/sched.py", line 114, in run
File "/Users/OnemeWs/App Server/web2py/gluon/contrib/cron.py", line
47, in launch
crondance(self.path, 'hard', startup = self.startup)
File "/Users/OnemeWs/App Server/web2py/gluon/contrib/cron.py", line
261, in crondance
f = open(crontab, 'rt')
IOError: [Errno 24] Too many open files:
######################################

Please any idea ?

Massimo Di Pierro

unread,
Feb 21, 2010, 4:02:15 PM2/21/10
to Yannick, web2py-users
This is interesting I will take a look asap.

Meanwhile, if you are not using cron, run web2py with -N.

Massimo

Yannick

unread,
Feb 21, 2010, 7:28:17 PM2/21/10
to web2py-users
Thanks for the note... I'm usually running Web2py through Wing IDE
since it is easy for debugging...
Please let me know if you have any questions regarding this issue

Yannick P.

Yusuf Kaka

unread,
Mar 2, 2015, 1:24:57 AM3/2/15
to web...@googlegroups.com
I've got the same error, was there any resolution?

Massimo Di Pierro

unread,
Mar 2, 2015, 12:39:42 PM3/2/15
to web...@googlegroups.com
This usually happens when you open but you do not close connections. It can happen if you put open connections in cache-ram. Do you open many files?

Angelo Compagnucci

unread,
Mar 2, 2015, 12:49:20 PM3/2/15
to web...@googlegroups.com
Hi Yannick,

Probably it's a regression with hardcron, if you search the list you
can find several thread about that problem.

I had it several times in the past and simply I gave up using hard
cron in web2py. I ususally use the plain and simple unix cron to
schedule activities!

Sincerely, Angelo
> --
> 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.



--
Profile: http://it.linkedin.com/in/compagnucciangelo

Massimo Di Pierro

unread,
Mar 3, 2015, 11:51:50 AM3/3/15
to web...@googlegroups.com
BTW. We do not support cron anymore since we have the scheduler. Cron causes other problems with locking of resources and memory build-up. It is not necessarily a bug, it is designed to guarantee start of execution not cap resource utilization.

Joe Barnhart

unread,
Mar 4, 2015, 2:36:09 AM3/4/15
to web...@googlegroups.com, MDiP...@cs.depaul.edu
By strange coincidence, I got the same error tonight, using web2py v.2.9.12-stable on the latest version of pypy (python written in python).  In my case, I'm pretty sure it is a file handle leak caused by my code which handles scheduled insertion of files into the database.  If pypy were dramatically faster at something, I'd pursue it, but my initial tests did not show a dramatic improvement so I'll probably just deploy on regular Python.

Just thought I'd mention it in case you're using some weird version of Python on your mac.  Speaking of which, is there some reason you're using Python 2.5 instead of a version, say, something like five years newer?

Paolo Valleri

unread,
Mar 4, 2015, 8:30:09 AM3/4/15
to web...@googlegroups.com
Massimo, I suggest adding a message when web2py start using internal cron in which is stated that cron is no longer supported.
Do you agree ?

Massimo Di Pierro

unread,
Mar 4, 2015, 3:03:15 PM3/4/15
to web...@googlegroups.com
yes.

Michael Gheith

unread,
Mar 8, 2015, 2:40:49 PM3/8/15
to web...@googlegroups.com, MDiP...@cs.depaul.edu
You could use the linux command lsof to see a list of open files.  You can do something like the following to see what these open files are (if you care?):

import subprocess

data = subprocess.check_output(["lsof"])

lines = data.split("\n")

for line in lines: print line

Reply all
Reply to author
Forward
0 new messages