Open pthiben opened 1 month ago
In general the code is correct. It uses move to move the file, a rename command would only work on the same drive, this was the case in the past but is now solved. The move command tries to copy the metadata which fails. I can't reproduce this, I think you need some complicated use case like the one in the closed issue or something in conjunction with docker (as in your case and in many similar cases) Please try to update to the newest nightly version. Calibre-Web should then give the move another try without coping the metadata. It's possible that this will still occur on other actions (rename authors, title, upload single file or cover)
Focusing specifically on tmp, it might also be worth you sharing your docker compose, which ought to include how you're mapping your /tmp. Worth noting that docker can let you mount tmpfs but that's a Linux only feature, and it should work in WSL2, might be worth looking at that thread to see how they're doing it. Apologies if I've misunderstood anything.
Nightly works, thank you so much !
FYI, docker-compose when I tried with TMPDIR is
calibre-web:
image: lscr.io/linuxserver/calibre-web:nightly
container_name: calibre-web
environment:
- PUID=${DOCKER_PUID}
- PGID=${DOCKER_PGID}
- TZ=${DOCKER_TZ}
- TMPDIR=/books/tmp
volumes:
- ${DOCKER_CONFIG_PATH}/calibre-web:/config
- ${MEDIA_PATH}/books/calibre:/books
ports:
- 8083:8083
- 9001:9001
- 465:465
- 5299:5299
privileged: true
https://docs.python.org/3/library/tempfile.html states that python should not use /tmp, but
The default directory is chosen from a platform-dependent list, but the user of the application can control the directory location by setting the TMPDIR, TEMP or TMP environment variables
Dir is 777, and I tried other directories but nothing worked
Hello,
Thanks a lot for your work on calibre-web, it's an amazing piece of software !
I think this bug is related to calibre-web / python shutils, but as a disclaimer I'm running with a docker version in WSL. It looks awfully similar to https://github.com/janeczku/calibre-web/issues/2062
My /tmp and /books are mounted on different drives.
I tried changing the TMPDIR environment variable to point to /books/tmp, but it didn't seem to have propagated to calibre (might be a specific docker issue)
My Repro:
I'm getting the error
The book has actually been moved
/books/Nathaniel Hawthorne/The Scarlet Letter (338)
But the cover is moved to/books/Nathaniel Hawthorne/The Scarlet Letter
/books/Nathaniel Hawthorne/The Scarlet Letter
seems to be the path expected by calibre-web because if I move manually the book there, fetch metadata and save, things work just fine. The book's URL ends up beingadmin/book/338
I'm not sure why the cover is succeeding but the book doesn't. Could we do a copy+delete when we detect that the move failed ?Here's the log.