Open stevenjwolfman opened 10 years ago
This is definitely a ruby 2.1.1 issue because I didn't have this problem when I pushed my other app that is 2.0.0
+1
In my case the plugin confuses Gateway
with IPAddress
and uses the HostPort
instead of the guest's.
Correcting the resp. config variables solves the issue.
@dommmel I think I am suffering from the same issue. Can you inform me how to correct the resp. config variable(?)? Thanks in advance. :)
@stevenjwolfman I am using ruby 2.0.0 and still have the same problem.. don't even known what triggered this problem.. orz
@stevenjwolfman
in my case my apps DATABASE_URL
was wrong.
(You can inspect that variable via dokku config your_app_name | grep DATABASE_URL
)
It had the form
postgres://root:gibberish_password@172.17.42.1:49153/db
where it should have
postgres://root:gibberish_password@172.17.0.86:5432/db
I got the correct IP and PORT by running docker inpect <postegres_container_id>
and looking for IPAddress
and ExposedPort
.
You can then set the new DATABASE_URL via dokku config:set your_app_name DATABASE_URL=
Hope that helps
@dommmel @stevenjwolfman I solved mine. In my case, it was due to a filter I added to active admin.
In active admin I added a function call requires pg connection, and it caused the app trying to connect to DB while precompiling assets.
Looking for gems that try to connect to DB may help.
@sangyongjung dokku-user-env-compile might help with that as well.
@dommmel Oh, this one is cool, I'll try that later since I just removed the function call that caused the prob. Thanks! :D
@dommmel Thanks, this solved my problem too. I'll send a PR fixing this tomorrow.
Hmm, the ip address doesn't seem to be static though, it changes under certain circumstances (not sure when, but it just changed for me when I did some admin, including a reboot and rebuild of buildstep).
Anyone got any insight into how to make this static?
I can confirm that the environment variable was not set correctly. I had to inspect the postgres container with docker (docker inspect bd27dfdb8b3f
) and then change the config value with dokku.
dokku config:set django-example DATABASE_URL=postgres://root:gibberish@172.17.42.1:49161:/db
dokku version = v0.3.12 ubuntu version = Linux digital-lair 3.13.0-32-generic #57~precise1-Ubuntu SMP Tue Jul 15 03:51:20 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
Same issue here running dokku v0.3.17 on ubuntu 14.04 at Digital Ocean. When using: dokku postgresql:link api api
The generated DATABASE_URL was not correct. It's using the Gateway and not the IPAddress (nor port)
@dommmel solution works fine, you need to update the DATABASE_URL manually.
No matter what I did including setting the ENV file, I couldn't get away from this problem when trying to deploy my app on digital ocean?
I'm trying to install ruby 2.1.1 I started with the premade digital ocean dokku image. I don't know whats causing it and although I saw some reference to this problem in the first comment on https://www.digitalocean.com/community/articles/how-to-use-the-dokku-one-click-digitalocean-image-to-run-a-ruby-on-rails-app I couldn't find a solution to this problem that worked for me