-
Notifications
You must be signed in to change notification settings - Fork 232
Error with leveling pokemon #243
Comments
Try the most up to date version and post back results. |
it happens everytime an upgrade cycle starts, followed by an unstable message. I'll post back results of newest version |
on 1.0.0.5 same issue. Unstable error followed by Object reference not set to an instance of an object error. Happens after a couple of level ups |
@Silph-Road same results as @popsoda27 on latest ver 1.0.0.5 |
@jjskuld fixed a similar bug earlier today, I think it's related. |
Same problem experienced using version 1.0.0.5 |
My suspicion is that this is a bug caused by the The quick solution is to try to increase |
This actually needs to be fixed at the Rocket API level because it has the potential to affect all the API calls. When the API is throttled, it should retry gracefully without throwing up an error to the bot unless it is a fatal error. |
@jjskuld tried with higher delays but still results in an error. I'll try using 2 upgrade loops since it seems to work until that point and post back results |
@wilsondgonzales Thanks for retrying. I'm curious what did you set I've reworked how the API handles errors and retries and am currently testing it for stability for a few hours. Stay tuned.. |
@jjskuld tried with 15000, 20000, and 25000. i'm guessing the error happens when proceeding to the next pokemon to upgrade when the bot queries the server by the looks of it |
@wilsondgonzales Thanks for the info. That helps rule out a few things actually. I believe I've identified the bug. In the upgrade pokemon logic, the bot makes 3 API calls in rapid succession with zero delays between the calls.
The Niantic API is throttled when you exceed approximately 3 API requests per second. In the upgrade logic, even after waiting for 20 - 25 seconds between upgrades, it makes the above 4 requests one after the other with zero delays during the upgrade itself. By the stack trace above, the error was that The API fix that I'm testing should fix this error as well as ALL API throttling errors throughout the bot. The fix that I made is to have the API auto-throttle itself transparently. This way we don't have to go through the bot and add delays everywhere. The API will now handle when it gets a throttling error (status code 52), and will retry the request transparently with a delay. The delay will be auto-magically increased until no throttling errors are encountered. Also, after a series of successful, non-throttled requests, then the throttling delay will be decreased. So this will also help with folks who are running lots of bots on the same machine. Previously running more than 2 - 3 bots might run into the API throttling issue. Now, with the throttling delay being adjusted automatically, you could probably run more than 3 bots with no issues. (For example, 3 bots would each use API throttling delay of 500-800 ms, whereas 1 bot would use a throttling delay of 100-300ms). ETA for this fix to be released will be by the end of the day. Stay tuned. |
great stuff. maybe niantic uses api call frequency to detect bots too. i dunno much about how it all works though so it might sound silly :p |
Actually, while the throttling might be the issue here, I also have another theory as to why the upgrade cycle may not be working. When we upgrade the pokemon, we are not refreshing the inventory immediately, so it gets stale data when trying to call |
…ding_pokemon Fixes bug #243 - Fix error while upgrading pokemon
### Expected Behavior:
Program doesn't crash
### Actual Behavior:
Crashes and relogs
### Your config.json:
### (OPTIONAL) Your Log:
### Detailed Steps to Reproduce:
Other Information
Version: 0.9.9
Windows Version: 7
What is affected : powerup
The text was updated successfully, but these errors were encountered: