Form input limit reached?

I have a form that uploads 2 files via 2 file fields (I’m not actually
uploading anything, but this problem occurs specifically when the form
enctype is multipart). If I remove the multipart designation from the
form, the data in the form is saved. Otherwise, I get the following
error:

Sun Jun 10 10:46:34 -0400 2007: Error calling Dispatcher.dispatch
#<Errno::EMFILE: Too many open files - /tmp/CGI.6962.248>

The form has several inputs (text fields and select fields
only)…approximately 350 (on various divs that are toggled via
javascript). If I remove several of the form inputs (say, half), I
don’t get the too many open files error.

Is there a limit to the number of fields the cgi can handle? This
happens in Mongrel and Webrick.

I have another form (same action, different data type) that is almost
identical in nature to this form that posts successfully; however, the
number of form inputs is about 250.

Ideas?

Sun Jun 10 10:46:34 -0400 2007: Error calling Dispatcher.dispatch
#<Errno::EMFILE: Too many open files - /tmp/CGI.6962.248>

That looks like a system error. Ie, the OS is reporting that the user
running the rails app is trying to open a file when the per-user limit
for open files has been reached.

What’s the OS?

steve

Steve R. wrote:

That looks like a system error. Ie, the OS is reporting that the user
running the rails app is trying to open a file when the per-user limit
for open files has been reached.

What’s the OS?
OS X - I don’t understand why removing select fields would change the
behavior (cause the error to cease). But who knows, maybe the cgi
creates a temp file for every form input or something. There are only
two file field inputs, and even if I comment them out (but keep the form
as multipart), I still get the error.

As a test, type the following at a Darwin shell:

ulimit -n
[reports the number of allowed open files]

ulimit -n unlimited
[raises the limit ot the max allowed]

ulimit -n
[confirms the limit has been raised]

script/server

Then use the form and see if the problem goes away.

steve

Blake M. wrote:

Thanks, “ulimit -n 1024” fixed the problem. It was set to 256.

That still means your app is opening more than 256 files which unless
you’re doing something really odd is not good. You can use ‘lsof’ to see
what’s open.

steve

Thanks, “ulimit -n 1024” fixed the problem. It was set to 256.