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

[500 internal server error] Calibre-web stopped working #291

Closed
1 task done
wiebereu opened this issue Mar 13, 2024 · 9 comments
Closed
1 task done

[500 internal server error] Calibre-web stopped working #291

wiebereu opened this issue Mar 13, 2024 · 9 comments

Comments

@wiebereu
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Suddenly tha application stopped working.
I am running Calibre-web in a docker container on my Synology NAS.
It was running fine until recently. I did not change anything.
i got a 500 internal server error message. I deleted the container and all config files of the app and install it again but he error stays.

Here under is the error message

Traceback (most recent call last):
File "/lsiopy/lib/python3.10/site-packages/flask/app.py", line 2190, in wsgi_app
response = self.full_dispatch_request()
File "/lsiopy/lib/python3.10/site-packages/flask/app.py", line 1486, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/lsiopy/lib/python3.10/site-packages/flask/app.py", line 1484, in full_dispatch_request
rv = self.dispatch_request()
File "/lsiopy/lib/python3.10/site-packages/flask/app.py", line 1469, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "/app/calibre-web/cps/usermanagement.py", line 35, in decorated_view
return login_required(func)(*args, **kwargs)
File "/lsiopy/lib/python3.10/site-packages/flask_login/utils.py", line 290, in decorated_view
return current_app.ensure_sync(func)(*args, **kwargs)
File "/app/calibre-web/cps/web.py", line 790, in index
return render_books_list("newest", sort_param, 1, page)
File "/app/calibre-web/cps/web.py", line 408, in render_books_list
entries, random, pagination = calibre_db.fill_indexpage(page, 0, db.Books, True, order[0],
File "/app/calibre-web/cps/db.py", line 803, in fill_indexpage
return self.fill_indexpage_with_archived_books(page, database, pagesize, db_filter, order, False,
File "/app/calibre-web/cps/db.py", line 810, in fill_indexpage_with_archived_books
random_query = self.generate_linked_query(config_read_column, database)
File "/app/calibre-web/cps/db.py", line 764, in generate_linked_query
query = (self.session.query(database, ub.ArchivedBook.is_archived, ub.ReadBook.read_status)
AttributeError: 'NoneType' object has no attribute 'query'

Expected Behavior

See my comments above

Steps To Reproduce

See the steps above

Environment

- OS:Synology DSM 7X
- How docker service was installed:

---
services:
  calibre-web:
    image: lscr.io/linuxserver/calibre-web:latest
    container_name: calibre-web
    environment:
      - PUID=100 # default user id, defined in .env
      - PGID=100 # default group id, defined in .env
      - TZ=my location # timezone, defined in .env
      - UMASK_SET=XXX #optional
      - DOCKER_MODS=linuxserver/mods:universal-calibre #optional
      - OAUTHLIB_RELAX_TOKEN_SCOPE=1 #optional
    volumes:
      - /volume1/docker/calibre-web/config:/config
      - /volume2/library:/books
    ports:
      - 8083:8083
    restart: unless-stopped

CPU architecture

x86-64

Docker creation

Portainer

Container logs

Setting up libxfixes3:amd64 (1:6.0.0-1) ...
Setting up libxcb-sync1:amd64 (1.14-3ubuntu3) ...
Setting up xz-utils (5.2.5-2ubuntu1) ...
update-alternatives: using /usr/bin/xz to provide /usr/bin/lzma (lzma) in auto mode
update-alternatives: warning: skip creation of /usr/share/man/man1/lzma.1.gz because associated file /usr/share/man/man1/xz.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/unlzma.1.gz because associated file /usr/share/man/man1/unxz.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzcat.1.gz because associated file /usr/share/man/man1/xzcat.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzmore.1.gz because associated file /usr/share/man/man1/xzmore.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzless.1.gz because associated file /usr/share/man/man1/xzless.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzdiff.1.gz because associated file /usr/share/man/man1/xzdiff.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzcmp.1.gz because associated file /usr/share/man/man1/xzcmp.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzgrep.1.gz because associated file /usr/share/man/man1/xzgrep.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzegrep.1.gz because associated file /usr/share/man/man1/xzegrep.1.gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzfgrep.1.gz because associated file /usr/share/man/man1/xzfgrep.1.gz (of link group lzma) doesn't exist
Setting up libxrandr2:amd64 (2:1.5.2-1build1) ...
Setting up libsensors5:amd64 (1:3.6.0-7ubuntu1) ...
Setting up libglapi-mesa:amd64 (23.2.1-1ubuntu3.1~22.04.2) ...
Setting up libxcb-dri2-0:amd64 (1.14-3ubuntu3) ...
Setting up libxshmfence1:amd64 (1.3-1build4) ...
Setting up libxcb-randr0:amd64 (1.14-3ubuntu3) ...
Setting up libllvm15:amd64 (1:15.0.7-0ubuntu0.22.04.3) ...
Setting up libxkbfile1:amd64 (1:1.1.0-1build3) ...
Setting up libdrm-common (2.4.113-2~ubuntu0.22.04.1) ...
Setting up libelf1:amd64 (0.186-1build1) ...
Setting up libxcomposite1:amd64 (1:0.4.5-1build2) ...
Setting up libxkbcommon0:amd64 (1.4.0-1) ...
Setting up libwayland-client0:amd64 (1.20.0-1ubuntu0.1) ...
Setting up libxtst6:amd64 (2:1.2.3-1build4) ...
Setting up libnss3:amd64 (2:3.68.2-0ubuntu1.2) ...
Setting up libdrm2:amd64 (2.4.113-2~ubuntu0.22.04.1) ...
Setting up libdrm-amdgpu1:amd64 (2.4.113-2~ubuntu0.22.04.1) ...
Setting up libdrm-nouveau2:amd64 (2.4.113-2~ubuntu0.22.04.1) ...
Setting up libgbm1:amd64 (23.2.1-1ubuntu3.1~22.04.2) ...
Setting up libdrm-radeon1:amd64 (2.4.113-2~ubuntu0.22.04.1) ...
Setting up libdrm-intel1:amd64 (2.4.113-2~ubuntu0.22.04.1) ...
Setting up libgl1-mesa-dri:amd64 (23.2.1-1ubuntu3.1~22.04.2) ...
Setting up libegl-mesa0:amd64 (23.2.1-1ubuntu3.1~22.04.2) ...
Setting up libegl1:amd64 (1.4.0-1) ...
Setting up libglx-mesa0:amd64 (23.2.1-1ubuntu3.1~22.04.2) ...
Setting up libglx0:amd64 (1.4.0-1) ...
Setting up libgl1:amd64 (1.4.0-1) ...
Setting up libgl1-mesa-glx:amd64 (23.0.4-0ubuntu1~22.04.1) ...
Processing triggers for libc-bin (2.35-0ubuntu3.1) ...
**** Installing/updating calibre ****
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0

  0  139M    0  5679    0     0   6246      0  6:30:37 --:--:--  6:30:37  6246
 28  139M   28 39.6M    0     0  23.0M      0  0:00:06  0:00:01  0:00:05 48.6M
 74  139M   74  104M    0     0  38.1M      0  0:00:03  0:00:02  0:00:01 57.2M
100  139M  100  139M    0     0  42.5M      0  0:00:03  0:00:03 --:--:-- 58.9M
Creating symlinks...
	Symlinking /app/calibre/ebook-device to /usr/bin/ebook-device
	Symlinking /app/calibre/ebook-meta to /usr/bin/ebook-meta
	Symlinking /app/calibre/ebook-convert to /usr/bin/ebook-convert
	Symlinking /app/calibre/ebook-polish to /usr/bin/ebook-polish
	Symlinking /app/calibre/markdown-calibre to /usr/bin/markdown-calibre
	Symlinking /app/calibre/web2disk to /usr/bin/web2disk
	Symlinking /app/calibre/calibre-server to /usr/bin/calibre-server
	Symlinking /app/calibre/lrf2lrs to /usr/bin/lrf2lrs
	Symlinking /app/calibre/lrs2lrf to /usr/bin/lrs2lrf
	Symlinking /app/calibre/calibre-debug to /usr/bin/calibre-debug
	Symlinking /app/calibre/calibredb to /usr/bin/calibredb
	Symlinking /app/calibre/calibre-parallel to /usr/bin/calibre-parallel
	Symlinking /app/calibre/calibre-customize to /usr/bin/calibre-customize
	Symlinking /app/calibre/fetch-ebook-metadata to /usr/bin/fetch-ebook-metadata
	Symlinking /app/calibre/calibre-smtp to /usr/bin/calibre-smtp
	Symlinking /app/calibre/calibre to /usr/bin/calibre
	Symlinking /app/calibre/lrfviewer to /usr/bin/lrfviewer
	Symlinking /app/calibre/ebook-viewer to /usr/bin/ebook-viewer
	Symlinking /app/calibre/ebook-edit to /usr/bin/ebook-edit
Setting up command-line completion...
Installing zsh completion to: /usr/share/zsh/vendor-completions/_calibre
Failed to find directory to install bash completions, using default.
Installing bash completion to: /usr/share/bash-completion/completions/
Setting up desktop integration...
____________________ WARNING ____________________
Setting up desktop integration failed with error:
__________________________________________________
	Traceback (most recent call last):
	  File "calibre/linux.py", line 858, in setup_desktop_integration
	  File "calibre/linux.py", line 880, in do_setup_desktop_integration
	  File "calibre/linux.py", line 911, in install_xdg_junk
	  File "calibre/linux.py", line 896, in install_icons
	  File "calibre/linux.py", line 890, in install_single_icon
	  File "subprocess.py", line 408, in check_call
	  File "subprocess.py", line 389, in call
	  File "subprocess.py", line 1026, in __init__
	  File "subprocess.py", line 1950, in _execute_child
	FileNotFoundError: [Errno 2] No such file or directory: 'xdg-icon-resource'
Creating un-installer: /usr/bin/calibre-uninstall
There were 1 warnings
* Setting up desktop integration failed with error:
[custom-init] No custom files found, skipping...
[ls.io-init] done.
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.

@abhilesh
Copy link

This issue seems to be related to not being able to read metadata.db file from the existing installation. When I replace the older metadata.db file with an empty db file, the instance loads up fine.

My environment and configuration -

Platform - arm64
OS - Docker version 25.0.3, build 4debf41 running through OrbStack v1.4.3 on MacOS

Deployed via docker compose - 
version: "2.1"
services:
  calibre-web:
    image: lscr.io/linuxserver/calibre-web:latest
    container_name: calibre-web
    environment:
      - PUID=501
      - PGID=20
      - TZ=Europe/London
      # I had some issues with Google's OAuth login and hence added the following two lines
      #- OAUTHLIB_RELAX_TOKEN_SCOPE=1
      #- OAUTHLIB_INSECURE_TRANSPORT=1
    volumes:
      - ./config:/config                                     # Config directory (`app.db` is stored here)
      #- ./gmail.json:/app/calibre-web/gmail.json
      - /Volumes/PiStorage12/eBook_library:/books            # Data directory (All ebooks are stored here)
    ports:
      - 8083:8083
    restart: unless-stopped

Container logs

[migrations] started
[migrations] no migrations found
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    501
User GID:    20
───────────────────────────────────────

[custom-init] No custom files found, skipping...
[ls.io-init] done.

@LinuxServer-CI
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

@fauxvo
Copy link

fauxvo commented Apr 17, 2024

I also have these same errors in my console and it only started when adding
- DOCKER_MODS=linuxserver/mods:universal-calibre #optional to the environment variables.
-- also hence why @abhilesh didn't have a problem since that environment variable wasn't in that config

For some reason, something with the mod is failing

@aptalca
Copy link
Member

aptalca commented Apr 17, 2024

For some reason, something with the mod is failing

Please elaborate.

The log messages do not indicate failing of any necessary function. Calibre fails to set up desktop integration (adding icons to desktop and such) because there is no desktop here as this container image is headless. It's a harmless error and fully expected.

There are plenty of prior issues about it where we made that clear.

@LinuxServer-CI
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

@drizuid
Copy link
Member

drizuid commented Jun 2, 2024

no further replies, OP indicates the fault was with their database.

@drizuid drizuid closed this as not planned Won't fix, can't repro, duplicate, stale Jun 2, 2024
@abhilesh
Copy link

abhilesh commented Jun 3, 2024

I must add that the database seems to corrupt everytime I pull the latest docker image. The database needs to be rebuilt after every upgrade, so this doesn't pertain to a single database corruption event.

@drizuid
Copy link
Member

drizuid commented Jun 3, 2024

I must add that the database seems to corrupt everytime I pull the latest docker image. The database needs to be rebuilt after every upgrade, so this doesn't pertain to a single database corruption event.

You're not the OP, i have no clue on your issue. I've used the same database in this container for 6+ years and havent once had an issue.

@linuxserver linuxserver locked as resolved and limited conversation to collaborators Jun 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Archived in project
Development

No branches or pull requests

6 participants