Sometimes in production, some piece of code with a specific input might break with a 500 error. How can I configure Rails 3 to automatically send the traceback to an email when there's a 500 error?
Check out ExceptionNotification. That's exactly what it was designed for.
And if you want even better visibility I would suggest you set up an Error Catcher. It's basically the upgraded version of ExceptionNotifier. Airbrake works well but I prefer the open source equivalent Errbit. https://github.com/errbit/errbit
You may try this one ExceptionLogger . It allow you log exceptions inside a database table.
Related
I am using homestead as my development environment, I turned on the hhvm option for the site
sites:
- map: homestead.app
to: /home/vagrant/Code/wheremyprojectis
hhvm: true
I found that when there is an exception, everything is fine, but If I forgot to use namespace, got syntax error in the blade templates, I got nothing, blank page. I go check the logs and still nothing, the debug option is true. It's quite frustrating until I turned off the hhvm option.
I know it is not a big deal, but I still want to know is there any way to fix this?
I experienced the same problem. I searched around and found that it seems to be intentional:
https://github.com/facebook/hhvm/issues/4818
https://github.com/facebook/hhvm/issues/2571
Now you can poke through the github issues mentioned above, as well as these stackoverflow questions:
Display fatal/notice errors in browser
hhvm-fastcgi + nginx how to make it display fatal errors in the browser
laravel 5 show blank page on server error (and no laravel log), running with hhvm and nginx
For the time being, it ultimately boils down to writing your own handler, which isn't too bad. You can also tail the errors at /var/log/hhvm/error.log. Any errors that you intentionally want going to the browser you could of course handle using Laravel's error handling and logging.
UPDATE:
I reported this issue(and a fix) to the Laravel github here:
https://github.com/laravel/framework/issues/8744
Is there a gem that I could use which will notify me whenever there's an error present in my logs? It seems counterintuitive for one to have to scroll top to bottom in your terminal logs in order to locate an error and the exact line in your application of that error. Is there something that one can use that neatly displays all instances of errors and the exact location in ones application where those errors are occurring?
Try this https://github.com/rails/exception_notification.
Or this https://airbrake.io/pages/home (but it's not free).
Also to for better dev 500 error pages try https://github.com/charliesome/better_errors
Noticed a big massive loophole in my symfony site. If I visit
localhost:8080/frontend_dev.php/module [naturally the indexSuccess.php file gets executed]
I get the desired file... however, if I go onto:
localhost:8080/module, then it returns a 500 internal server error.
This is obviously going to be a biiiig problem once I migrate to production [heck, I have migrated and it is the problem].
I am sure I am missing a trick here, just what I am not sure!
Thanks!
Not sure if this is a real question, but why would you think not including the controller would work?
# wrong
localhost:8080/module
# right - By default Controller needs .php extension
localhost:8080/frontend.php/module
Also, you can check the 500 internal server error by tailing your php error_log, assuming you have logging turned on.
i have service to send sms to the mobile through Application. I am getting the follwing error.
2011-06-06 19:37:35,729 [http-8080-2] ERROR sipgate.SipgateService - Server returned HTTP response code: 401 for URL: https://samurai.sipgate.net/RPC2
This probably means you are using an invalid username or password
Have you set up the config as explained on the plugin page (at the top of the documentation)?
I also assume that this means your earlier problem was solved... Can you accept the answer if my answer helped, or explain what you did to fix it if it did not?
I agree with Tim. You can only log in, if your Sipgate-Registration was verified by Sipgate.
Points, which you can check to see if your account is not working:
Try to log in on the sipgate.de webpage
Use the Perl-Client given here: http://www.sipgate.de/basic/api
The client can be downloaded at this location:http://www.sipgate.de/beta/public/static/downloads/basic/api/sipgate_api_perl_examples.zip
Hopefully you should not be able to do at least one of these things. Then you know you have to talk to the support # sipgate
The documentation on the plugin-page says, you have to have a 'conf/Config.groovy'-file. This means that you should have the basic Config.groovy file in the folder 'grails-app/conf/', which ships with every Grails installation. So my guess is that you might have created a different Config.groovy-file. So better check on the Config.groovy-file. The SMS-plugin should have generated some placeholders for you, where you need to enter your sipgate-account-data.
I'm developing a rails app and running the server in the development environment on my local host. I'd like to see the error page that I would see when the app is on the production server, and I go to myapp.com/should_show_error_page so that I can style it. Currently, when I go to a page that should display this kind of error, I get the full exception description and stack traces. Starting the server with RAILS_ENV=production isn't enough unless I go to the page from a different machine. I'd appreciate any help.
Update
Setting config.consider_all_requests_local = true in config/environments/development.rb doesn't do it either
another update
I'm using goalie to generate the error pages, so they're not static.
The easiest way to do this would be to access this through the hostname of your computer. For example, I would test it using http://ryanbigg.local:3000/. To get the hostname, type hostname in your prompt.
Just mirror your production server's configuration. Without knowing what that is, I could not comment further.
Edit public/500.html. Browse to http://localhost:3000/500.html to see what it looks like.