dokku-postgresql-plugin icon indicating copy to clipboard operation
dokku-postgresql-plugin copied to clipboard

Create permission/auth issue

Open ericmillsio opened this issue 11 years ago • 12 comments

When I create a db:

dokku postgresql:create my_db

I get this error:

could not change directory to "/root": Permission denied
psql: FATAL:  password authentication failed for user "my_db"
FATAL:  password authentication failed for user "my_db"

I did have dokku-pg-plugin prior to this, but I wanted the console function. This may be the issue when I switched over, but I did remove the old .postgresql folder and containers/images.

ericmillsio avatar May 07 '14 19:05 ericmillsio

are you running this as root or as a user? You need to be root.

jeffutter avatar May 21 '14 18:05 jeffutter

This problem seems to occur as root:

root@ow-dokku:~# dokku postgresql:create hellodjango
could not change directory to "/root": Permission denied
psql: FATAL:  password authentication failed for user "root"
FATAL:  password authentication failed for user "root"
could not change directory to "/root": Permission denied
psql: FATAL:  password authentication failed for user "root"
FATAL:  password authentication failed for user "root"
could not change directory to "/root": Permission denied
psql: FATAL:  password authentication failed for user "root"
FATAL:  password authentication failed for user "root"
-----> Creating /home/dokku/hellodjango/ENV
-----> Setting config vars and restarting hellodjango
DATABASE_URL: postgres://hellodjango:[email protected]:5432/hellodjango_production
-----> Releasing hellodjango ...
-----> Release complete!
-----> Deploying hellodjango ...
-----> Deploy complete!

kevwilde avatar May 23 '14 23:05 kevwilde

That doesn't sound good. This may be a silly question but, can you do ls /root/ ?

jeffutter avatar May 25 '14 03:05 jeffutter

In the meantime I have succeeded in debugging what caused the issue. On my end, it was because during the installation, the docker at the following line run failed to execute:

https://github.com/jeffutter/dokku-postgresql-plugin/blob/master/install#L24

This meant that everything seemed correctly installed and configured, but in fact the database had not yet received its authentication information for the root user.

HTH.

Kevin

kevwilde avatar May 25 '14 04:05 kevwilde

What host operating system are you using?

jeffutter avatar May 25 '14 13:05 jeffutter

And does /home/dokku/.postgresql/admin_pw exist and does it have any contents?

jeffutter avatar May 25 '14 13:05 jeffutter

I was running the dokku image on digitalocean. admin_pw existed, but the "docker run" at the end had not run (due to insufficient memory) and thus the database was not configured with the information in admin_pw.

kevwilde avatar May 25 '14 14:05 kevwilde

I have since started fresh, but I saved the image. I was also on a $5 digitalocean box. The problem occurred for me as root and non-root.

ericmillsio avatar May 25 '14 21:05 ericmillsio

Yeah just had this same problem on digitalocean. You need at least 1Gb of Ram to install this plugin.

Xatter avatar Jul 03 '14 19:07 Xatter

Same problem here - using a Digital Ocean 512MB machine and ran out of memory. Starting over with a bigger rig ..

UPDATE: Worked fine on a 1GB

yazinsai avatar Aug 02 '14 19:08 yazinsai

I am getting the same issue but the other way round and im on a 2GB droplet:

$ sudo dokku postgis:link app app -----> Setting config vars and restarting app DATABASE_URL: postgis://root:[password]@172.17.42.1:49182/db -----> Releasing app... -----> Release complete! -----> Deploying app... -----> Checking status of PostGIS Found image postgis/app database Checking status... ok. -----> Deploy complete! Password: [password] PORT: 49182 psql: FATAL: password authentication failed for user "root" FATAL: password authentication failed for user "root" psql: FATAL: password authentication failed for user "root" FATAL: password authentication failed for user "root" psql: FATAL: password authentication failed for user "root" FATAL: password authentication failed for user "root" psql: FATAL: password authentication failed for user "root" FATAL: password authentication failed for user "root"

I have no idea what is going on its like my database has gone...

jamescw avatar Aug 20 '14 20:08 jamescw

If you are running out of memory on a 512MB droplet, one thing you might want to try is adding a swap file. https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04 Note: This might effect your performance badly. YMMV.

TMaYaD avatar Aug 22 '14 07:08 TMaYaD