I''m hoping someone can point out something obvious I''m not seeing. Heres the problem: When in production mode, when an error occurrs I get the white screen error: Application error (Rails), And, I can''t seem to override the method rescue_action_in_public, even though I''m *certain* local_request? is returning false. If I try to just render some text to the screen, inside that method in my application controller class, I still get the ''Application error (Rails)'' error. So, I can''t implement any exception handling in public. Now, I can set config.action_controller.consider_all_requests_local = true and I can see the error. So, somehow the request is NOT being seen as local, yet any attempts to catch it aren''t working. Help. :) Thanks! Rich --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
If you are getting this error, it¹s a 500 server error. Your dispatcher is never even seeing it. Look at the error-page specification to see what page is displayed in the case of a 500 I¹ll bet it¹s the page you are now seeing. Steve On 9/6/06 5:41 PM, "Rich Brant" <rbrant-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I''m hoping someone can point out something obvious I''m not seeing. > Heres the problem: > > When in production mode, when an error occurrs I get the white screen error: > > Application error (Rails), > > And, I can''t seem to override the method rescue_action_in_public, even > though I''m *certain* local_request? is returning false. If I try to > just render some text to the screen, inside that method in my > application controller class, I still get the ''Application error > (Rails)'' error. So, I can''t implement any exception handling in > public. Now, I can set > > config.action_controller.consider_all_requests_local = true > > and I can see the error. So, somehow the request is NOT being seen as > local, yet any attempts to catch it aren''t working. Help. :) > > Thanks! > > Rich > > >--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Rich Brant
2006-Sep-07 12:45 UTC
Re: inexplicable ''Application error (Rails)'' in production
Totally baffled/frustrated by this still. Any and all ideas are welcomed :) Even if they are obvious. I cannot understand why I can''t overwrite these methods. I can''t even overwrite rescue_action, which would allow me to handle all exceptions regardless of being local or not. What''s odder still is that I have another rails app on the same box, running fine, without this issue. System details: I''m on a VPS running Fedora Core 4 Ruby 1.8.4 Rails 1.1.6 SCGI On 9/6/06, Rich Brant <rbrant-To7aG29cuAKKf2Id4j40wVaTQe2KTcn/@public.gmane.org> wrote:> No, it''s a rails error. It''s any rails error in production. I can > toggle on and of config.action_controller.consider_all_requests_local > = false and true and when set to true I can see the error and they are > rails errors. But for some reason, if i set > consider_all_requests_local = false and I know local_request? returns > false, resuce_action_in_public can''t seem to be overridden. Or am I > not seeing what you are suggesting? > > On 9/6/06, s.ross <cwdinfo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > If you are getting this error, it''s a 500 server error. Your dispatcher is > > never even seeing it. Look at the error-page specification to see what page > > is displayed in the case of a 500 — I''ll bet it''s the page you are now > > seeing. > > > > Steve > > > > > > > > On 9/6/06 5:41 PM, "Rich Brant" <rbrant-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > > I''m hoping someone can point out something obvious I''m not seeing. > > Heres the problem: > > > > When in production mode, when an error occurrs I get the white screen > > error: > > > > Application error (Rails), > > > > And, I can''t seem to override the method rescue_action_in_public, even > > though I''m *certain* local_request? is returning false. If I try to > > just render some text to the screen, inside that method in my > > application controller class, I still get the ''Application error > > (Rails)'' error. So, I can''t implement any exception handling in > > public. Now, I can set > > > > config.action_controller.consider_all_requests_local > > true > > > > and I can see the error. So, somehow the request is NOT being seen as > > local, yet any attempts to catch it aren''t working. Help. :) > > > > Thanks! > > > > Rich > > > > > > > > > > > > > > > > > -- > Rich Brant > http://brantinteractive.com > rbrant-To7aG29cuAKKf2Id4j40wVaTQe2KTcn/@public.gmane.org > v. 267.640.2195 f. 215.689.1454 >-- Rich Brant http://brantinteractive.com rbrant-To7aG29cuAKKf2Id4j40wVaTQe2KTcn/@public.gmane.org v. 267.640.2195 f. 215.689.1454 --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
linux user
2006-Sep-07 13:36 UTC
Re: inexplicable ''Application error (Rails)'' in production
On 9/7/06, Rich Brant <rbrant-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Totally baffled/frustrated by this still. Any and all ideas are > welcomed :) Even if they are obvious. > > I cannot understand why I can''t overwrite these methods. I can''t even > overwrite rescue_action, which would allow me to handle all exceptions > regardless of being local or not. What''s odder still is that I have > another rails app on the same box, running fine, without this issue.Hi Rich Another rails app on the same box ....? Is it a different instance of the same app? If not then there is no comparison, if yes, then are they sharing the same session store? I would recommend looking into A. session store. This can happen due to stale session data, if you are running memcache restart it, if you use PStore then delete all session files and restart your application, if you use DataStore for session then delete all rows from session table. B. run the application in debug mode, set logger level to debug, your logs should tell you what is causing this 500 internal error. hope this helps -daya System details:> > I''m on a VPS running > Fedora Core 4 > Ruby 1.8.4 > Rails 1.1.6 > SCGI > > > > > On 9/6/06, Rich Brant <rbrant-To7aG29cuAKKf2Id4j40wVaTQe2KTcn/@public.gmane.org> wrote: > > No, it''s a rails error. It''s any rails error in production. I can > > toggle on and of config.action_controller.consider_all_requests_local > > = false and true and when set to true I can see the error and they are > > rails errors. But for some reason, if i set > > consider_all_requests_local = false and I know local_request? returns > > false, resuce_action_in_public can''t seem to be overridden. Or am I > > not seeing what you are suggesting? > > > > On 9/6/06, s.ross <cwdinfo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > If you are getting this error, it''s a 500 server error. Your > dispatcher is > > > never even seeing it. Look at the error-page specification to see what > page > > > is displayed in the case of a 500 — I''ll bet it''s the page you are now > > > seeing. > > > > > > Steve > > > > > > > > > > > > On 9/6/06 5:41 PM, "Rich Brant" <rbrant-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > > > > > > > I''m hoping someone can point out something obvious I''m not seeing. > > > Heres the problem: > > > > > > When in production mode, when an error occurrs I get the white screen > > > error: > > > > > > Application error (Rails), > > > > > > And, I can''t seem to override the method rescue_action_in_public, > even > > > though I''m *certain* local_request? is returning false. If I try to > > > just render some text to the screen, inside that method in my > > > application controller class, I still get the ''Application error > > > (Rails)'' error. So, I can''t implement any exception handling in > > > public. Now, I can set > > > > > > config.action_controller.consider_all_requests_local > > > true > > > > > > and I can see the error. So, somehow the request is NOT being seen as > > > local, yet any attempts to catch it aren''t working. Help. :) > > > > > > Thanks! > > > > > > Rich > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > Rich Brant > > http://brantinteractive.com > > rbrant-To7aG29cuAKKf2Id4j40wVaTQe2KTcn/@public.gmane.org > > v. 267.640.2195 f. 215.689.1454 > > > > > -- > Rich Brant > http://brantinteractive.com > rbrant-To7aG29cuAKKf2Id4j40wVaTQe2KTcn/@public.gmane.org > v. 267.640.2195 f. 215.689.1454 > > > >--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Rich Brant
2006-Sep-07 14:32 UTC
Re: inexplicable ''Application error (Rails)'' in production
> Another rails app on the same box ....? Is it a different > instance of the same app? If not then there is no comparison, if yes, then > are they sharing the same session store?no, different instances> > I would recommend looking into > > A. session store. This can happen due to stale session > data, if you are running memcache restart > it, if you use PStore then delete all > session files and restart your application, if you > use DataStore > for session then delete all rows from session table. >just PStore, and I tried that> B. run the application in debug mode, set logger level to debug, your logs > should tell you what is causing this 500 > internal error.That''s the thing. I *know* what the errors are. I just can''t catch (handle) them in production. So while I know what the errors are, that still doesn''t help me catch them.. becasue I can''t seem to overwrite rescue_action or rescue_action_in_public. ActionController catches them just fine, but my app can''t :( --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Rich Brant
2006-Sep-07 15:37 UTC
Re: inexplicable ''Application error (Rails)'' in production
minor update.. neither app can overwrite the recue_action_in_public method. Although I am sure the first one could at one point. hmm. what could have changed to casue this??? On 9/7/06, Rich Brant <rbrant-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Another rails app on the same box ....? Is it a different > > instance of the same app? If not then there is no comparison, if yes, then > > are they sharing the same session store? > > no, different instances > > > > > I would recommend looking into > > > > A. session store. This can happen due to stale session > > data, if you are running memcache restart > > it, if you use PStore then delete all > > session files and restart your application, if you > > use DataStore > > for session then delete all rows from session table. > > > > > just PStore, and I tried that > > > B. run the application in debug mode, set logger level to debug, your logs > > should tell you what is causing this 500 > > internal error. > > That''s the thing. I *know* what the errors are. I just can''t catch > (handle) them in production. So while I know what the errors are, that > still doesn''t help me catch them.. becasue I can''t seem to overwrite > rescue_action or rescue_action_in_public. ActionController catches > them just fine, but my app can''t :( >-- Rich Brant http://brantinteractive.com rbrant-To7aG29cuAKKf2Id4j40wVaTQe2KTcn/@public.gmane.org v. 267.640.2195 f. 215.689.1454 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Heri R>
2006-Sep-07 23:55 UTC
Re: inexplicable ''Application error (Rails)'' in production
hi rich i have had a similar problem and it tourned out to be a dispatch problem i don''t know if you have other rails app that works. for me, i reinstalled fcgi again and it worked. -- Heri R. http://sprinj.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 -~----------~----~----~----~------~----~------~--~---
mcintyre.tim-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2006-Sep-08 00:26 UTC
Re: inexplicable ''Application error (Rails)'' in production
Rich, Sounds to me like your dispatch isn''t even running. I''d go back to the basics and make sure your line endings, ownership, permissions, and shebang line are all correct. Good luck and let us know when you figure it out! Tim --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Chris Mear
2006-Sep-08 07:10 UTC
Re: inexplicable ''Application error (Rails)'' in production
Rich Brant wrote:> When in production mode, when an error occurrs I get the white screen error: > > Application error (Rails), > > And, I can't seem to override the method rescue_action_in_public, even > though I'm *certain* local_request? is returning false.What is the error, and where are you redefining rescue_action_in_public? Some Rails errors sort of occur before your controller ever enters the picture (don't ask me for details!). If you're redefining rescue_action_in_public in your controller (or even in your ApplicationController, I think), errors like that will trigger the built-in rescue_action_in_public since Rails hasn't reached your controller yet. Maybe this is what's happening in your app? It's hard to tell without knowing what the exception is, where it's occurring and where you're redefining the method. In my apps I redefine rescue_action_in_public in a little 'support' file in /lib that I include in environment.rb. It seems to catch pretty much everything. /config/environment.rb: require 'myapp_support' /lib/myapp_support.rb: module ActionController module Rescue protected def rescue_action_in_public(exception) case exception when RoutingError, UnknownAction then render_text(IO.read(File.join(RAILS_ROOT, 'public', '404.html')), "404 Not Found") else render_text(IO.read(File.join(RAILS_ROOT, 'public', '500.html')), "500 Internal Error") end end end end (I'm pretty sure I just copy-pasted this from somewhere in the past, but I can't remember from where that might have been.) Chris --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Rich Brant
2006-Sep-08 15:45 UTC
Re: inexplicable ''Application error (Rails)'' in production
It turned out to be a plugin I was using, ''meantime_filter'' I havent'' looked into the code enough to know exaclty why yet, but i plan to..thanks for the help though. On 9/8/06, Chris Mear <chris-OIzkuoyqg0kAvxtiuMwx3w@public.gmane.org> wrote:> Rich Brant wrote: > > When in production mode, when an error occurrs I get the white screen error: > > > > Application error (Rails), > > > > And, I can''t seem to override the method rescue_action_in_public, even > > though I''m *certain* local_request? is returning false. > > What is the error, and where are you redefining > rescue_action_in_public? > > Some Rails errors sort of occur before your controller ever enters the > picture (don''t ask me for details!). If you''re redefining > rescue_action_in_public in your controller (or even in your > ApplicationController, I think), errors like that will trigger the > built-in rescue_action_in_public since Rails hasn''t reached your > controller yet. > > Maybe this is what''s happening in your app? It''s hard to tell without > knowing what the exception is, where it''s occurring > and > where you''re redefining the method. > > In my apps I redefine rescue_action_in_public in a little ''support'' > file in /lib that I include in environment.rb. It seems to catch pretty > much everything. > > /config/environment.rb: > > require ''myapp_support'' > > /lib/myapp_support.rb: > > module ActionController > module Rescue > protected > def rescue_action_in_public(exception) > case exception > when RoutingError, UnknownAction then > render_text(IO.read(File.join(RAILS_ROOT, ''public'', > ''404.html'')), "404 Not Found") > else > render_text(IO.read(File.join(RAILS_ROOT, ''public'', > ''500.html'')), "500 Internal Error") > end > end > end > end > > (I''m pretty sure I just copy-pasted this from somewhere in the past, > but I can''t remember from where that might have been.) > > Chris > > > >-- Rich Brant http://brantinteractive.com rbrant-To7aG29cuAKKf2Id4j40wVaTQe2KTcn/@public.gmane.org v. 267.640.2195 f. 215.689.1454 --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---