I''m having a strange problem with FastCGI. I have several Rails apps running with fastcgi on this machine, but my newest one doesn''t. It works just fine until you try to login. After logging in every other page reload will fail with a 500. If you hit reload it will come up just fine, with your session intact. In the Apache error_log I see: [Tue Feb 08 18:36:38 2005] [warn] FastCGI: (dynamic) server "/home/ben/public_html/mailapp/public/dispatch.fcgi" (pid 31476) terminated by calling exit with status ''1'' [Tue Feb 08 18:36:38 2005] [warn] FastCGI: (dynamic) server "/home/ben/public_html/mailapp/public/dispatch.fcgi" restarted (pid 31479) My login code is basically copied from the other apps. All I do to login is throw a User object into @session. This app was developed under 0.9.5, but the other apps were developed under 0.9.2. 0.9.5 is the version of Rails installed on the server. I''m using fcgi 2.4.0 with mod_fastcgi-2.4.2 under Apache 2.0.47. -- Ben Sinclair ben-bgLzOLc97kcYkl5+HhvCNA@public.gmane.org
I experience similar behavior from time to time - every other request errors out. I haven''t been able to find a cause. Restarting Apache sometimes helped, but restarting the server machine works 100% - for only a short time :( I would be interested in what causes this problem, since I''ve got a feeling it''ll come back. -Brian Ben Sinclair wrote:>I''m having a strange problem with FastCGI. I have several Rails apps >running with fastcgi on this machine, but my newest one doesn''t. > >It works just fine until you try to login. After logging in every >other page reload will fail with a 500. If you hit reload it will come >up just fine, with your session intact. > >In the Apache error_log I see: > >[Tue Feb 08 18:36:38 2005] [warn] FastCGI: (dynamic) server >"/home/ben/public_html/mailapp/public/dispatch.fcgi" (pid 31476) >terminated by calling exit with status ''1'' >[Tue Feb 08 18:36:38 2005] [warn] FastCGI: (dynamic) server >"/home/ben/public_html/mailapp/public/dispatch.fcgi" restarted (pid >31479) > >My login code is basically copied from the other apps. All I do to >login is throw a User object into @session. > >This app was developed under 0.9.5, but the other apps were developed >under 0.9.2. 0.9.5 is the version of Rails installed on the server. > >I''m using fcgi 2.4.0 with mod_fastcgi-2.4.2 under Apache 2.0.47. > > >
Restarting doesn''t help for me. It continues to fail on every other request. I''m running without fcgi on this one app for now, but it''s way too slow. On Tue, 08 Feb 2005 18:57:02 -0600, Brian Terlson <terl0004-OJFnDUYgAso@public.gmane.org> wrote:> I experience similar behavior from time to time - every other request > errors out. I haven''t been able to find a cause. Restarting Apache > sometimes helped, but restarting the server machine works 100% - for > only a short time :( I would be interested in what causes this problem, > since I''ve got a feeling it''ll come back. > > -Brian > > Ben Sinclair wrote: > > >I''m having a strange problem with FastCGI. I have several Rails apps > >running with fastcgi on this machine, but my newest one doesn''t. > > > >It works just fine until you try to login. After logging in every > >other page reload will fail with a 500. If you hit reload it will come > >up just fine, with your session intact. > > > >In the Apache error_log I see: > > > >[Tue Feb 08 18:36:38 2005] [warn] FastCGI: (dynamic) server > >"/home/ben/public_html/mailapp/public/dispatch.fcgi" (pid 31476) > >terminated by calling exit with status ''1'' > >[Tue Feb 08 18:36:38 2005] [warn] FastCGI: (dynamic) server > >"/home/ben/public_html/mailapp/public/dispatch.fcgi" restarted (pid > >31479) > > > >My login code is basically copied from the other apps. All I do to > >login is throw a User object into @session. > > > >This app was developed under 0.9.5, but the other apps were developed > >under 0.9.2. 0.9.5 is the version of Rails installed on the server. > > > >I''m using fcgi 2.4.0 with mod_fastcgi-2.4.2 under Apache 2.0.47. > > > > > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Ben Sinclair ben-bgLzOLc97kcYkl5+HhvCNA@public.gmane.org
I forgot to check my application''s own error log, and whenever a request fails I get my favorite error: Session contained objects where the class definition wasn''t available. The only thing I ever put into the session is a User object, which I require in the application controller. Plus, when I hit reload it works fine. On Tue, 8 Feb 2005 18:58:51 -0600, Ben Sinclair <bensinc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Restarting doesn''t help for me. It continues to fail on every other request. > > I''m running without fcgi on this one app for now, but it''s way too slow. > > > On Tue, 08 Feb 2005 18:57:02 -0600, Brian Terlson <terl0004-OJFnDUYgAso@public.gmane.org> wrote: > > I experience similar behavior from time to time - every other request > > errors out. I haven''t been able to find a cause. Restarting Apache > > sometimes helped, but restarting the server machine works 100% - for > > only a short time :( I would be interested in what causes this problem, > > since I''ve got a feeling it''ll come back. > > > > -Brian > > > > Ben Sinclair wrote: > > > > >I''m having a strange problem with FastCGI. I have several Rails apps > > >running with fastcgi on this machine, but my newest one doesn''t. > > > > > >It works just fine until you try to login. After logging in every > > >other page reload will fail with a 500. If you hit reload it will come > > >up just fine, with your session intact. > > > > > >In the Apache error_log I see: > > > > > >[Tue Feb 08 18:36:38 2005] [warn] FastCGI: (dynamic) server > > >"/home/ben/public_html/mailapp/public/dispatch.fcgi" (pid 31476) > > >terminated by calling exit with status ''1'' > > >[Tue Feb 08 18:36:38 2005] [warn] FastCGI: (dynamic) server > > >"/home/ben/public_html/mailapp/public/dispatch.fcgi" restarted (pid > > >31479) > > > > > >My login code is basically copied from the other apps. All I do to > > >login is throw a User object into @session. > > > > > >This app was developed under 0.9.5, but the other apps were developed > > >under 0.9.2. 0.9.5 is the version of Rails installed on the server. > > > > > >I''m using fcgi 2.4.0 with mod_fastcgi-2.4.2 under Apache 2.0.47. > > > > > > > > > > > > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > -- > Ben Sinclair > ben-bgLzOLc97kcYkl5+HhvCNA@public.gmane.org >-- Ben Sinclair ben-bgLzOLc97kcYkl5+HhvCNA@public.gmane.org
Well, I''ve noticed a few more things. Two of my apps don''t work, and both of them put ActiveRecord objects into the session. The app that does work simply puts a string into the session. I''ve said it works on every other request, but what really happens is it works once every time fcgi restarts. After the error occurs, fcgi restarts so the next request works. I''ve looked in the session files in /tmp using strings, and it appears that the only thing in them is my user ActiveRecord object. It''s like it''s requiring the user class correctly the first time, but the second time it doesn''t for some reason. I tried manually requiring the user class in the ApplicationController and even the dispatch.fcgi, but it still doesn''t work. On Tue, 8 Feb 2005 19:16:06 -0600, Ben Sinclair <bensinc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I forgot to check my application''s own error log, and whenever a > request fails I get my favorite error: Session contained objects where > the class definition wasn''t available. > > The only thing I ever put into the session is a User object, which I > require in the application controller. Plus, when I hit reload it > works fine.-- Ben Sinclair ben-bgLzOLc97kcYkl5+HhvCNA@public.gmane.org