-
Notifications
You must be signed in to change notification settings - Fork 104
Description
Bug Description
After a file is downloaded to /tmp/ folder it is then moved with "os.rename(src, real_dst)" to "/cwa-book-ingest/BOOKNAME.crdownload" mount, which fails.
Environment Information
- BASE OS: Hexos (Truenas scale)
docker-compose
services:
calibre-web-automated-book-downloader:
container_name: calibre-web-automated-book-downloader
environment:
APP_ENV: prod
BOOK_LANGUAGE: en
CWA_DB_PATH: /auth/app.db
DOWNLOAD_PROGRESS_UPDATE_INTERVAL: 5
FLASK_PORT: 8084
GID: 100
LOG_LEVEL: info
MAX_CONCURRENT_DOWNLOADS: 8
TZ: Europe/Stockholm
UID: 1000
USE_BOOK_TITLE: True
image: ghcr.io/calibrain/calibre-web-automated-book-downloader:latest
ports:
- '8084:8084'
restart: unless-stopped
volumes:
- /mnt/HDDs/Media/ebookingest:/cwa-book-ingest
- /mnt/HDDs/Applications/calibrewebautomated/config/app.db:/auth/app.db:ro
Additional Context
It works if I manually mount tmp folder to the ingest folder but import is not completed succesfully according to calibre-web-automated-book-downloader terminal. It is added to Calibre web but the .crdownload file remains in ingest folder unprocessed. All folders have correct chown.
LOGS:
backend - ERROR - logger.py:16 - Error downloading book: [Errno 1] Operation not permitted: '/cwa-book-ingest/8922d19e85444bbb7b0adfb7153dc0fa.crdownload'
.574234+00:00Traceback (most recent call last):
.574241+00:00File "/usr/local/lib/python3.10/shutil.py", line 816, in move
.574245+00:00os.rename(src, real_dst)
.574250+00:00OSError: [Errno 18] Invalid cross-device link: '/tmp/cwa-book-downloader/Harry Potter and the Chamber of Secrets.epub' -> '/cwa-book-ingest/8922d19e85444bbb7b0adfb7153dc0fa.crdownload'
.574265+00:002025-08-29T17:38.574265462Z
.574287+00:00During handling of the above exception, another exception occurred:
.574292+00:002025-08-29T17:38.574292634Z
.574297+00:00Traceback (most recent call last):
.574314+00:002025-08-29 19:38,574 - backend - INFO - backend.py:273 - Book 8922d19e85444bbb7b0adfb7153dc0fa download failed
.574319+00:00File "/app/backend.py", line 181, in _download_book_with_cancellation
.574337+00:00shutil.move(book_path, intermediate_path)
.574343+00:00File "/usr/local/lib/python3.10/shutil.py", line 836, in move
.574366+00:00copy_function(src, real_dst)
.574375+00:00File "/usr/local/lib/python3.10/shutil.py", line 435, in copy2
.574392+00:00copystat(src, dst, follow_symlinks=follow_symlinks)
.574431+00:00File "/usr/local/lib/python3.10/shutil.py", line 380, in copystat
.574476+00:00lookup("chmod")(dst, mode, follow_symlinks=follow)
.574482+00:00PermissionError: [Errno 1] Operation not permitted: '/cwa-book-ingest/8922d19e85444bbb7b0adfb7153dc0fa.crdownload'
.574500+00:002025-08-29T17:38.574500584Z
.574505+00:00During handling of the above exception, another exception occurred:
.574545+00:002025-08-29T17:38.574545473Z
.574553+00:00Traceback (most recent call last):
.574559+00:00File "/app/backend.py", line 184, in _download_book_with_cancellation
.574564+00:00shutil.copy(book_path, intermediate_path)
.574580+00:00File "/usr/local/lib/python3.10/shutil.py", line 418, in copy
.574586+00:00copymode(src, dst, follow_symlinks=follow_symlinks)
.574591+00:00File "/usr/local/lib/python3.10/shutil.py", line 307, in copymode
.574595+00:00chmod_func(dst, stat.S_IMODE(st.st_mode))