Page 1 of 1

4.11 Session Key Required

Posted: May 24th, 2009, 3:16 am
by littlephil
I have performed a fresh install using the source files on Debian. I am receiving error: Session Key Required on both the Default and Plush skins. This must be an issue with just my setup as I see this issue was fixed as part of the 4.11 release.

I have checked the Cherry and SAB logs but nothing seems to suggest a problem. Any suggestions on where to look next?

Thank you in advance.

Re: 4.11 Session Key Required

Posted: May 24th, 2009, 5:04 am
by shypike
Tell us where it goes wrong exactly.
Maybe we missed another instance requiring a session key.

Otherwise the skins and the code may not match.
How did you install exactly?

Re: 4.11 Session Key Required

Posted: May 24th, 2009, 5:41 am
by littlephil
I installed by downloading a fresh copy from sourceforge (4.11, Python source) and run from the command line using SABnzbd.py

It seems to happen anywhere the session would be used, even the shutdown link, there is a query string parameter for session but it is empty, so the shutdown URL becomes:

/sabnzbd/shutdown?session=

I am running it behind Apache but I get the same results using elinks on the server.

It seems fine on my OSX box so it must be configuration on my Debian machine, just don't know where to look:/

Thanks for your help:)

Re: 4.11 Session Key Required

Posted: May 24th, 2009, 12:06 pm
by shypike
Go to Config->General and click on the text link "Generate new API key".

Re: 4.11 Session Key Required

Posted: May 25th, 2009, 12:46 am
by littlephil
The Plush skin just says Generate new API key in the box and doesn't do anything when I try to generate one, the Default gives me the same Session Key Required Error when I try to generate a key.

That said there does appear to be an API key in my ini file, if I add that to the shutdown URL (session=API-KEY) then it seems to work. Could this be a problem with my template libraries?

Re: 4.11 Session Key Required

Posted: May 25th, 2009, 1:33 am
by shypike
Are you trying to shutdown SABnzbd with a script (using "curl" or "wget")?
If so, then indeed you need to add "?session=blabla" to the URL.
I thought you were complaining about the regular web UI.

Re: 4.11 Session Key Required

Posted: May 25th, 2009, 1:47 am
by littlephil
My apologies that last comment was a little misleading.

Using the regular UI anywhere the "session" query string parameter is used it is blank. If I copy in the API key found in my ini file manually then the links work. For example, my current shutdown link is:

/sabnzbd/shutdown?session=

and shows the error described, if I add the API key manually I get:

/sabnzbd/shutdown?session=MY-API-KEY

this URL then works as expected.

Re: 4.11 Session Key Required

Posted: May 25th, 2009, 6:50 am
by switch
What browser are you using? Try another.
Have you tried the SMPL skin?
Is disable api key enabled in config>general? If so, disable it so the api key is "enabled".

Re: 4.11 Session Key Required

Posted: May 25th, 2009, 9:03 am
by littlephil
Tried with SMPL skin, tried disable_api_key as both 0 and 1 and also tried Safari as well as Firefox on OS X (install is on Debian which is installed on NSLU2) hence elinks.

Everything works if I disable the api key.

SMPL gets the same error when I try it with the api key enabled. I guess I can just disable it for now?

Re: 4.11 Session Key Required

Posted: June 16th, 2009, 1:38 pm
by AnotherHowie
I'm seeing this with 0.4.11 too. "?session=" on the end of URLs, but no key. The key is in my ini file.

I get the following in my logs:

"Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11"

*** WARNING ***
The following keys are members of the Template class and will result in NameMapper collisions!
  > session

Please change the key's name or use the compiler setting "prioritizeSearchListOverSelf=True" to prevent the NameMapper from using
the Template member in place of your searchList variable
***************

Is this something to do with particular versions of Cheetah? Mine is Cheetah-2.2.1 from FreeBSD ports.

Re: 4.11 Session Key Required

Posted: June 17th, 2009, 2:00 am
by shypike
Yes it's  Cheetah's fault.

The quickest way to "solve" it is to edit the sabnzbd.ini file.
Replace:

Code: Select all

[misc]
disable_key=0
by

Code: Select all

[misc]
disable_key=1

Re: 4.11 Session Key Required

Posted: June 18th, 2009, 11:43 am
by AnotherHowie
Is that really disable_key or disable_api_key? Cos I have the latter, but not the former...

Re: 4.11 Session Key Required

Posted: June 19th, 2009, 2:34 am
by shypike
You're right it's disable_api_key.