API Overage

Posted on
Thu Sep 13, 2018 5:45 am
DaveL17 offline
User avatar
Posts: 6741
Joined: Aug 20, 2013
Location: Chicago, IL, USA

API Overage

Just a head's up that I awoke today to find my FUWU plugin displaying the following message every minute:
Code: Select all
   Fantastic Weather Error         Unable to decode data. (Line 843) No JSON object could be decoded
   Fantastic Weather Warning       Unable to reach Dark Sky. Sleeping until next scheduled poll.
   Fantastic Weather               Fantastic Weather cannot determine age of data. Skipping until next scheduled poll.

When I manually loaded the Dark Sky URL into a browser, it reported "daily usage limit exceeded".

I'm just starting to look into what caused the problem. The plugin had been working stably for many weeks before now, but clearly there's something awry. One problem is that the error found a way to circumvent the "next scheduled poll" trap as I have my plugin set to refresh every 15 minutes and the error caused the plugin to retry every minute. I'll post more information when I figure out what's going on. You may want to keep an eye on the plugin and disable it if you see the above error in the log or if your API usage is extra high.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Thu Sep 13, 2018 8:18 am
DaveL17 offline
User avatar
Posts: 6741
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: API Overage

Thanks for the advice. The daily limit for the free API is 1,000 calls--mine would have used 1,440 if it hadn't maxed out the limit. Users can set the limit (as you suggested) through the Dark Sky account settings. My install *should have been* using 96 calls per day at 15 minute intervals. The plugin is supposed to keep the calls below the number set in the plugin preferences dialog, but clearly that wasn't happening in this case. I still need to figure out why.

That said, I've been able to do some preliminary research into the conditions at the time this error happened and--given the conditions that caused it to happen--it's pretty unlikely that anyone will see the error. If you do, please let me know. I won't be able to do any testing until my API count is reset at midnight UTC.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Thu Sep 13, 2018 7:58 pm
DaveL17 offline
User avatar
Posts: 6741
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: API Overage

I've done a lot more research into this error and I'm pretty confident that no one else will see it, so there's most likely nothing to worry about. It was caused by a confluence of conditions that included non-public code--therefore, it shouldn't even happen with public releases of the plugin.

I do believe that setting the daily API call limit to something lower than the max number of calls per day is good advice. It appears that the plugin's API call limiter was working after all, I just had mine precisely (and stupidly) set to the max daily limit. Lesson learned.

Even though this will likely not resurface, the exercise was useful. As a result of this excitement, I will make a point of adding more robust error trapping to try to eliminate the possibility of an error causing the once-per-minute API call error state.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Fri Sep 14, 2018 5:36 am
DaveL17 offline
User avatar
Posts: 6741
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: API Overage

I appreciate the thought. In the case that caused the error, several steps needed to be taken to recover from it [to reiterate, this is not an error that anyone should come across] that couldn't be easily automated.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest

cron