Hi everyone, Hopefully someone else has solved this problem. I keep on getting "Application Error. Rails Application Failed to start" errors if I let my rails app sit for a while with no activity (overnight, over the weekend...). If I restart the httpd, then the problem goes away (until the next time). I''ve looked at my apache logs and I find [Mon Apr 18 09:17:39 2005] [crit] (2)No such file or directory: FastCGI: can''t create (dynamic) server "/Users/ryan/rails-production/rinventory/public/dispatch.fcgi": bind() failed [/tmp/fcgi_ipc/dynamic/905f2b53cda847eb293aa369a910a306] [Mon Apr 18 09:17:44 2005] [alert] [client x.x.x.x] (2)No such file or directory: FastCGI: failed to connect to (dynamic) server "/Users/ryan/rails-production/rinventory/public/dispatch.fcgi": something is seriously wrong, any chance the socket/named_pipe directory was removed?, see the FastCgiIpcDir directive [Mon Apr 18 09:17:44 2005] [error] [client x.x.x.x] FastCGI: incomplete headers (0 bytes) received from server "/Users/ryan/rails-production/rinventory/public/dispatch.fcgi" My apache-foo is not powerful enough to decipher this. Anyone have any ideas? Thanks, --ryan
Webrick work fine? On 4/18/05, Ryan Raaum <ryan.raaum-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi everyone, > > Hopefully someone else has solved this problem. I keep on getting > "Application Error. Rails Application Failed to start" errors if I let > my rails app sit for a while with no activity (overnight, over the > weekend...). If I restart the httpd, then the problem goes away > (until the next time). I''ve looked at my apache logs and I find > > [Mon Apr 18 09:17:39 2005] [crit] (2)No such file or directory: > FastCGI: can''t create (dynamic) server > "/Users/ryan/rails-production/rinventory/public/dispatch.fcgi": bind() > failed [/tmp/fcgi_ipc/dynamic/905f2b53cda847eb293aa369a910a306] > [Mon Apr 18 09:17:44 2005] [alert] [client x.x.x.x] (2)No such file or > directory: FastCGI: failed to connect to (dynamic) server > "/Users/ryan/rails-production/rinventory/public/dispatch.fcgi": > something is seriously wrong, any chance the socket/named_pipe > directory was removed?, see the FastCgiIpcDir directive > [Mon Apr 18 09:17:44 2005] [error] [client x.x.x.x] FastCGI: > incomplete headers (0 bytes) received from server > "/Users/ryan/rails-production/rinventory/public/dispatch.fcgi" > > My apache-foo is not powerful enough to decipher this. Anyone have any ideas? > > Thanks, > > --ryan > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Ryan,
I had a similar problem on OS X. For me, it was caused because I
hadn''t told FCGI to restart if the process fails. This is the code I
put in my httpd.conf to fix the issue.
<IfModule mod_fastcgi.c>
FastCgiIpcDir /tmp/fcgi_ipc/
AddHandler fastcgi-script .fcgi
FastCgiConfig -initial-env RAILS_ENV=production -restart
</IfModule>
That last line is what I added, note the -restart. It tells FCGI to
restart on fail and sets the Rails environment to production for all of
my Rails projects on that server. This might solve your problem too.
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
R O B E R T B O U S Q U E T
Web Programming Consultant
Doheny Office of Technology Support
University of Southern California
On Apr 18, 2005, at 6:27 AM, Ryan Raaum wrote:
> Hi everyone,
>
> Hopefully someone else has solved this problem. I keep on getting
> "Application Error. Rails Application Failed to start" errors if
I let
> my rails app sit for a while with no activity (overnight, over the
> weekend...). If I restart the httpd, then the problem goes away
> (until the next time). I''ve looked at my apache logs and I find
>
> [Mon Apr 18 09:17:39 2005] [crit] (2)No such file or directory:
> FastCGI: can''t create (dynamic) server
> "/Users/ryan/rails-production/rinventory/public/dispatch.fcgi":
bind()
> failed [/tmp/fcgi_ipc/dynamic/905f2b53cda847eb293aa369a910a306]
> [Mon Apr 18 09:17:44 2005] [alert] [client x.x.x.x] (2)No such file or
> directory: FastCGI: failed to connect to (dynamic) server
> "/Users/ryan/rails-production/rinventory/public/dispatch.fcgi":
> something is seriously wrong, any chance the socket/named_pipe
> directory was removed?, see the FastCgiIpcDir directive
> [Mon Apr 18 09:17:44 2005] [error] [client x.x.x.x] FastCGI:
> incomplete headers (0 bytes) received from server
> "/Users/ryan/rails-production/rinventory/public/dispatch.fcgi"
>
> My apache-foo is not powerful enough to decipher this. Anyone have
> any ideas?
>
> Thanks,
>
> --ryan
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails
On Apr 18, 2005, at 6:27 AM, Ryan Raaum wrote:> Hi everyone, > > Hopefully someone else has solved this problem. I keep on getting > "Application Error. Rails Application Failed to start" errors if I let > my rails app sit for a while with no activity (overnight, over the > weekend...). If I restart the httpd, then the problem goes away > (until the next time). I''ve looked at my apache logs and I find > > [Mon Apr 18 09:17:39 2005] [crit] (2)No such file or directory: > FastCGI: can''t create (dynamic) server > "/Users/ryan/rails-production/rinventory/public/dispatch.fcgi": bind() > failed [/tmp/fcgi_ipc/dynamic/905f2b53cda847eb293aa369a910a306] > [Mon Apr 18 09:17:44 2005] [alert] [client x.x.x.x] (2)No such file or > directory: FastCGI: failed to connect to (dynamic) server > "/Users/ryan/rails-production/rinventory/public/dispatch.fcgi": > something is seriously wrong, any chance the socket/named_pipe > directory was removed?, see the FastCgiIpcDir directive > [Mon Apr 18 09:17:44 2005] [error] [client x.x.x.x] FastCGI: > incomplete headers (0 bytes) received from server > "/Users/ryan/rails-production/rinventory/public/dispatch.fcgi" > > My apache-foo is not powerful enough to decipher this. Anyone have > any ideas?I had the same problem on OS X as well as with Apache on a Linux server. Your log message gave me an idea.. I think the /tmp dir is getting cleaned out every once in a while ("man periodic", then look in /etc/periodic/daily/500.daily on OS X - "man tmpwatch" and look in /etc/cron.daily/tmpwatch on Redhat ES 3). FastCGI is using a named pipe for IPC in /tmp/fcgi_ipc. The solution might be to edit the FastCgiIpcDir directive in httpd.conf, and set it to use a directory not under /tmp. You will probably have to create the directory by hand and set the permissions so that the httpd process can write to it ("sudo chown www fcgi_ipc")... Zach