DobyTang / LazyLibrarian

This project isn't finished yet. Goal is to create a SickBeard, CouchPotato, Headphones-like application for ebooks. Headphones is used as a base, so there are still a lot of references to it.
728 stars 72 forks source link

PostProcessing suddenly not working #1567

Closed juliemars closed 5 years ago

juliemars commented 5 years ago

Hi All

Looking for some advice, I have been using LazyLibrarian for awhile and it was working fine. The last book it downloaded on the 29th August worked fine, it post processed fully. Yesterday it downloaded a couple of books but the post processing failed

My setup is as follows: Raspberrypi with NZBGet for downloading. books get placed into /media/downloads/completed/books on the PI when downloaded. This folder is shared second Raspberrypi has LazyLibrarian installed via git, and has a mapped folder to the first PI. The ebooks are then moved to a network drive, plugged into the router, which has no credentials assigned to it.

the logs show as:

18-Sep-2018 01:10:53 - ERROR :: POSTPROCESS : postprocess.py:processDir:711 : Postprocessing for TITLE-AUTHOR has failed: Unable to move file /media/downloads/Completed/Books/AUTHOR TITLE retail epub/AUTHOR - SERIES - TITLE (retail) (epub).epub to /media/Router/Backups/Ebooks/AUTHOR/SERIES/TITLE - AUTHOR.epub: OSError [Errno 13] Permission denied: '/media/Router/Backups/Ebooks/AUTHOR/SERIES/TITLE - AUTHOR.epub' 18-Sep-2018 01:10:53 - ERROR :: POSTPROCESS : postprocess.py:processDir:735 : Unable to rename /media/downloads/Completed/Books/AUTHOR SERIES TITLE retail epub, OSError [Errno 13] Permission denied: '/media/downloads/Completed/Books/AUTHOR SERIES TITLE retail epub.fail' 18-Sep-2018 01:10:53 - WARNING :: POSTPROCESS : postprocess.py:processDir:736 : Residual files remain in /media/downloads/Completed/Books/AUTHOR SERIES TITLE retail epub

so I know it's a permissions issue that has appeared, no idea why though. Not sure if it is a permission on the first PI or the router, that I need to fix.

Any ideas how I can fix this?

philborman commented 5 years ago

Looks like write permissions on /media/downloads/Completed/Books/AUTHOR SERIES TITLE retail epub as we can't rename it, and we can't move it to /media/Router either. Maybe NZBGet has saved the file read-only, or maybe a mapping permissions issue?

juliemars commented 5 years ago

thanks philborman it must be a mapping permissions issue then, no idea as I have made no changes to this. Oh well will have a play and see if I can work it out.

EDIT: I am really confused I logged in as the user lazylibrarian is running as, went to both directories and ran cat > sample.txt the file appeared so no idea now why it's not working oh well will just move them manually

philborman commented 5 years ago

Few things you can check What is the permission on the file /media/downloads/Completed/Books/AUTHOR SERIES TITLE retail epub, ls -lh or similar Might be worth checking the sd cards too. As you are on raspberry pi I guess the sd card is being used for storage. Some sd cards will start to go read-only before they fail. We could fairly easily get lazylibrarian to tell us the permissions it thinks it has, currently the error code just says OSError [Errno 13] Permission denied but doesn't tell us what it was trying to do at the time or what permission was refused. Would need a little editing if you are up for it.

juliemars commented 5 years ago

Hi

using ls -lh I get the following on the router directory:

drwxrwxr-x 1 pi root 0 Sep 18 13:42

The Downloads is: drwxr-xr-x 2 pi root 0 Sep 18 20:55

the PI with NZBGet on it has a HDD for storage, I checked it and it's fine. The SD Card looks fine but to be safe I have cloned it and swapped it. I have swapped the download locations to a second network drive and it seems to be working so I will leave it as it is for now. Thanks for the help though

philborman commented 5 years ago

ok, I will close this for now. Added some extra debug messages to the logs if rename/move fails so if it happens again we will get more info on what's wrong.