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

[BUG] sqlite3.OperationalError: unable to open database file #272

Closed
1 task done
MarGer1962 opened this issue Sep 30, 2023 · 21 comments
Closed
1 task done

[BUG] sqlite3.OperationalError: unable to open database file #272

MarGer1962 opened this issue Sep 30, 2023 · 21 comments
Labels

Comments

@MarGer1962
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I used the taskmanager on my Nas Synology with this task

docker run -d --name=calibre-web
-p 8083:8083
-e PUID=1024
-e PGID=100
-e TZ=Europe/Amsterdam
-e DOCKER_MODS=linuxserver/mods:universal-calibre
-e OAUTHLIB_RELAX_TOKEN_SCOPE=1
-v /volume1/docker/calibreweb:/config
-v /volume1/Ebooks:/books
--restart always
ghcr.io/linuxserver/calibre-web
(following the instuctions on https://mariushosting.com/how-to-install-calibre-web-on-your-synology-nas/)

Calibre web was installed
It is adjusted as a container (linuxserver/calibre-web) in Docker

I was not able to open Calibre-web in my browser.
When i checked the logfile, i found this

===== begin
sqlite3.OperationalError: unable to open database file
====== end > see Container Logs

Expected Behavior

I would expect that calibre-web was functioning when opening the app in my browser

Steps To Reproduce

NAS Synology DS716+
NAS / DSM 7.11 - 42962 Update 6
Python: installed 3.9
Docker

make a Task in the Taskmanager
use this code

docker run -d --name=calibre-web
-p 8083:8083
-e PUID=1024
-e PGID=100
-e TZ=Europe/Amsterdam
-e DOCKER_MODS=linuxserver/mods:universal-calibre
-e OAUTHLIB_RELAX_TOKEN_SCOPE=1
-v /volume1/docker/calibreweb:/config
-v /volume1/Ebooks:/books
--restart always
ghcr.io/linuxserver/calibre-web

run the task
Calibre -web is installed
check settings > OK
check log > fault

Environment

- OS:
- How docker service was installed:

CPU architecture

x86-64

Docker creation

docker run -d --name=calibre-web \
-p 8083:8083 \
-e PUID=1024 \
-e PGID=100 \
-e TZ=Europe/Amsterdam \
-e DOCKER_MODS=linuxserver/mods:universal-calibre \
-e OAUTHLIB_RELAX_TOKEN_SCOPE=1 \
-v /volume1/docker/calibreweb:/config \
-v /volume1/Ebooks:/books \
--restart always \
ghcr.io/linuxserver/calibre-web

Container logs

sqlite3.OperationalError: unable to open database file

The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/app/calibre-web/cps.py", line 31, in <module>
    main()
  File "/app/calibre-web/cps/main.py", line 31, in main
    app = create_app()
  File "/app/calibre-web/cps/__init__.py", line 115, in create_app
    ub.init_db(cli_param.settings_path)
  File "/app/calibre-web/cps/ub.py", line 838, in init_db
    Base.metadata.create_all(engine)
  File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/sql/schema.py", line 4930, in create_all
    bind._run_ddl_visitor(
  File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/base.py", line 3237, in _run_ddl_visitor
    with self.begin() as conn:
  File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/base.py", line 3153, in begin
    conn = self.connect(close_with_result=close_with_result)
  File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/base.py", line 3325, in connect
    return self._connection_cls(self, close_with_result=close_with_result)
  File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/base.py", line 96, in __init__
    else engine.raw_connection()
  File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/base.py", line 3404, in raw_connection
    return self._wrap_pool_connect(self.pool.connect, _connection)
  File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/base.py", line 3374, in _wrap_pool_connect
@github-actions
Copy link

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

@MarGer1962
Copy link
Author

SettingsCalibre00a
SettingsCalibre03
SettingsCalibre00
SettingsCalibre02
SettingsCalibre01

@LinuxServer-CI LinuxServer-CI moved this from Issues to Done in Issue & PR Tracker Sep 30, 2023
@MarGer1962 MarGer1962 reopened this Oct 1, 2023
@LinuxServer-CI LinuxServer-CI moved this from Done to Issues in Issue & PR Tracker Oct 1, 2023
@drizuid
Copy link
Member

drizuid commented Oct 18, 2023

you need a database, as it tells you in the error
it also says this in our container readme and in the official documntation

@MarGer1962
Copy link
Author

@drizuid : Thanks for your reply.
I have a calibre db (metadata.db) on my local PC (D:\00.CalibreBieb)
I have this question(s):

is this the database you refer to in your answer?
how can i put the calibre db (metadata.db) on my NAS Synology? Can i just use Filemanager (copy/paste)?
in which directory do i have to put the calibre db (metadata.db)?

Hopefully you can help me out

The reason for my questions: before i updated CalibreWeb everything was working fine.
After updating it was not possible to connect to CalibreWeb.
I did not (and do not) understand why that is.
I thought the best solution was to remove all the books/the database and the container and make a fresh installation.

@drizuid
Copy link
Member

drizuid commented Oct 18, 2023

It would be best for you to come into discord for support, your logs do not indicate a bug and we can more appropriately help you there.

As a note, WHERE the database should be is covered in the readme. Yes, metadata.db is the typical name, assuming it's a legitimate calibre database.

I have no other info for Synology as I don't use it. We have users on discord.

@ariael
Copy link

ariael commented Oct 28, 2023

Hi,
I have same issue.
Maybe 50 different installation (Synology). And only 2 successful started web. Both runed only short time, first until restart docker and second live about 30 minute, until i try view book - web freeze and never start again...

I was try every combination with preinstalled books (and db), without books, different ports, different folders, privileges, different method of installation...
Sorry, i don't known how i should continue to...
Can you help me please?

i use mostly this YAML:

version: "2.1"
services:
calibre-web:
image: lscr.io/linuxserver/calibre-web:latest
container_name: calibre-web
environment:
- PUID=1026
- PGID=100
- TZ=Europe/Prague
- DOCKER_MODS=linuxserver/mods:universal-calibre # optional
- OAUTHLIB_RELAX_TOKEN_SCOPE=1 # optional
volumes:
- /volume1/docker/calibreweb:/config
- /volume1/docker/calibreweb/books:/books
ports:
- 9999:9999
restart: unless-stopped

I also have a CLI version for an older setup type. But same result.

@drizuid
Copy link
Member

drizuid commented Oct 28, 2023

@ariael your ports are wrong, is your syno x86_64? we only support docker-compose or docker from the cli, not the synology ui to create/deploy containers, is that how you are using it? fix your port and see if it works.

for all syno users here : https://info.linuxserver.io/issues/2023-05-22-portainer/

@ariael
Copy link

ariael commented Oct 28, 2023

Hi. This is Intel Celeron CPU...

Port - well that's just the latest version of the experiment. From the default ones up to here, to exclude the possibility of some port occupation by another process or something strange in docker... The standard port doesn't work either, of course. And the portainer I use, CLI or directly Container Manager - they all behave the same. Docker is running, you can look inside, the directory with books is available, the database is visible, the web is dead.

@ariael
Copy link

ariael commented Oct 28, 2023

image

@ariael
Copy link

ariael commented Oct 28, 2023

image

@ariael
Copy link

ariael commented Oct 28, 2023

image

@ariael
Copy link

ariael commented Oct 28, 2023

Same with redeploy to 8083

@ariael
Copy link

ariael commented Oct 28, 2023

And first setup i follow https://mariushosting.com/how-to-install-calibre-web-on-your-synology-nas/

docker run -d --name=calibre-web
-p 8083:8083
-e PUID=1026
-e PGID=100
-e TZ=Europe/Bucharest
-e DOCKER_MODS=linuxserver/mods:universal-calibre
-e OAUTHLIB_RELAX_TOKEN_SCOPE=1
-v /volume1/docker/calibreweb:/config
-v /volume1/web/books:/books
--restart always
ghcr.io/linuxserver/calibre-web

@thespad
Copy link
Member

thespad commented Oct 28, 2023

ports:
- 9999:9999

Will never work, regardless of what else you configure. Calibre-web runs on port 8083.

@ariael
Copy link

ariael commented Oct 28, 2023

Oki,
I stop portainer (any interference), delete all old directory, create new, one, change port in YAML file to 8083 and use Docker Compose to build new image...
image

image image image

@thespad
Copy link
Member

thespad commented Oct 28, 2023

Please provide your container logs.

But also don't do this

volumes:
- /volume1/docker/calibreweb:/config
- /volume1/docker/calibreweb/books:/books

You're making your /books directory a subfolder of your /config directory as well as mounting it to /books - sooner or later things are going to go wrong with that setup.

@drizuid
Copy link
Member

drizuid commented Oct 28, 2023

also note that you say you're using compose but you keep showing us stuff from container station. we only want to see docker logs -f calibre-web and your docker compose. if you are using container station or portainer to deploy the container, it will not work. Note that putting your docker compose in VIA container station is not something we support.

at this point, i think it would be best for you to come on discord for support this does not seem like a container issue.

@LinuxServer-CI LinuxServer-CI moved this from Issues to Insufficient Info in Issue & PR Tracker Oct 28, 2023
@github-actions
Copy link

A human has marked this issue as invalid, this likely happened because the issue template was not used in the creation of the issue.

@MarGer1962
Copy link
Author

@thespad Adam
Hi you wrote "But also don't do this
volumes:

  • /volume1/docker/calibreweb:/config
  • /volume1/docker/calibreweb/books:/books

You're making your /books directory a subfolder of your /config directory as well as mounting it to /books - sooner or later things are going to go wrong with that setup."
I suppose that is a reaction to Aerieal who place a post with these lines
"-v /volume1/docker/calibreweb:/config
-v /volume1/web/books:/books "

I'm interested in what information do i have to put in these lines?
Should it be - if i place my ebooks in the directory /volume1/Ebooks
"-v /volume1/docker/calibreweb:/calibreweb
-v /volume1/Ebooks:/books"

Or should i place all of my ebooks in the directory /volume1/docker/calibreweb/Ebooks?
So then these lines should be:
"-v /volume1/docker/calibreweb:/calibreweb
-v /volume1/docker/calibreweb/Ebooks:/books"

@thespad
Copy link
Member

thespad commented Oct 29, 2023

You should always keep any given mount separate from any others. So either something like:

- /app/foo/config:/config
- /app/foo/data:/data

or

- /app/foo:/config
- /mnt/foo:/data

but never

- /app/foo:/config
- /app/foo/data:/data

@drizuid
Copy link
Member

drizuid commented Oct 29, 2023

as ariael has moved to discord as requested, and this is not a container problem but a host problem, i will lock this thread. best effort help is available on discord.

@drizuid drizuid closed this as not planned Won't fix, can't repro, duplicate, stale Oct 29, 2023
@linuxserver linuxserver locked as resolved and limited conversation to collaborators Oct 29, 2023
@LinuxServer-CI LinuxServer-CI moved this from Insufficient Info to Done in Issue & PR Tracker Oct 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
Archived in project
Development

No branches or pull requests

4 participants