I have a running Rails application that uploads files back to the
server occasionally. I recently switched my development machine from a
Linux box to OS X 10.5, using the Apache server built-in on OS X and
mod_fcgid. I thought everything was fine until I recently tried to use
the file upload feature. If I specify a reasonable sized (164 Kb) file
for upload then I get an immediate error, before my controller even
gets to handle the request. This is what is in the log:
/!\ FAILSAFE /!\ Wed Jun 11 17:33:03 -0700 2008
Status: 500 Internal Server Error
protocol error
/Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
request.r
b:573:in read' /Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/ request.r b:573:in
read_multipart’
/Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
request.r
b:547:in loop' /Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/ request.r b:547:in
read_multipart’
/Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
request.r
b:470:in parse_multipart_form_parameters' /Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/ request.r b:400:in
parse_formatted_request_parameters’
/Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
cgi_proce
ss.rb:80:in request_parameters' /Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/ request.r b:304:in
parameters’
/Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
request.r
b:22:in request_method' /Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/ request.r b:35:in
method’
/Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
routing/r
oute_set.rb:431:in extract_request_environment' /Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/ routing/r oute_set.rb:384:in
recognize’
/Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
dispatche
r.rb:148:in handle_request' /Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/ dispatche r.rb:107:in
dispatch’
/Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
dispatche
r.rb:104:in synchronize' /Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/ dispatche r.rb:104:in
dispatch’
/Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
dispatche
r.rb:120:in dispatch_cgi' /Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/ dispatche r.rb:35:in
dispatch’
/Library/Ruby/Gems/1.8/gems/rails-2.1.0/lib/fcgi_handler.rb:103:in
process_ request' /Library/Ruby/Gems/1.8/gems/rails-2.1.0/lib/fcgi_handler.rb:153:in
with_sig
nal_handler’
/Library/Ruby/Gems/1.8/gems/rails-2.1.0/lib/fcgi_handler.rb:101:in
process_ request' /Library/Ruby/Gems/1.8/gems/rails-2.1.0/lib/fcgi_handler.rb:78:in
process_e
ach_request’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/
ruby/gems/1.8
/gems/fcgi-0.8.7/lib/fcgi.rb:612:in each_cgi' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ ruby/gems/1.8 /gems/fcgi-0.8.7/lib/fcgi.rb:609:in
each’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/
ruby/gems/1.8
/gems/fcgi-0.8.7/lib/fcgi.rb:609:in each_cgi' /Library/Ruby/Gems/1.8/gems/rails-2.1.0/lib/fcgi_handler.rb:77:in
process_e
ach_request’
/Library/Ruby/Gems/1.8/gems/rails-2.1.0/lib/fcgi_handler.rb:76:in
catch' /Library/Ruby/Gems/1.8/gems/rails-2.1.0/lib/fcgi_handler.rb:76:in
process_e
ach_request’
/Library/Ruby/Gems/1.8/gems/rails-2.1.0/lib/fcgi_handler.rb:50:in
process!' /Library/Ruby/Gems/1.8/gems/rails-2.1.0/lib/fcgi_handler.rb:24:in
process!’
/Users/tsanders/code/DFDialogDatabase/public/dispatch.fcgi:24
The fastcgi.crash.log just says:
[11/Jun/2008:17:33:07 :: 16969] asked to stop immediately
[11/Jun/2008:17:33:07 :: 16969] stopping after explicit exit
and the apache error_log says:
[Wed Jun 11 17:33:03 2008] [warn] (35)Resource temporarily
unavailable: mod_fcgid: write data to fastcgi server error
[Wed Jun 11 17:33:13 2008] [notice] mod_fcgid: process /Users/tsanders/
code/DFDialogDatabase/public/dispatch.fcgi(16969) exit(communication
error), terminated by calling exit(), return code: 0
The exact same code is still running on the production box, which is
running Linux along with Apache and mod_fcgid.
Does anybody have any clues what is wrong here? My guess is a borked
directory permission or something similar that is preventing the
storage of the file, but I’m hoping to not have to go figure out
what’s happening inside actionpack. I don’t know that this is specific
to the OS X install versus the Linux one, but that’s my best guess at
the moment.