Page 1 of 1

What's with all the API Warning

Posted: February 8th, 2013, 6:48 pm
by iecus
today everything I try to download is causing sab to report the warning below. I use a 3rd party sabnzbd via google chrome and I checked the API in the config/general and looked at the 3rd party program and its the same API in both so why am I getting killed with all of these API key incorrect.

API Key incorrect, Use the api key from Config->General in your 3rd party program: 192.168.1.2>Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:10.0.2) Gecko/20100101 Firefox/10.0.2

Re: What's with all the API Warning

Posted: February 9th, 2013, 1:50 am
by sander
Somewhere on your LAN (on the Mac with IP address 192.168.1.2) there is a Firefox (version 10.0.2) which has a plugin installed, which has no correct API key.

So ... can you find that Mac? Can you find Firefox on it? Can you find the plugin?

Re: What's with all the API Warning

Posted: February 9th, 2013, 10:19 am
by iecus
Sander, that's what I thought also, when I checked FF on the pc with that IP sabnzbd plugin was not installed, I only have it installed on google chrome and that's the 1 with the correct API, I even removed it and C/P it back from the 3rd party API section in sab.

Re: What's with all the API Warning

Posted: February 9th, 2013, 10:29 am
by shypike
You should look for the root cause, but it is possible to disable the warning.
Config->Special->api_warnings

Re: What's with all the API Warning

Posted: February 9th, 2013, 3:20 pm
by sander
iecus wrote:Sander, that's what I thought also, when I checked FF on the pc with that IP sabnzbd plugin was not installed, I only have it installed on google chrome and that's the 1 with the correct API, I even removed it and C/P it back from the 3rd party API section in sab.
PC? It's a Mac, right?

Just turn that system off, and see if the warning goes away ...

Re: What's with all the API Warning

Posted: February 9th, 2013, 4:17 pm
by iecus
it's a PC, no pc's in my house are mac's. my main pc is the pc the IP reported it from and I just disabled the sab from it but it's still giving me errors. I'm running SABnzbd Version: 0.7.11. I checked my FF extension and I don't have sabnzbd installed.

Re: What's with all the API Warning

Posted: February 9th, 2013, 4:19 pm
by iecus
shypike wrote:You should look for the root cause, but it is possible to disable the warning.
Config->Special->api_warnings
Thank you, I did turn it off, but yes I would still like to get to the root cause.

Re: What's with all the API Warning

Posted: February 9th, 2013, 4:41 pm
by sander
iecus wrote:it's a PC, no pc's in my house are mac's.
Wow, that's strange: your API warning says "Macintosh; Intel Mac OS X 10.7; rv:10.0.2". I would say that's a Mac OSX

Re: What's with all the API Warning

Posted: February 9th, 2013, 5:44 pm
by iecus
I figured it out the problem. This error was so wrong, it was CouchPotato that was causing the problem. I upgraded my CP and for some reason the API wasn't the same. I fixed the API in CP and now everything is fine.

Thank you everyone for your help.

Re: What's with all the API Warning

Posted: February 9th, 2013, 6:21 pm
by sander
But this means that - assuming you really, really have no Mac on your LAN - CP is using a user agent "Macintosh; Intel Mac OS X 10.7; rv:10.0.2".

Confusing and weird.

Re: What's with all the API Warning

Posted: February 9th, 2013, 6:40 pm
by sander
Update:

I installed CouchPotato and I can confirm the weird user agent setting provided by CP:

Code: Select all

2013-02-10 00:36:53,808::WARNING::[interface:189] API Key incorrect, Use the api key from Config->General in your 3rd party program: ::ffff:127.0.0.1>Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:10.0.2) Gecko/20100101 Firefox/10.0.2
I had a look at CP's source code, and it's here:
couchpotato/core/plugins/base.py:

headers['User-Agent'] = headers.get('User-Agent', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:10.0.2) Gecko/20100101 Firefox/10.0.2')
Maybe the same header is used (and needed) towards public websites. "Needed" because maybe it would be blocked otherwise?

EDIT: I contacted CP's author, and I created an issue: https://github.com/RuudBurger/CouchPota ... ssues/1406

Re: What's with all the API Warning

Posted: February 13th, 2013, 1:21 pm
by sander
CouchPotato has changed it UserAgent's ID towards SABnzbd into this info:

Code: Select all

2013-02-13 18:50:25,217::DEBUG::[interface:420] API-call from ::ffff:127.0.0.1 [CouchPotato linux - git-673843fb - v2] {'output': 'json', 'apikey': 'kloptniet', 'mode': 'queue'}
2013-02-13 18:50:25,230::DEBUG::[interface:420] API-call from ::ffff:127.0.0.1 [CouchPotato linux - git-673843fb - v2] {'output': 'json', 'apikey': 'kloptniet', 'limit': '15', 'mode': 'history'}

So ... no more confusion! :-)

Re: What's with all the API Warning

Posted: April 18th, 2021, 12:20 pm
by jtilles
I was getting an

Code: Select all

API key incorrect, Use the API key from Config->General in your 3rd party program: 172.17.0.1>GuzzleHttp/6.3.3 curl/7.69.1 PHP/7.3.27
which turned out to be I had updated my Sabnzbd API key for a different reason but forgot to update Heimdall with the correct API key and it was pinging Sab every 3ish seconds causing an error.