sagemathinc / cocalc-docker

DEPRECATED (was -- Docker setup for running CoCalc as downloadable software on your own computer)
https://cocalc.com
Other
398 stars 103 forks source link

Cannot connect to Postgres on fresh install #134

Closed bearlike closed 1 year ago

bearlike commented 2 years ago

Installed by following the steps listed in the README.md. Here's the log.

psql: error: could not connect to server: No such file or directory,
    Is the server running locally and accepting,
    connections on Unix domain socket "/projects/postgres/data/socket/.s.PGSQL.5432"?,

This bug also seems relevant to #111

belonesox commented 2 years ago

You probably shoud get inside container (replace «cocalcserver» with your container name) docker exec -it cocalcserver bash and look here whatup with postgres

root@d19e787d1d02:/# ps -ef | grep postgres

You should see something like this

root          20       1  0 Oct03 ?        00:00:00 sudo -u sage /usr/lib/postgresql/10/bin/postgres -D /projects/postgres/data
sage          29      20  0 Oct03 ?        00:00:02 /usr/lib/postgresql/10/bin/postgres -D /projects/postgres/data
sage          44      29  0 Oct03 ?        00:00:01 postgres: checkpointer process   
sage          45      29  0 Oct03 ?        00:00:00 postgres: writer process   
sage          46      29  0 Oct03 ?        00:00:09 postgres: wal writer process   
sage          47      29  0 Oct03 ?        00:00:00 postgres: autovacuum launcher process   
sage          48      29  0 Oct03 ?        00:00:02 postgres: stats collector process   
sage          49      29  0 Oct03 ?        00:00:00 postgres: bgworker: logical replication launcher   
sage          97      29  0 Oct03 ?        00:00:17 postgres: smc smc [local] idle
root        3556    3538  0 17:05 pts/4    00:00:00 grep --color=auto postgres

If here OK, then try to look at socket rights (may be something wrong with mapping internal volume to your external folder — absent folder, wrong filesystem on it, etc)

ls -la /projects/postgres/data/socket/

and get something

total 12
drwx------  2 sage sage 4096 Oct  3 23:59 .
drwx------ 20 sage sage 4096 Oct  3 23:59 ..
srwxrwxrwx  1 sage sage    0 Oct  4 16:25 .s.PGSQL.5432
-rw-------  1 sage sage   74 Oct  4 16:25 .s.PGSQL.5432.lock

Of course, version of you OS and docker also can help. (cat /etc/*ele* on host VM).