dokku-pg-plugin
dokku-pg-plugin copied to clipboard
Rails database.yml file not parsing correctly
I am using Dokku v0.3.15 + Ubuntu v14.
Creating a new db through the plugin appears to be generating an correct DATABASE_URL
with the latest from master
branch.
[email protected]#: dokku postgresql:link myapp myappdb
docker: "inspect" requires a minimum of 1 argument. See 'docker inspect --help'.
time="2015-03-22T19:50:08-04:00" level="fatal" msg="json: cannot unmarshal array into Go value of type map[string]interface {}"
-----> Creating /home/dokku/app/ENV
-----> Setting config vars and restarting app
DATABASE_URL: postgres://root:XXXXXXX@:/db
-----> Releasing app ...
-----> Release complete!
-----> Deploying app ...
-----> Deploy complete!
(Notice missing hostname.)
So when I ran a db:migrate
, I got a URI::InvalidURIError
(something to the effect of http://stackoverflow.com/questions/29071069/dokku-rails-postgresql-error-uriinvalidurierror-the-scheme-postgres-doe).
Luckily, I had an older version of the dokku-pg-plugin
(I suppose you could check out an earlier commit), so I manually installed the older plugin and it works:
local$ scp postgresql.tar [email protected]:/var/lib/dokku/plugins/
[email protected]#: cd /var/lib/dokku/plugins/
[email protected]#: tar xf postgresql.tar
[email protected]:/var/lib/dokku/plugins# dokku postgresql:link myapp myappdb
time="2015-03-22T20:22:33-04:00" level="fatal" msg="json: cannot unmarshal array into Go value of type map[string]interface {}"
-----> Setting config vars and restarting app
DATABASE_URL: postgres://root:[email protected]:/db
-----> Releasing app ...
-----> Deploying app ...
-----> Running pre-flight checks
check-deploy: /home/dokku/app/CHECKS not found. attempting to retrieve it from container ...
CHECKS file not found in container. skipping checks.
-----> Running post-deploy
-----> Configuring app.leverage.blue...
-----> Creating http nginx.conf
-----> Running nginx-pre-reload
Reloading nginx
-----> Shutting down old container in 60 seconds
=====> Application deployed:
http://myapp.example.com
(Notice hostname appears correctly.)
Has something changed in the DATABASE_URL
generation logic that causes hostname to go astray?
Thank you!
I'm having the same issue.
Oddly enough I managed to find a work around by giving both my app and its database the same name.
+1.
RossKinsella's solution worked for me.
Me as well. And naming the database and app the same worked as a fix for me as well.
Similar issue but all was fine when I just named the database container the same as the app.
kudos to @RossKinsella naming the app same as database works for me.
Giving same name did not resolve issue for me
Same issue, and giving the same name to the app/db hasn't solved it. Is it possible to define the host manually before rake db migrate
?