Error connecting to database #598
-
All of a sudden, I am no longer able to access the web interface. I believe this occurred after a recent update. I receive the message "Error connecting to database, will try in 3s". After pressing OK it still does not connect and produces the same message "Error connecting to database". Thoughts? Below is the docker compose file I used. version: "3"
services:
pialert:
container_name: pialert
# use the below line if you want to test the latest dev image
# image: "jokobsk/pi.alert_dev:latest"
image: "jokobsk/pi.alert:latest"
network_mode: "host"
restart: unless-stopped
volumes:
- /config/pialert:/home/pi/pialert/config
- /config/pialert/db:/home/pi/pialert/db
# (optional) useful for debugging if you have issues setting up the container
- /config/pialert/logs:/home/pi/pialert/front/log
environment:
- TZ=America/New_York
# - HOST_USER_ID=1000
# - HOST_USER_GID=1000
- PORT=20211 |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 3 replies
-
Hi @vladaurosh, can you suggest what might help to debug this issue? The error is thrown from this PHP file: @seelk07 can you post a screenshot/log of your permissions on the pialert.db file? |
Beta Was this translation helpful? Give feedback.
-
@seelk07
Could you have something like this:
Also can you do ls -al in /config/pialert and /config directories? |
Beta Was this translation helpful? Give feedback.
-
@vladaurosh changing to For reference:
|
Beta Was this translation helpful? Give feedback.
-
Thanks @seelk07 Just as I thought, since your db directory was inside directory that's mapped to config directory, permission were applied to db directory as well.
Here we can see that these 2 directories (db and logs) do not have x bit set, so app can't actually read anything inside. @jokob-sk that's being set here, second command that applies 640 to everything in ${INSTALL_DIR}/pialert/config:
and since in above example db directory was inside config directory, it was set to 640. Maybe we update documentation with recommendation to have separate db and config directories. In the meantime I'll create PR so we apply 750 to directories only and 640 to files only. |
Beta Was this translation helpful? Give feedback.
-
@jokob-sk and @vladaurosh thank you for your help! |
Beta Was this translation helpful? Give feedback.
-
@vladaurosh I'm now noticing all my devices are showing Down & Offline. Thoughts? |
Beta Was this translation helpful? Give feedback.
@seelk07
I see db directory is inside directory that's mapped to /home/pi/pialert/config
Could you have something like this:
Also can you do ls -al in /config/pialert and /config directories?