Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Heroku and ClearDB error

I have a Ruby on Rails application with a mysql database (using the gem mysql2). Since Heroku runs postgres I followed this step in order to make it work:

$>heroku addons:create cleardb:ignite
$>heroku config | grep CLEARDB_DATABASE_URL
$>heroku config:set DATABASE_URL='mysql2://my-url'

As described here.

The problem is that I get this error on the last command:

Setting config vars and restarting xxxxxx-xxxxx-16407... !!!
 ▸    Cannot overwrite attachment values DATABASE_URL.

And my application can't run:

2016-03-18T10:31:31.413121+00:00 heroku[run.1567]: State changed from up to complete
2016-03-18T10:31:34.818303+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=xxxxx-xxxxx-16407.herokuapp.com request_id=236455b8-7a02-49f0-8e2e-a67341a81580 fwd="151.225.234.109" dyno= connect= service= status=503 bytes=
2016-03-18T10:31:35.308136+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=xxxxx-xxxx-16407.herokuapp.com request_id=974dab02-e914-42fb-ad96-5476e30e9d17 fwd="151.225.234.109" dyno= connect= service= status=503 bytes=
2016-03-18T10:31:35.434538+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=xxxx-xxxxx-16407.herokuapp.com request_id=22bfdfd8-9cdf-4e3d-bb13-c616591bd91f fwd="151.225.234.109" dyno= connect= service= status=503 bytes=

I have already execute bundle install and rake db:migrate on the heroku machine.

Do you know how can I solve the issue?

like image 955
ste Avatar asked Mar 18 '16 10:03

ste


People also ask

What is ClearDB in Heroku?

ClearDB is a powerful, high-speed database-as-a-service in the cloud for your MySQL powered applications.

How do I connect to Heroku ClearDB?

In heroku website, go to My Apps and select the app on which you have installed ClearDB. On the top corner click on Addons and then select ClearDB MySQL Database. Once there, click on your database and choose the 'Endpoint Information' tab. There you see your username/password.

Is ClearDB heroku free?

The high speed database for your MySQL powered applications. Starting at $0/mo.

Has exceeded the Max_questions resource ClearDB?

If you receive this message, it means that you have reached your connection limit for the plan for which you are currently subscribed. We recommend that you upgrade your database to a larger plan to lift this restriction off of your database.


2 Answers

Thanks to heroku support I solved the problem!

Basically I needed to delete my old Database implementation before running the new one. Here's what I did:

$ heroku addons:destroy heroku-postgresql -a NAMEOFTHEAPP

And do again the procedure for installing ClearDB. Everything is working now!

like image 51
ste Avatar answered Oct 06 '22 15:10

ste


You need to remove the old DB before adding the new DATABASE_URL by following command:

$ heroku addons:destroy heroku-postgresql

I will ask the name of the app. Or you can use directly

$ heroku addons:destroy heroku-postgresql -a NAMEOFTHEAPP

like image 6
Raghav Gilhotra Avatar answered Oct 06 '22 15:10

Raghav Gilhotra