sridharraman
sridharraman

Reputation: 375

Mysql error in Phusion Passenger in rails app

I am facing this error only in deployment. In fact, in the deployment server, the rails db production works fine. But on loading the app through the browser, this is the error I get:

Error message:
    (Mysql2::Error)
Exception class:
    PhusionPassenger::UnknownError

The production log just shows Connecting to database specified by database.yml in a loop.

This is a shared hosting service, and they have been unable to figure out the problem. Any idea what could be the reason?

I have to mention that this app was working fine until 6 hours back, and there were no changes made to the app for more than a day.

Upvotes: 2

Views: 615

Answers (1)

Christoph Werner
Christoph Werner

Reputation: 141

  1. Make sure your production environment is correctly set up (gems, keys, database, ...). Maybe you installed the wrong version of the mysql2 gem?
  2. Double-check your database.yml file for any typos.
  3. It might also be possible that it takes too long to establish the connection with the database. Try to increase the timeout and the pool size.

Look additionally here: http://davidlesches.com/blog/fixing-a-connecting-to-database-specified-by-database-yml-loop

Some further questions:

  • Have you tried to run your server in production mode on your local machine?
  • Is the app working in test mode on the server?
  • Are there any MySQL or Phusion Passenger log files you can share with us?

Upvotes: 1

Related Questions