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

Cannot upload #146

Closed
mizzunet opened this issue Jun 11, 2021 · 7 comments
Closed

Cannot upload #146

mizzunet opened this issue Jun 11, 2021 · 7 comments

Comments

@mizzunet
Copy link

mizzunet commented Jun 11, 2021

linuxserver.io


Cannot upload files it returns error related to database permission

Expected Behavior

Upload file

Current Behavior

Displays this
Database error: (sqlite3.OperationalError) attempt to write a readonly database [SQL: INSERT INTO authors (name, sort, link) VALUES (?, ?, ?)] [parameters: ('Morgan Housel', 'Housel, Morgan', '')] (Background on this error at: http://sqlalche.me/e/14/e3q8).

Steps to Reproduce

  1. Start docker container
  2. Copy blank metadata.db that just exported from Calibre to /books
  3. Open Web UI
  4. Choose database dir as /books
  5. Enable upload from settings and try to upload an ebook

Environment

OS: Ubunyu
CPU architecture: x86_64/
How docker service was installed: Docker Compose, official

Command used to create docker container (run/create/compose/screenshot)

compose

Docker logs

http://transfer.sh/1GBG71V/log.txt

@github-actions
Copy link

Thanks for opening your first issue here! Be sure to follow the bug or feature issue templates!

@jansendotsh
Copy link

Getting the same error. Looks like a permissions error but I can't spot anything that's set incorrectly for the container (SELinux disabled, container tested as root, permissions set to 755, etc.). Happy to help contribute any troubleshooting or assistance I can with a little bit of a thread to pull. :)

@utimukat55
Copy link

Faced same error. In containers, process worked as general user(calibre?), the directory which contains metadata.db must be writable with general user.

chmod a+w /path/to/calibre/library

@jansendotsh
Copy link

Faced same error. In containers, process worked as general user(calibre?), the directory which contains metadata.db must be writable with general user.

chmod a+w /path/to/calibre/library

Rather than this, you should fix the UID/GID (https://github.com/linuxserver/docker-calibre-web/#user--group-identifiers). That did the trick for me.

@utimukat55
Copy link

utimukat55 commented Jun 22, 2021

Modified to bold all placeholders.↓

In strict saying, it's not correct. I'm using docker/docker-compose command in root user. My docker-compose.yaml sets UID & GID same as sample docker-compose.yml. Already applied.

This issue caused by 2 phenomenona. docker-calibre-web makes /path/to/calibre/library which owned by docker(-compose) user when directory didn't exist and docker-calibre-web never make metadata.db itself in /path/to/calibre/library.

First, when docker(-compose) executed by not PUID=1000 and PGID=1000 user, /path/to/calibre/library can't controlled by docker-calibre-web. On the other hand, /path/to/data 's owner is overwritten with PUID=1000 and PGID=1000 user after made directory owned by docker executed user.

Second, at the first boot, docker-calibre-web indicates Basic Configuration. After input "/books" and press "Save", error message "DB Location is not Valid, Press Enter Correct Path" displayed because there is no /path/to/calibre/library/ metadata.db.

#30 (comment)

Operator puts metadata.db to /path/to/calibre/library/ manually, next faces this issue. In fact, incorrect permission of /path/to/calibre/library or metadata.db occurs error message "DB is not Writable" but it can ignore and can move to login screen.

There are two solutions.

  • Modify /path/to/calibre/library/ and /path/to/calibre/library/ metadata.db 's permissons to all user writable(I wrote before)
  • Modify /path/to/calibre/library/ and /path/to/calibre/library/ metadata.db 's owner to PUID=1000 and PGID=1000 user(written in docker-compose.yml)

Sorry for my poor English. I hope to tell what I want to say.

@tobbenb
Copy link
Member

tobbenb commented Jun 22, 2021

1000 is not a fixed id, you change it to fit the user that owns the host folders you map. You also don't use /path/to/data, that is just placeholder that you need to exchange for your path on the host.

@mizzunet
Copy link
Author

Thanks

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

4 participants