There was an error connecting to the database! unable to open database file
Getting error "There was an error connecting to the database! unable to open database file" when try to run crawl
@prochuk Are you running lsio dockerhub diskover ce 2.3.0? Do you have env var DATABASE set to anything?
@shirosaidev Yes, running lsio docker image diskover-web v2.3.0 community edition (ce). Don't have any var related to database, only ES_HOST, ES_PORT and TZ.
@prochuk please post a message in lsio discord container support.
The error is coming from '/app/diskover/diskover_db.py' line 45.
'diskover_db.py' gets the DATABASE parameter from '/app/diskover/config_defaults.py'. Out of the box it is set to:
'DATABASE': '/var/www/diskover-web/diskoverdb.sqlite3'
But it should be:
'DATABASE': '/config/diskoverdb.sqlite3'
Apparently 'diskover_db.py' is not changed by setting env vars. It only works if you change '/app/diskover/config_defaults.py' in the diskover container.
@OpenCV-Peter In line 35 to 39 in diskover_db.py looks for DATABASE env var. In lsio diskover docker container start up, it is not set. Either the config_defaults.py file needs to be changed or DATABASE env var set.
# Get database file path from config defaults
dbfile = conf['DATABASE']
# Check for env var
if os.getenv('DATABASE') is not None:
dbfile = os.getenv('DATABASE')
Hey guys,
Thanks @shirosaidev for the info. I fixed the issue by adding the DATABASE environment variable to my docker compose file. Here's an example:
diskover:
image: lscr.io/linuxserver/diskover
container_name: diskover
hostname: diskover
environment:
PUID: 1000
PGID: 1000
TZ: Europe/Paris
ES_HOST: elasticsearch
ES_PORT: 9200
RUN_ON_START: true
DATABASE: /config/diskoverdb.sqlite3
volumes:
# ...
Hey guys,
Thanks @shirosaidev for the info. I fixed the issue by adding the
DATABASEenvironment variable to my docker compose file. Here's an example:diskover: image: lscr.io/linuxserver/diskover container_name: diskover hostname: diskover environment: PUID: 1000 PGID: 1000 TZ: Europe/Paris ES_HOST: elasticsearch ES_PORT: 9200 RUN_ON_START: true DATABASE: /config/diskoverdb.sqlite3 volumes: # ...
I was having the same issue and can confirm adding the DATABASE env fixed it.