I''m developing my app against Ror 2.0, and I noticed my public/ 500.html page was not rendered in response to some low level errors (like when I stopped MySql). So I did some debugging to figure out why. After some digging I think I''m seeing a bug in the way dispatcher.rb looks for the error pages. This seems incredible to me. How could such a basic bug not be detected? But the code I''m looking at sure looks wrong. The filename it constructs for the 500.html page has an extra space in it: "public/ 500 .html" Here''s my diff: C:\projects\[....]\vendor\rails>svn diff . Index: actionpack/lib/action_controller/dispatcher.rb ==================================================================--- actionpack/lib/action_controller/dispatcher.rb (revision 9641) +++ actionpack/lib/action_controller/dispatcher.rb (working copy) @@ -61,7 +61,7 @@ private def failsafe_response_body(status) - error_path = "#{error_file_path}/#{status.to_s[0..3]}.html" + error_path = "#{error_file_path}/#{status}.html" if File.exist?(error_path) File.read(error_path) I''ve tested this on WinXP and OS X with the same results. I tried searching this group and the lighthouse bug db, but I see no other references to this problem... I did find a 9-month old Trac ticket reporting this problem, but the old Trac system is obsolete, right? (http://dev.rubyonrails.org/ticket/9305) What am I missing? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I wasn''t aware ANY request went through dispatcher.rb. Correct me if I''m wrong. On Thu, May 22, 2008 at 5:43 AM, KC <bernalkc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I''m developing my app against Ror 2.0, and I noticed my public/ > 500.html page was not rendered in response to some low level errors > (like when I stopped MySql). So I did some debugging to figure out > why. After some digging I think I''m seeing a bug in the way > dispatcher.rb looks for the error pages. > > This seems incredible to me. How could such a basic bug not be > detected? > > But the code I''m looking at sure looks wrong. The filename it > constructs for the 500.html page has an extra space in it: "public/ > 500 .html" > > Here''s my diff: > > C:\projects\[....]\vendor\rails>svn diff . > Index: actionpack/lib/action_controller/dispatcher.rb > ==================================================================> --- actionpack/lib/action_controller/dispatcher.rb (revision > 9641) > +++ actionpack/lib/action_controller/dispatcher.rb (working copy) > @@ -61,7 +61,7 @@ > > private > def failsafe_response_body(status) > - error_path = "#{error_file_path}/#{status.to_s[0..3]}.html" > + error_path = "#{error_file_path}/#{status}.html" > > if File.exist?(error_path) > File.read(error_path) > > I''ve tested this on WinXP and OS X with the same results. I tried > searching this group and the lighthouse bug db, but I see no other > references to this problem... I did find a 9-month old Trac ticket > reporting this problem, but the old Trac system is obsolete, right? > (http://dev.rubyonrails.org/ticket/9305) What am I missing? > > > >-- Appreciated my help? Recommend me on Working With Rails http://workingwithrails.com/person/11030-ryan-bigg --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
@KC -- Are you seeing this in _production_? Seems more likely that it''s a development issue (ie., all requests considered local via your / environment/development.rb) so that you see the error page that helps you debug. I see a page with backtrace in dev (WinXP and Ubuntu) but the expected 500 page if an error occurs in production. On May 21, 8:31 pm, "Ryan Bigg (Radar)" <radarliste...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I wasn''t aware ANY request went through dispatcher.rb. > > Correct me if I''m wrong. > > > > On Thu, May 22, 2008 at 5:43 AM, KC <berna...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I''m developing my app against Ror 2.0, and I noticed my public/ > > 500.html page was not rendered in response to some low level errors > > (like when I stopped MySql). So I did some debugging to figure out > > why. After some digging I think I''m seeing a bug in the way > > dispatcher.rb looks for the error pages. > > > This seems incredible to me. How could such a basic bug not be > > detected? > > > But the code I''m looking at sure looks wrong. The filename it > > constructs for the 500.html page has an extra space in it: "public/ > > 500 .html" > > > Here''s my diff: > > > C:\projects\[....]\vendor\rails>svn diff . > > Index: actionpack/lib/action_controller/dispatcher.rb > > ==================================================================> > --- actionpack/lib/action_controller/dispatcher.rb (revision > > 9641) > > +++ actionpack/lib/action_controller/dispatcher.rb (working copy) > > @@ -61,7 +61,7 @@ > > > private > > def failsafe_response_body(status) > > - error_path = "#{error_file_path}/#{status.to_s[0..3]}.html" > > + error_path = "#{error_file_path}/#{status}.html" > > > if File.exist?(error_path) > > File.read(error_path) > > > I''ve tested this on WinXP and OS X with the same results. I tried > > searching this group and the lighthouse bug db, but I see no other > > references to this problem... I did find a 9-month old Trac ticket > > reporting this problem, but the old Trac system is obsolete, right? > > (http://dev.rubyonrails.org/ticket/9305) What am I missing? > > -- > Appreciated my help? > Recommend me on Working With Railshttp://workingwithrails.com/person/11030-ryan-bigg--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
All my testing has been in development instances. I''ll try production now. Makes sense that the routing would be different in the production environment. But the code in question is in need or repair. It attempts to show the 500 or 404 page and fails due to the string formatting error. On May 21, 11:10 pm, AndyV <AndyVana...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> @KC -- Are you seeing this in _production_? Seems more likely that > it''s a development issue (ie., all requests considered local via your / > environment/development.rb) so that you see the error page that helps > you debug. I see a page with backtrace in dev (WinXP and Ubuntu) but > the expected 500 page if an error occurs in production. > > On May 21, 8:31 pm, "Ryan Bigg (Radar)" <radarliste...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > I wasn''t aware ANY request went through dispatcher.rb. > > > Correct me if I''m wrong. > > > On Thu, May 22, 2008 at 5:43 AM, KC <berna...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > I''m developing my app against Ror 2.0, and I noticed my public/ > > > 500.html page was not rendered in response to some low level errors > > > (like when I stopped MySql). So I did some debugging to figure out > > > why. After some digging I think I''m seeing a bug in the way > > > dispatcher.rb looks for the error pages. > > > > This seems incredible to me. How could such a basic bug not be > > > detected? > > > > But the code I''m looking at sure looks wrong. The filename it > > > constructs for the 500.html page has an extra space in it: "public/ > > > 500 .html" > > > > Here''s my diff: > > > > C:\projects\[....]\vendor\rails>svn diff . > > > Index: actionpack/lib/action_controller/dispatcher.rb > > > ==================================================================> > > --- actionpack/lib/action_controller/dispatcher.rb (revision > > > 9641) > > > +++ actionpack/lib/action_controller/dispatcher.rb (working copy) > > > @@ -61,7 +61,7 @@ > > > > private > > > def failsafe_response_body(status) > > > - error_path = "#{error_file_path}/#{status.to_s[0..3]}.html" > > > + error_path = "#{error_file_path}/#{status}.html" > > > > if File.exist?(error_path) > > > File.read(error_path) > > > > I''ve tested this on WinXP and OS X with the same results. I tried > > > searching this group and the lighthouse bug db, but I see no other > > > references to this problem... I did find a 9-month old Trac ticket > > > reporting this problem, but the old Trac system is obsolete, right? > > > (http://dev.rubyonrails.org/ticket/9305) What am I missing? > > > -- > > Appreciated my help? > > Recommend me on Working With Railshttp://workingwithrails.com/person/11030-ryan-bigg--~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
I can verify that this code is called in at least one context: when I shut down my MySql server and attempted a request that involved active record. No idea if this is On May 21, 5:31 pm, "Ryan Bigg (Radar)" <radarliste...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I wasn''t aware ANY request went through dispatcher.rb. > > Correct me if I''m wrong. > > > > On Thu, May 22, 2008 at 5:43 AM, KC <berna...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I''m developing my app against Ror 2.0, and I noticed my public/ > > 500.html page was not rendered in response to some low level errors > > (like when I stopped MySql). So I did some debugging to figure out > > why. After some digging I think I''m seeing a bug in the way > > dispatcher.rb looks for the error pages. > > > This seems incredible to me. How could such a basic bug not be > > detected? > > > But the code I''m looking at sure looks wrong. The filename it > > constructs for the 500.html page has an extra space in it: "public/ > > 500 .html" > > > Here''s my diff: > > > C:\projects\[....]\vendor\rails>svn diff . > > Index: actionpack/lib/action_controller/dispatcher.rb > > ==================================================================> > --- actionpack/lib/action_controller/dispatcher.rb (revision > > 9641) > > +++ actionpack/lib/action_controller/dispatcher.rb (working copy) > > @@ -61,7 +61,7 @@ > > > private > > def failsafe_response_body(status) > > - error_path = "#{error_file_path}/#{status.to_s[0..3]}.html" > > + error_path = "#{error_file_path}/#{status}.html" > > > if File.exist?(error_path) > > File.read(error_path) > > > I''ve tested this on WinXP and OS X with the same results. I tried > > searching this group and the lighthouse bug db, but I see no other > > references to this problem... I did find a 9-month old Trac ticket > > reporting this problem, but the old Trac system is obsolete, right? > > (http://dev.rubyonrails.org/ticket/9305) What am I missing? > > -- > Appreciated my help? > Recommend me on Working With Railshttp://workingwithrails.com/person/11030-ryan-bigg--~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---