Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There was an error connecting to the database! unable to open database file #114

Open
prochuk opened this issue Aug 19, 2024 · 7 comments
Open

Comments

@prochuk
Copy link

prochuk commented Aug 19, 2024

Getting error "There was an error connecting to the database! unable to open database file" when try to run crawl

@shirosaidev
Copy link
Collaborator

shirosaidev commented Aug 20, 2024

@prochuk Are you running lsio dockerhub diskover ce 2.3.0?
Do you have env var DATABASE set to anything?

@prochuk
Copy link
Author

prochuk commented Aug 21, 2024

@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.

@shirosaidev
Copy link
Collaborator

@prochuk please post a message in lsio discord container support.

@OpenCV-Peter
Copy link

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.

@shirosaidev
Copy link
Collaborator

shirosaidev commented Aug 26, 2024

@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')

@ts-sz
Copy link

ts-sz commented Aug 29, 2024

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:
    # ...

@felipemeres
Copy link

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:
    # ...

I was having the same issue and can confirm adding the DATABASE env fixed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants