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? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> 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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Steve Rawlinson 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. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks, "ulimit -n 1024" fixed the problem. It was set to 256. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Blake Miller 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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---