dokku-postgresql-plugin
dokku-postgresql-plugin copied to clipboard
Create permission/auth issue
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.
are you running this as root or as a user? You need to be root.
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!
That doesn't sound good. This may be a silly question but, can you do ls /root/ ?
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
What host operating system are you using?
And does /home/dokku/.postgresql/admin_pw exist and does it have any contents?
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.
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.
Yeah just had this same problem on digitalocean. You need at least 1Gb of Ram to install this plugin.
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
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...
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.