Troubleshooting a Ruby production application
I am by no means a Ruby expert, but I have been tasked with troubleshooting an existing Ruby application. Specifically some end user DB tasks were failing to save records and the application was throwing a generic error message to the user.
By enabling debug logging and viewing the Ruby log file, I was able to see that the application was failing when attempting to send an email confirmation, then it would roll back all the DB changes since the overall process* did not complete.
*this may not be the correct Ruby terminology, please pardon my inexperience with Ruby, as I am more a PHP/JAVA programmer.
Thus, the final solution was to check with the email admin and see if the email address password etc. had been changed. The password had been changed so I updated the appropriate Ruby configuration file and all was right with the world 😉
Edit the environment config:
Find the config.log_level setting and change to :debug
Restart the web server running Ruby:
(log changes do not go into effect without restarting)
service nginx restart
View the log file:
tail -f /root/sites/vlm/log/production.log -n 100
Find the email address in question:
grep -r –exclude-dir=log ’emailaddress’ /root/sites/vlm/
After viewing the resulting found file it was easy to edit and fix the info that had changed. 🙂
PS For performance and security, I recommend going back to the default logging (info) method after you troubleshoot an issue. Also, if anyone has a better method please comment. Thanks!