Page 1 of 1

Loading .../.sabnzbd/admin/Rating.sab failed

Posted: October 7th, 2014, 2:22 pm
by sander
(Related: http://forums.sabnzbd.org/viewtopic.php?f=2&t=17844 )

I often get the error "Loading /home/sander/.sabnzbd/admin/Rating.sab failed"

Examples:

Code: Select all

$ grep -i 'rating.sab failed' sabnzbd.log*
sabnzbd.log:2014-10-07 20:35:20,201::ERROR::[__init__:962] Loading C
sabnzbd.log.1:2014-09-29 23:09:41,053::ERROR::[__init__:962] Loading /home/sander/.sabnzbd/admin/Rating.sab failed
sabnzbd.log.1:2014-09-30 22:02:20,317::ERROR::[__init__:962] Loading /home/sander/.sabnzbd/admin/Rating.sab failed
sabnzbd.log.1:2014-10-02 07:48:27,987::ERROR::[__init__:962] Loading /home/sander/.sabnzbd/admin/Rating.sab failed
sabnzbd.log.1:2014-10-04 07:46:59,969::ERROR::[__init__:962] Loading /home/sander/.sabnzbd/admin/Rating.sab failed
sabnzbd.log.2:2014-09-23 08:00:58,657::ERROR::[__init__:962] Loading /home/sander/.sabnzbd/admin/Rating.sab failed
sabnzbd.log.2:2014-09-23 13:18:07,248::ERROR::[__init__:962] Loading /home/sander/.sabnzbd/admin/Rating.sab failed
sabnzbd.log.2:2014-09-23 20:54:45,614::ERROR::[__init__:962] Loading /home/sander/.sabnzbd/admin/Rating.sab failed
sabnzbd.log.2:2014-09-24 07:47:38,977::ERROR::[__init__:962] Loading /home/sander/.sabnzbd/admin/Rating.sab failed
sabnzbd.log.4:2014-09-20 12:15:10,746::ERROR::[__init__:962] Loading /home/sander/.sabnzbd/admin/Rating.sab failed
I checked and the file does exist ... since yesterday

Code: Select all

$ ll /home/sander/.sabnzbd/admin/Rating.sab 
-rw-rw-r-- 1 sander sander 452 okt  6 22:20 /home/sander/.sabnzbd/admin/Rating.sab
So why is SAB reporting today it does not exist. Oh wait ... "Loading ... failed". SAB does NOT say the file does not exist, only that the loading failed. ::)

Let's check the code:

Code: Select all

    try:
        f = open(path, 'rb')
        if do_pickle:
            data = cPickle.load(f)
        else:
            data = f.read()
        f.close()

        if remove:
            os.remove(path)
    except:
        logging.error(Ta('Loading %s failed'), path)
        logging.info("Traceback: ", exc_info = True)
        return None
So options:
- something went wrong with the open
- something went wrong with the pickle stuff
- something went wrong with the close or the remove

I'll put some extra logging into __init__.py and see what results that gives.

Re: Loading .../.sabnzbd/admin/Rating.sab failed

Posted: October 7th, 2014, 2:53 pm
by sander

Re: Loading .../.sabnzbd/admin/Rating.sab failed

Posted: October 7th, 2014, 3:20 pm
by shypike
Sloppy code in the oznab ratings support.
Likely to be a corrupt file or maybe just an empty one.
Do you use oznzb ?

Re: Loading .../.sabnzbd/admin/Rating.sab failed

Posted: October 7th, 2014, 3:46 pm
by sander
shypike wrote: Do you use oznzb ?
I've once made an account there and downloaded two or three NZBs