Search code examples
mysqlruby-on-railspostgresqlherokucleardb

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?


Solution

  • 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!