Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails database.yml file not parsing correctly #69

Open
LeverageBlue opened this issue Mar 23, 2015 · 7 comments
Open

Rails database.yml file not parsing correctly #69

LeverageBlue opened this issue Mar 23, 2015 · 7 comments

Comments

@LeverageBlue
Copy link

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!

@RossKinsella
Copy link

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.

@alexandred
Copy link

+1.

RossKinsella's solution worked for me.

@vroomanj
Copy link

vroomanj commented Apr 7, 2015

Me as well. And naming the database and app the same worked as a fix for me as well.

@cbartlett
Copy link

Similar issue but all was fine when I just named the database container the same as the app.

@aldoforce
Copy link

kudos to @RossKinsella
naming the app same as database works for me.

@dzmitrys-dev
Copy link

Giving same name did not resolve issue for me

@mtchllbrrn
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants