linuxserver / docker-calibre

GNU General Public License v3.0
338 stars 62 forks source link

PermissionError: [Errno 1] Operation not permitted #132

Closed psi4nce closed 1 year ago

psi4nce commented 1 year ago

Is there an existing issue for this?

Current Behavior

When you try to delete a book from the database, Calibre throws an unhandled exception error with the following message:

"PermissionError: [Errno 1] Operation not permitted"

The delete appears to fail and it looks like the book hasn't been deleted, but if the container is restarted, the book will have been deleted from the database

Expected Behavior

The book should be deleted with no error

Steps To Reproduce

  1. Right click on a book and choose Remove Books
  2. Choose Remove Selected Book
  3. Error message

Environment

- OS: Ubuntu 22.04
- How docker service was installed: Via apt through official docker repo

CPU architecture

x86-64

Docker creation

calibre:
    image: lscr.io/linuxserver/calibre:latest
    container_name: calibre
    network_mode: "service:transmission-openvpn"
    depends_on:
      - transmission-openvpn
    security_opt:
      - seccomp:unconfined #optional
    environment:
      - PUID=161
      - PGID=8675309
      - TZ=America/Toronto
      - PASSWORD= #optional
      - CLI_ARGS= #optional
      - TITLE=calibre
    volumes:
      - /docker/config/calibre:/config
      - /media/media/Books:/data/media/books
    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:    161
User GID:    8675309
───────────────────────────────────────

[custom-init] No custom files found, skipping...
_XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created.

Xvnc KasmVNC 1.1.0 - built Apr 26 2023 15:09:13
Copyright (C) 1999-2018 KasmVNC Team and many others (see README.me)
See http://kasmweb.com for information on KasmVNC.
Underlying X server release 12014000, The X.Org Foundation

[ls.io-init] done.
Obt-Message: Xinerama extension is not present on the server
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-abc'
 2023-04-27 22:15:05,244 [INFO] websocket 0: got client connection from 127.0.0.1
 2023-04-27 22:15:05,250 [PRIO] Connections: accepted: @192.168.1.151_1682648105.244532::websocket
calibre 6.17  embedded-python: True
Linux-5.15.0-70-generic-x86_64-with-glibc2.35 Linux ('64bit', 'ELF')
('Linux', '5.15.0-70-generic', '#77-Ubuntu SMP Tue Mar 21 14:02:37 UTC 2023')
Python 3.10.1
Interface language: None
Traceback (most recent call last):
  File "calibre/gui2/actions/delete.py", line 488, in delete_books
  File "calibre/gui2/actions/delete.py", line 459, in do_library_delete
  File "calibre/gui2/library/models.py", line 464, in delete_books_by_id
  File "calibre/db/cache.py", line 85, in call_func_with_lock
  File "calibre/db/cache.py", line 2082, in remove_books
  File "calibre/db/backend.py", line 2148, in remove_books
  File "calibre/db/backend.py", line 2041, in move_book_to_trash
  File "calibre/utils/copy_files.py", line 206, in copy_tree
  File "calibre/utils/copy_files.py", line 46, in copy_all
  File "shutil.py", line 435, in copy2
  File "shutil.py", line 374, in copystat
PermissionError: [Errno 1] Operation not permitted
github-actions[bot] commented 1 year ago

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