roflcoopter / viseron

Self-hosted, local only NVR and AI Computer Vision software. With features such as object detection, motion detection, face recognition and more, it gives you the power to keep an eye on your home, office or any other place you want to monitor.
MIT License
1.5k stars 154 forks source link

Waiting for PostgreSQL Server to start... #748

Closed eldadh closed 1 month ago

eldadh commented 1 month ago

I get the fallowing error in the logs:

Starting PostgreSQL Server... s6-applyuidgid: fatal: unable to exec /usr/lib/postgresql//bin/postgres: No such file or directory /var/run/postgresql:5432 - no response Waiting for PostgreSQL Server to start...

running version 3.0.0b4 on jetson nano 2gb apparently there are two "\" backslashes in the command

the problem was there in the previous version as well b3 eldad

roflcoopter commented 1 month ago

Hmm seems that the postgresql version is not found correctly. If you look furhter up in the logs, do you see a log line that says "PostgreSQL major version"?

eldadh commented 1 month ago

[s6-init] making user provided files available at /var/run/s6/etc...exited 0. [s6-init] ensuring user provided files have correct perms...exited 0. [fix-attrs.d] applying ownership & permissions fixes... [fix-attrs.d] done. [cont-init.d] executing container initialization scripts... [cont-init.d] 10-adduser: executing... **** UID/GID *** User uid: 0 User gid: 0 ** Done ** [cont-init.d] 10-adduser: exited 0. [cont-init.d] 20-gid-video-device: executing... [cont-init.d] 20-gid-video-device: exited 0. [cont-init.d] 30-edgetpu-permission: executing... ** Setting EdgeTPU permissions * Coral Vendor IDs: "1a6e" "18d1" No EdgeTPU USB device was found No EdgeTPU PCI device was found ** Done ** [cont-init.d] 30-edgetpu-permission: exited 0. [cont-init.d] 40-set-env-vars: executing... ** Checking for hardware acceleration platforms ** OpenCL cannot be used VA-API cannot be used CUDA is available! * Done *** [cont-init.d] 40-set-env-vars: exited 0. [cont-init.d] 50-check-if-rpi: executing... ** Checking if we are running on an RPi ** Not running on any supported RPi * Done *** [cont-init.d] 50-check-if-rpi: exited 0. [cont-init.d] 55-check-if-jetson: executing... ** Checking if we are running on a Jetson Board ** Running on a Jetson Nano * Done *** [cont-init.d] 55-check-if-jetson: exited 0. [cont-init.d] 60-ffmpeg-path: executing... ** Getting FFmpeg path * FFmpeg path: /usr/bin/ffmpeg ***** Done ***** [cont-init.d] 60-ffmpeg-path: exited 0. [cont-init.d] 70-gstreamer-path: executing... * Getting GStreamer path * GStreamer path: /usr/bin/gst-launch-1.0 *** Done ***** [cont-init.d] 70-gstreamer-path: exited 0. [cont-init.d] 80-postgres: executing... * Preparing PostgreSQL * Database has not been initialized. Initializing... s6-applyuidgid: fatal: unable to exec /usr/lib/postgresql/12/bin/initdb: No such file or directory Starting PostgreSQL... s6-applyuidgid: fatal: unable to exec /usr/lib/postgresql/12/bin/pg_ctl: No such file or directory psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? Database has not been created. Creating... createdb: could not connect to database template1: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? Stopping PostgreSQL... s6-applyuidgid: fatal: unable to exec /usr/lib/postgresql/12/bin/pg_ctl: No such file or directory ***** Done ***** [cont-init.d] 80-postgres: exited 0. [cont-init.d] done. [services.d] starting services Starting PostgreSQL Server... s6-applyuidgid: fatal: unable to exec /usr/lib/postgresql/12/bin/postgres: No such file or directory [services.d] done. /var/run/postgresql:5432 - no response Waiting for PostgreSQL Server to start...

roflcoopter commented 1 month ago

Fixed in v3.0.0b5, now uses another method of getting the PostgreSQL version which should work on the Nano container as well. Feel free to re-open if it persists

toonsevrin commented 1 month ago
2024-05-22 09:25:36.373 UTC [521] FATAL:  database "viseron" does not exist
[2024-05-22 09:25:36] [ERROR   ] [viseron.components] - Uncaught exception setting up component storage: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: FATAL:  database "viseron" does not exist

Just moved to viseron:3.0.0b6 from b3 and got this.

Edit: same issue on b5, b4

Downgrading to b3:

2024-05-22 09:35:23.518 UTC [634] FATAL:  database files are incompatible with server
2024-05-22 09:35:23.518 UTC [634] DETAIL:  The data directory was initialized by PostgreSQL version 14, which is not compatible with this version 12.18 (Ubuntu 12.18-0ubuntu0.20.04.1).

Edit re-upgraded to b6 to collect the following logs:

2024-05-22 09:41:49.573 UTC [497] LOG:  starting PostgreSQL 14.11 (Ubuntu 14.11-0ubuntu0.22.04.1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, 64-bit
/var/run/postgresql:5432 - no response
2024-05-22 09:41:49.573 UTC [497] LOG:  listening on IPv6 address "::1", port 5432
2024-05-22 09:41:49.573 UTC [497] LOG:  listening on IPv4 address "127.0.0.1", port 5432
Waiting for PostgreSQL Server to start...
2024-05-22 09:41:49.575 UTC [497] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-05-22 09:41:49.578 UTC [499] LOG:  database system was shut down at 2024-05-22 09:41:18 UTC
2024-05-22 09:41:49.581 UTC [497] LOG:  database system is ready to accept connections
2024-05-22 09:41:50.607 UTC [507] FATAL:  database "viseron" does not exist

environment is docker on amd64 running in k3s