Page 1 of 1

Cannot create backup file \AppData\Local\sabnzbd\sabnzbd.ini

Posted: June 20th, 2012, 3:05 pm
by Kafluke
I've gotten used to having to start over every now and then. I get SABnzbd set up properly and configured the way I want it and then this error starts showing up:

Cannot create backup file for ...\AppData\Local\sabnzbd\sabnzbd.ini (full path left off on purpose)

When I see that error I hurriedly copy the sabnzbd.ini file out of the folder listed above and save it for archiving. When SABnzbd blows up and the setup screen manifests its ugly head again I go back and copy the sabnzbd.ini file back into the profile directory and it works again. Big pain my my butt.

At first I thought it might just be this computer but it has done this on three different computers now.

Can someone tell me how to stop this from happening? I've already checked permissions and everything is good there.

I'm on Windows 7 Ultimate 64bit by the way.

Re: Cannot create backup file \AppData\Local\sabnzbd\sabnzbd

Posted: June 21st, 2012, 3:37 am
by shypike
Do you only get the message or does it prevent you from using SABnzbd?

Re: Cannot create backup file \AppData\Local\sabnzbd\sabnzbd

Posted: June 21st, 2012, 6:46 am
by Kafluke
It starts out by filling my log full of that error. SABnzbd works fine while the error message is being written to the log but if for some reason I have to restart SABnzbd, fuhgetaboutit! It acts as if there is no sabnzbd.ini file and goes through the startup wizard again.

Re: Cannot create backup file \AppData\Local\sabnzbd\sabnzbd

Posted: June 21st, 2012, 7:05 am
by shypike
OK, this means that something is actually going wrong.
Occasionally a complaint like yours comes in, so a small minority has this.
So far the cause is completely elusive.
The only reason I can think of is that renaming the INI file to INI.BAK
is prohibited because some other program opened it (e.g. virus scanner, Windows' indexing service).
But that's no more than speculation.
I'll look into this and try to find at the least some work-around.

Re: Cannot create backup file \AppData\Local\sabnzbd\sabnzbd

Posted: June 21st, 2012, 10:26 am
by Kafluke
Thank you so much for looking into this. I've been losing faith lately in internet forums. I post a simple question looking for help and everyone goes ape sh!t attacking me for asking in the first place. It's refreshing to find a forum where your concerns are taken seriously and addressed in a timely matter. You rock!

It's weird that I've now seen this happen on a total of three different machines. The only thing that was the same between them was that they were all running Windows 7 Ultimate Retail 64 bit with SP1.

Re: Cannot create backup file \AppData\Local\sabnzbd\sabnzbd

Posted: June 21st, 2012, 2:10 pm
by shypike
Should you happen to have SABnzbd's logging level to "info" or "debug",
the log file will contain "traceback" info, giving you more details about what actually went wrong.
Just look for the error message and the next few lines should have the actual OS error.

Currently I'm reviewing and simplifying the way backups of the INI file are made.
Also adding an important missing feature: using the BAK file when the INI file is missing or corrupt.

Re: Cannot create backup file \AppData\Local\sabnzbd\sabnzbd

Posted: June 28th, 2012, 3:34 pm
by Kafluke
I gotta be honest with ya. Ever since posting about this I haven't seen the error... ON ANY OF MY MACHINES! Its almost as if the program knew I was getting pissed and when I posted it just... "straightened up" and starting working right. LOL.

Re: Cannot create backup file \AppData\Local\sabnzbd\sabnzbd

Posted: July 2nd, 2012, 2:02 am
by dbrooks
I suspect this has to do with the fact that Windows 7 sets the read-only attribute on EVERY folder, regardless, and then proceeds to ignore it. It wreaks havoc with things like sabnzbd that try to write files to that directory.

Seriously, see if your c:\program files(x86)\sabnzbd folder has the read-only attribute set. I bet it does. Try to remove that attribute. I bet you can't.

Traceback information from the log looks like this:

Code: Select all

2012-07-02 03:04:16,904::ERROR::[config:770] Cannot create backup file for C:\Program Files (x86)\SABnzbd\sabnzbd.ini

2012-07-02 03:04:16,904::INFO::[config:771] Traceback: 

Traceback (most recent call last):
  File "sabnzbd\config.pyo", line 761, in save_config
WindowsError: [Error 5] Access is denied: 'C:\\Program Files (x86)\\SABnzbd\\sabnzbd.ini.bak'
The only workaround I've been able to find is launching SABnzbd+ as an Administrator on Windows 7. Nothing else has worked.

Re: Cannot create backup file \AppData\Local\sabnzbd\sabnzbd

Posted: July 2nd, 2012, 3:15 am
by shypike
You're not supposed to write to the program folder.
Where do you keep your INI file and admin/log folder?
I hope in the user profile.
When SABnzbd sees an INI file in the program folder it falls back to ancient (rel 2.5) behaviour.
It will not try to write an INI file to the program folder spontaneously.

Re: Cannot create backup file \AppData\Local\sabnzbd\sabnzbd

Posted: July 2nd, 2012, 10:22 am
by Kafluke
SABnzbd automatically sets itself up in the profile directory.

The file that constantly has issues being written is located here:

c:\users\<username>\AppData\Local\sabnzbd\sabnzbd.ini

That's NOT the program directory. Its inside the user profile.

Re: Cannot create backup file \AppData\Local\sabnzbd\sabnzbd

Posted: July 2nd, 2012, 10:40 am
by dbrooks
shypike wrote:You're not supposed to write to the program folder.
Where do you keep your INI file and admin/log folder?
I hope in the user profile.
When SABnzbd sees an INI file in the program folder it falls back to ancient (rel 2.5) behaviour.
It will not try to write an INI file to the program folder spontaneously.
You're right, my log message was after I was futzing around with it. I was still seeing the same thing in the AppData directory -- I'm still of the opinion that this is largely due to Windows 7 directory permissions.

Out of curiosity, and strictly related to the Windows port, in what locations does SABnzbd+ search for an ini file, and in what order?

Re: Cannot create backup file \AppData\Local\sabnzbd\sabnzbd

Posted: July 2nd, 2012, 10:46 am
by sander
dbrooks wrote:
Out of curiosity, and strictly related to the Windows port, in what locations does SABnzbd+ search for an ini file, and in what order?
See here: http://wiki.sabnzbd.org/faq#toc18

So I would say: no searching. Just one location.

Re: Cannot create backup file \AppData\Local\sabnzbd\sabnzbd

Posted: July 2nd, 2012, 11:00 am
by shypike
dbrooks wrote: Out of curiosity, and strictly related to the Windows port, in what locations does SABnzbd+ search for an ini file, and in what order?
1. location given by the -f parameter
2. program folder (that's the old behaviour)
3. user profile (for Win7: c:\Users\user\AppData\Local\sabnzbd)