Dan Croak
2006-Apr-03 17:56 UTC
[Rails] Dealing with Application error (Rails) in production
Hi all, Week 2 working with Ruby on Rails... I have a working app in development that is now throwing a generic, "Application error (Rails)" message in production. How do I deal with this so I can find more information about why the error is being thrown in production, but not in development? Thanks! -- Posted via http://www.ruby-forum.com/.
Kent Sibilev
2006-Apr-03 18:01 UTC
[Rails] Dealing with Application error (Rails) in production
Look in the log file, I presume. Kent. On 4/3/06, Dan Croak <dancroak@yahoo.com> wrote:> > Hi all, > > Week 2 working with Ruby on Rails... I have a working app in development > that is now throwing a generic, "Application error (Rails)" message in > production. > > How do I deal with this so I can find more information about why the > error is being thrown in production, but not in development? > > Thanks! > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Kent --- http://www.datanoise.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060403/948ef662/attachment-0001.html
Agnieszka Figiel
2006-Apr-03 18:14 UTC
[Rails] Re: Dealing with Application error (Rails) in production
Dan Croak wrote:> Hi all, > > Week 2 working with Ruby on Rails... I have a working app in development > that is now throwing a generic, "Application error (Rails)" message in > production. > > How do I deal with this so I can find more information about why the > error is being thrown in production, but not in development? > > Thanks!You''re not saying whether you only changed the environment or also the web server. In the first case try looking in production.log. In the second case you can also try your webserver''s error log and any relevant log like the fcgi crash log. have a look at these pieces of advise, they mention some of the gotchas - some may not apply to your setup: http://ocsforums.com/showthread.php?t=276 http://wiki.rubyonrails.com/rails/pages/Gotcha http://www.michaelbuffington.com/archives/2006/01/rails_troublesh.html http://typo.in/ -- Agnieszka -- Posted via http://www.ruby-forum.com/.
Dan Croak
2006-Apr-03 18:20 UTC
[Rails] Re: Dealing with Application error (Rails) in production
Kent Sibilev wrote:> Look in the log file, I presume. > > Kent.Thanks, Kent. I looked in the production.log file and found this particular error: Errno::EPIPE (Broken pipe) Any idea what that is about? I started seeing the error when I switched over from Apache to a lighttpd web server . -- Posted via http://www.ruby-forum.com/.
Dan Croak
2006-Apr-03 18:25 UTC
[Rails] Re: Dealing with Application error (Rails) in production
Agnieszka Figiel wrote:> > You''re not saying whether you only changed the environment or also the > web server. In the first case try looking in production.log. In the > second case you can also try your webserver''s error log and any relevant > log like the fcgi crash log. > > have a look at these pieces of advise, they mention some of the gotchas > - some may not apply to your setup: > http://ocsforums.com/showthread.php?t=276 > http://wiki.rubyonrails.com/rails/pages/Gotcha > http://www.michaelbuffington.com/archives/2006/01/rails_troublesh.html > http://typo.in/ > > -- > AgnieszkaAgnieszka, Thank you for your response. I looked at the sites you provided and it seemed like that information was relevant to the "Rails application failed to start properly" error. I may have been unclear, but my application is running. The home page is merely a single text field and submit button. When a user enters their email address and hits "Submit," their information is recorded into the database. The error I am seeing is "Application error (Rails)" when I try to log into the password-protected administrative section of the web site. -- Posted via http://www.ruby-forum.com/.
Jeff Coleman
2006-Apr-03 19:29 UTC
[Rails] Re: Dealing with Application error (Rails) in production
Dan Croak wrote:> Hi all, > > Week 2 working with Ruby on Rails... I have a working app in development > that is now throwing a generic, "Application error (Rails)" message in > production. > > How do I deal with this so I can find more information about why the > error is being thrown in production, but not in development? > > Thanks!Have you modified your database and migrated the changes on your production server? If you add a database field locally and refer to it in your code, you can get these errors on your production server if the database schema isn''t up to date. Jeff -- Posted via http://www.ruby-forum.com/.
Peter Gibbons
2006-Apr-03 19:36 UTC
[Rails] Re: Dealing with Application error (Rails) in production
Dan Croak wrote:> Kent Sibilev wrote: >> Look in the log file, I presume. >> >> Kent. > > Thanks, Kent. I looked in the production.log file and found this > particular error: > > Errno::EPIPE (Broken pipe) > > Any idea what that is about? > > I started seeing the error when I switched over from Apache to a > lighttpd web server .If you look at the unreleased changelog for Lighttpd, it shows that it fixes a fastcgi problem. The unreleased fixes in Lighttpd also include connections not getting closed on certain errors, and memory leaks. Try compiling the Lighttpd version in the repository, or wait until 1.4.12 is released. Or use Apache 2.0.55 with mod_fcgid-1.08 (not mod_fastcgi!). You can see the changesets at http://trac.lighttpd.net/trac/timeline?changeset=on&update=Update -- Posted via http://www.ruby-forum.com/.
Brian Hogan
2006-Apr-03 21:35 UTC
[Rails] Re: Dealing with Application error (Rails) in production
I''m only posting this so the next person who has this error will see it... Whenever you see this error, modify your database.yml file so that your development and production databases are the same and then launch your app with WEBrick in Development mode. This will rule out your Rails app as the problem so you can then look at the OS / webserver / database. On 4/3/06, Peter Gibbons <pgibbons@initech.lan> wrote:> > Dan Croak wrote: > > Kent Sibilev wrote: > >> Look in the log file, I presume. > >> > >> Kent. > > > > Thanks, Kent. I looked in the production.log file and found this > > particular error: > > > > Errno::EPIPE (Broken pipe) > > > > Any idea what that is about? > > > > I started seeing the error when I switched over from Apache to a > > lighttpd web server . > > If you look at the unreleased changelog for Lighttpd, it shows that it > fixes a fastcgi problem. The unreleased fixes in Lighttpd also include > connections not getting closed on certain errors, and memory leaks. > > Try compiling the Lighttpd version in the repository, or wait until > 1.4.12 is released. Or use Apache 2.0.55 with mod_fcgid-1.08 (not > mod_fastcgi!). > > You can see the changesets at > > http://trac.lighttpd.net/trac/timeline?changeset=on&update=Update > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060403/df804ded/attachment-0001.html
Dan Croak
2006-Apr-05 15:50 UTC
[Rails] Re: Dealing with Application error (Rails) in production
Jeff Coleman wrote:> Have you modified your database and migrated the changes on your > production server? > > If you add a database field locally and refer to it in your code, you > can get these errors on your production server if the database schema > isn''t up to date. > > JeffHi Jeff, I created the database table by hand using TextDrive''s (my web hosting company''s) web-based MySQL admin tool. The only thing that is different about the table versus the development version as far as I can tell is the password column. On dev, it is of type char(40), whereas on production, the web-based tool forces the column to be of type varchar(40). Could that be causing the problem? -- Posted via http://www.ruby-forum.com/.
Dan Croak
2006-Apr-05 15:53 UTC
[Rails] Re: Dealing with Application error (Rails) in production
Peter Gibbons wrote:> If you look at the unreleased changelog for Lighttpd, it shows that it > fixes a fastcgi problem. The unreleased fixes in Lighttpd also include > connections not getting closed on certain errors, and memory leaks. > > Try compiling the Lighttpd version in the repository, or wait until > 1.4.12 is released. Or use Apache 2.0.55 with mod_fcgid-1.08 (not > mod_fastcgi!). > > You can see the changesets at > > http://trac.lighttpd.net/trac/timeline?changeset=on&update=UpdatePeter, Thanks for the response. Fiddling with lighttpd scares the hell out of me right now and that solution is way over my head. I passed it along to my web hosting company in case there is something they need to know there. -- Posted via http://www.ruby-forum.com/.
Dan Croak
2006-Apr-05 15:59 UTC
[Rails] Re: Re: Dealing with Application error (Rails) in production
Brian Hogan wrote:> I''m only posting this so the next person who has this error will see > it... > Whenever you see this error, modify your database.yml file so that your > development and production databases are the same and then launch your > app > with WEBrick in Development mode. This will rule out your Rails app as > the > problem so you can then look at the OS / webserver / database.Hi Brian, Are you saying to change the database information for development in the database.yml to point to the production database? I''m not sure that my web hosting company is going to let me connect in that way... Can''t I just turn the default Rails error messaging to give me full dev errors somewhere? (temporarily of course while I track down the problem) Or will my web host not allow me to do that, either? -- Posted via http://www.ruby-forum.com/.
Brian Hogan
2006-Apr-05 16:38 UTC
[Rails] Re: Re: Dealing with Application error (Rails) in production
You could do that as well. Or you could get really clever and have the errors emailed to you.. that way you''ll always get them when you''re in production so you can respond to them. On 4/5/06, Dan Croak <dancroak@yahoo.com> wrote:> > Brian Hogan wrote: > > I''m only posting this so the next person who has this error will see > > it... > > Whenever you see this error, modify your database.yml file so that your > > development and production databases are the same and then launch your > > app > > with WEBrick in Development mode. This will rule out your Rails app as > > the > > problem so you can then look at the OS / webserver / database. > > Hi Brian, > > Are you saying to change the database information for development in the > database.yml to point to the production database? I''m not sure that my > web hosting company is going to let me connect in that way... > > Can''t I just turn the default Rails error messaging to give me full dev > errors somewhere? (temporarily of course while I track down the > problem) Or will my web host not allow me to do that, either? > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060405/ba744139/attachment.html
Dan Croak
2006-Apr-05 17:04 UTC
[Rails] Re: Re: Re: Dealing with Application error (Rails) in produc
Brian Hogan wrote:> You could do that as well. Or you could get really clever and have the > errors emailed to you.. that way you''ll always get them when you''re in > production so you can respond to them.Brian, Great minds think alike. When you posted this, I had just gone through the process of setting up the emailed errors: http://wiki.rubyonrails.com/rails/pages/HowtoSendEmailWhenRailsThrowsAnException Unfortunately, as with just about everything else I''ve done with Ruby on Rails to this point, it doesn''t seem to work yet. I repeated the error behavior on both development and production and no emails have been sent. I''m seriously contemplating going back to ASP.NET if I can''t get a working app running in Rails soon. Blaah. -- Posted via http://www.ruby-forum.com/.
Brian Hogan
2006-Apr-05 17:28 UTC
[Rails] Re: Re: Re: Dealing with Application error (Rails) in produc
Ack! Don''t do that! Don''t give up just yet. There are several good examples on the web regarding this. But you should already have a working, tested app that runs locally.... unit, functional, and integration tests can help you find all sorts of bugs before you go to a production mode environment. On 4/5/06, Dan Croak <dancroak@yahoo.com> wrote:> > Brian Hogan wrote: > > You could do that as well. Or you could get really clever and have the > > errors emailed to you.. that way you''ll always get them when you''re in > > production so you can respond to them. > > Brian, > > Great minds think alike. When you posted this, I had just gone through > the process of setting up the emailed errors: > > http://wiki.rubyonrails.com/rails/pages/HowtoSendEmailWhenRailsThrowsAnException > > Unfortunately, as with just about everything else I''ve done with Ruby on > Rails to this point, it doesn''t seem to work yet. I repeated the error > behavior on both development and production and no emails have been > sent. > > I''m seriously contemplating going back to ASP.NET if I can''t get a > working app running in Rails soon. Blaah. > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060405/5c7e29cd/attachment.html
Tom Davies
2006-Apr-05 17:33 UTC
[Rails] Re: Re: Dealing with Application error (Rails) in production
Hi Dan, I think you will find that the exception_notification plugin will help immensely for you. I wrote up a brief entry on my blog about it: http://blog.atomgiant.com/articles/2006/03/20/global-error-handling Feel free to email me directly if you have any problems. Tom On 4/5/06, Brian Hogan <bphogan@gmail.com> wrote:> You could do that as well. Or you could get really clever and have the > errors emailed to you.. that way you''ll always get them when you''re in > production so you can respond to them. > > > > On 4/5/06, Dan Croak <dancroak@yahoo.com> wrote: > > Brian Hogan wrote: > > > I''m only posting this so the next person who has this error will see > > > it... > > > Whenever you see this error, modify your database.yml file so that your > > > development and production databases are the same and then launch your > > > app > > > with WEBrick in Development mode. This will rule out your Rails app as > > > the > > > problem so you can then look at the OS / webserver / database. > > > > Hi Brian, > > > > Are you saying to change the database information for development in the > > database.yml to point to the production database? I''m not sure that my > > web hosting company is going to let me connect in that way... > > > > Can''t I just turn the default Rails error messaging to give me full dev > > errors somewhere? (temporarily of course while I track down the > > problem) Or will my web host not allow me to do that, either? > > > > -- > > Posted via http://www.ruby-forum.com/ . > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-- Tom Davies http://blog.atomgiant.com http://gifthat.com
Dan Croak
2006-Apr-05 18:16 UTC
[Rails] Re: Re: Re: Dealing with Application error (Rails) in produc
Tom Davies wrote:> Hi Dan, > > I think you will find that the exception_notification plugin will help > immensely for you. I wrote up a brief entry on my blog about it: > > http://blog.atomgiant.com/articles/2006/03/20/global-error-handling > > Feel free to email me directly if you have any problems. > > TomThanks, Tom. That will be a big help for emailing the erros to me. I''m configuring ActionMailer for the first time now (must have been why I haven''t been able to get any emails to send thus far). I think the other problems I''ve been having are "rookie" problems as well. I think I have dug up information through my own research that I have to restart the FCGI processes every time I move my Rails code up to the production server? Is that right and I am using the correct language? I''m still not sure exactly how I go about doing that (restarting FCGI, but I''ll keep looking while I await a response). Thanks again to all for your help... Hopefully you''ll be able to prove the old axiom wrong and you CAN teach an old ASP.NET dog new Ruby on Rails tricks... :) Dan -- Posted via http://www.ruby-forum.com/.
Tom Davies
2006-Apr-05 18:41 UTC
[Rails] Re: Re: Re: Dealing with Application error (Rails) in produc
Yes, everytime you move your code to the production server you should restart your lighttpd. If you haven''t tried already, take a look at Capistrano (aka - SwitchTower). It makes this pretty painless. To restart lighttpd, I am using a script like this one: http://textsnippets.com/posts/show/241 I am also hosted at TextDrive and someone else said that script is there already for you, but I could not find it, so I created my own from that snippet. Good luck, Tom On 4/5/06, Dan Croak <dancroak@yahoo.com> wrote:> Tom Davies wrote: > > Hi Dan, > > > > I think you will find that the exception_notification plugin will help > > immensely for you. I wrote up a brief entry on my blog about it: > > > > http://blog.atomgiant.com/articles/2006/03/20/global-error-handling > > > > Feel free to email me directly if you have any problems. > > > > Tom > > > Thanks, Tom. That will be a big help for emailing the erros to me. I''m > configuring ActionMailer for the first time now (must have been why I > haven''t been able to get any emails to send thus far). > > I think the other problems I''ve been having are "rookie" problems as > well. I think I have dug up information through my own research that I > have to restart the FCGI processes every time I move my Rails code up to > the production server? Is that right and I am using the correct > language? I''m still not sure exactly how I go about doing that > (restarting FCGI, but I''ll keep looking while I await a response). > > Thanks again to all for your help... Hopefully you''ll be able to prove > the old axiom wrong and you CAN teach an old ASP.NET dog new Ruby on > Rails tricks... :) > > Dan > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Tom Davies http://blog.atomgiant.com http://gifthat.com