could not load server certificate file "/var/lib/postgresql/certificate.crt": Permission denied #1391
Replies: 1 comment
-
|
The server cert needs to be readable by the user that the database is running as (which is user and group id It is a bit annoying that the permissions of the server cert are not checked and they just try to read it, but if the permissions are wrong on the private key, then this is the error:
Working scenarios: $ # Works
$ ls -ln
-rw------- 1 999 1000 2297 Jan 6 14:08 cert.crt
-rw------- 1 999 1000 3272 Jan 6 14:08 private.key
drwx------ 19 999 1000 4096 Jan 6 14:58 data
$ docker run ... postgres:14 ...
$ # also works
-rw-r----- 1 1000 999 2297 Jan 6 14:08 cert.crt
-rw------- 1 999 1000 3272 Jan 6 14:08 private.key
drwx------ 19 999 1000 4096 Jan 6 14:58 data
$ docker run ... postgres:14 ...
$ # should also work
-rw-r--r-- 1 0 0 2297 Jan 6 14:08 cert.crt
-rw-r----- 1 0 999 3272 Jan 6 14:08 private.key
drwx------ 19 999 1000 4096 Jan 6 14:58 data
$ docker run ... postgres:14 ...
$ # also works
-rwxrwx--- 1 1000 1000 2297 Jan 6 14:08 cert.crt
-rw------- 1 1000 1000 3272 Jan 6 14:08 private.key
drwx------ 19 1000 1000 4096 Jan 6 14:58 data
$ docker run ... --user 1000:1000 postgres:14 ... |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
i tried use chmod 777,700,600,650, chown postgres:postgres,but neither of them work
Beta Was this translation helpful? Give feedback.
All reactions