ep1cman / unifi-protect-backup

Python tool to backup unifi event clips in realtime
MIT License
633 stars 31 forks source link

Error starting container #90

Closed alex23195 closed 1 year ago

alex23195 commented 1 year ago

Description

Container will not start due to error

What I Did

Restart container and tried new host

docker run \
  -e UFP_USERNAME='MY_USERNAME' \
  -e UFP_PASSWORD='MY_PASSWORD' \
  -e UFP_ADDRESS='UNIFI_IP' \
  -e UFP_SSL_VERIFY='false' \
  -v '/media/sf_BigD/clips':'/data' \
  -v '/media/sf_BigD/database':/config/database/ \
  ghcr.io/ep1cman/unifi-protect-backup

OUTPUT:

2023-05-13 16:09:23 [   ERROR   ] unifi_protect_backup.unifi_protect_backup_core :  Unexpected exception occurred in main loop:
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/unifi_protect_backup/unifi_protect_backup_core.py", line 209, in start
    self._db = await create_database(self._sqlite_path)
  File "/usr/lib/python3.10/site-packages/unifi_protect_backup/unifi_protect_backup_core.py", line 37, in create_database
    db = await aiosqlite.connect(path)
  File "/usr/lib/python3.10/site-packages/aiosqlite/core.py", line 137, in _connect
    self._connection = await future
  File "/usr/lib/python3.10/site-packages/aiosqlite/core.py", line 102, in run
    result = function()
  File "/usr/lib/python3.10/site-packages/aiosqlite/core.py", line 397, in connector
    return sqlite3.connect(loc, **kwargs)
sqlite3.OperationalError: unable to open database file
IgorWolbers commented 1 year ago

Based on the error message in the Exception it seems that the user context that is running the Docker image does not have full permissions to the path /media/sf_BigD/database. Can you check that and add the necessary write permissions? See also https://stackoverflow.com/a/7670618/1260204 for more information on this error message.

ep1cman commented 1 year ago

Closing due to lack of response