Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dev] Bot using lucky eggs before reconnect after API exception #2391

Closed
Vvkmnn opened this issue Aug 2, 2016 · 18 comments
Closed

[dev] Bot using lucky eggs before reconnect after API exception #2391

Vvkmnn opened this issue Aug 2, 2016 · 18 comments

Comments

@Vvkmnn
Copy link

Vvkmnn commented Aug 2, 2016

Expected Behavior

Bot should retry until API lets it through, not break on the pgoapi exception.

Actual Behavior

[16:16:23] Server is throttling, let's slow down a bit
[16:16:25] Server is throttling, let's slow down a bit
[16:16:26] Server is throttling, let's slow down a bit
[16:16:27] Server is throttling, let's slow down a bit
[16:16:28] Server is throttling, let's slow down a bit
[16:16:29]
[16:16:29]  Ran for 0:00:12
[16:16:29]  Total XP Earned: 0  Average: 0.00/h
[16:16:29]  Travelled 0.00km
[16:16:29]  Visited 0 stops
[16:16:29]  Encountered 0 pokemon, 0 caught, 0 released, 0 evolved, 0 never seen before
[16:16:29]  Threw 0 pokeballs
[16:16:29]  Earned 0 Stardust
[16:16:29]
[16:16:29]  Highest CP Pokemon:
[16:16:29]  Most Perfect Pokemon:
Traceback (most recent call last):
  File "pokecli.py", line 442, in <module>
    main()
  File "pokecli.py", line 71, in main
    bot.tick()
  File ".../PokemonGo-Bot/pokemongo_bot/__init__.py", line 92, in tick
    if worker.work() == WorkerResult.RUNNING:
  File ".../PokemonGo-Bot/pokemongo_bot/cell_workers/evolve_all.py", line 19, in work
    if not self._should_run():
  File ".../PokemonGo-Bot/pokemongo_bot/cell_workers/evolve_all.py", line 73, in _should_run
    response_dict_lucky_egg = self.bot.use_lucky_egg()
  File ".../PokemonGo-Bot/pokemongo_bot/__init__.py", line 376, in use_lucky_egg
    return self.api.use_item_xp_boost(item_id=301)
  File ".../PokemonGo-Bot/venv/src/pgoapi/pgoapi/pgoapi.py", line 84, in function
    return request.call()
  File ".../PokemonGo-Bot/pokemongo_bot/api_wrapper.py", line 109, in call
    raise ServerSideRequestThrottlingException('Server throttled too many times')
pgoapi.exceptions.ServerSideRequestThrottlingException: Server throttled too many times

Steps to Reproduce

Just switch locations and retry.

Other Information

OS: OSX 10.10.5
Git Commit: bdf2e7d
Python Version: Python 2.7.11

@Vvkmnn
Copy link
Author

Vvkmnn commented Aug 2, 2016

Similar to #2386

May be addressed by #2388

@JSchwerberg
Copy link
Contributor

Not addresses by #2388, but I can fix this... will make a pull request shortly.

@Vvkmnn
Copy link
Author

Vvkmnn commented Aug 2, 2016

Cheers bud.

@Vvkmnn Vvkmnn changed the title [dev] API throttling exception [dev] Bot crashing on API throttling exception Aug 2, 2016
@JSchwerberg
Copy link
Contributor

JSchwerberg commented Aug 2, 2016

Looking at this, this exception is actually being raised by the bot itself; it's not an API exception that's being re-raised.

I'm curious if there's a reason for this to be there. @DayBr3ak can you chime in?

@DayBr3ak
Copy link
Contributor

DayBr3ak commented Aug 2, 2016

Well the server is throttling you, but the bot is retrying past this 5 times. Beyond that, it's raising that error, because it's very probably an error coming from your configuration and not the bot

@hYbridWY
Copy link

hYbridWY commented Aug 2, 2016

Any remedy for this? Haven't been able to load up the bot due to this.

@hackenho
Copy link

hackenho commented Aug 2, 2016

Try to change the config parameter map_object_cache_time": 5, from 5 to 10

@d0s000m
Copy link

d0s000m commented Aug 2, 2016

same problem after change map_object_cache_time": 5, from 5 to 10

@DayBr3ak
Copy link
Contributor

DayBr3ak commented Aug 2, 2016

Did you re ran pip install -r requirements.txt there is an updated module

@d0s000m
Copy link

d0s000m commented Aug 2, 2016

Yes
again
[00:41:54] Server is throttling, let's slow down a bit
[00:41:56] Server is throttling, let's slow down a bit
[00:41:59] Server is throttling, let's slow down a bit

wihtout evolve the but is running
but if i start with

"type": "EvolveAll", "config": { "evolve_all": "Caterpie,Weedle,Pidgey,Rattata,Spearow,Ekans,Sandshrew,Clefairy,Jigglypuff,Zubat,Oddish,Paras,Venonat,Diglett,Psyduck,Mankey,Poliwag,Abra,Bellsprout,Tentacool,Seel,Shellder,Gastly,Drowzee,Krabby,Horsea,Goldeen,Staryu,Omanyte,Kabuto", "evolve_cp_min": 1, "evolve_speed": 20, "use_lucky_egg": true
The bot is crashing after few seconds with

  File ".../PokemonGo-Bot/pokemongo_bot/api_wrapper.py", line 109, in call
    raise ServerSideRequestThrottlingException('Server throttled too many times')
pgoapi.exceptions.ServerSideRequestThrottlingException: Server throttled too many times

latest dev

@Vvkmnn
Copy link
Author

Vvkmnn commented Aug 3, 2016

The exception crash was addressed in ##2407 and seems to be primarily resolved in commit 3ef3fc7.

Unfortunately, there seems to be a new issue where the client will log in, pop a lucky egg, and then wait until reconnecting. It wastes lucky eggs, and can often do this 10 or 12 times in a row:

[21:14:36]  Starting PokemonGo Bot.... 
[21:14:37] Using lucky egg ... you have 12
[21:14:56] Server is throttling, reconnecting in 30sec
[21:15:26] [x] Coordinates found in passed in location, not geocoding.
[21:15:26] 
[21:15:26] Location Found: 43.63954594864653,-79.3757164478302 // Jack Leyton Ferry
[21:15:26] GeoPosition: (43.6395459, -79.3757164, 0)
[21:15:26] 
[21:15:26] Attempting login to Pokemon Go.
[21:15:27]  Login to Pokemon Go successful. 
[21:15:27] 
[21:15:27]  --- TrainerName --- 
[21:15:27]  Level: 31 (Next Level: 188540 XP) (Total: 2811460 XP) 
[21:15:27]  Pokemon Captured: 5558 | Pokestops Visited: 6307 
[21:15:27]  Pokemon Bag: 152/300 
[21:15:27]  Items: 439/600 
[21:15:27]  Stardust: 320615 | Pokecoins: 30 
[21:15:27]  PokeBalls: 124 | GreatBalls: 20 | UltraBalls: 43 
[21:15:27]  RazzBerries: 49 | BlukBerries: 0 | NanabBerries: 0 
[21:15:27]  LuckyEgg: 12 | Incubator: 11 | TroyDisk: 5 
[21:15:27]  Potion: 1 | SuperPotion: 0 | HyperPotion: 0 
[21:15:27]  Incense: 22 | IncenseSpicy: 0 | IncenseCool: 0 
[21:15:27]  Revive: 0 | MaxRevive: 25 

...

[21:17:22]  Starting PokemonGo Bot.... 
[21:17:24] Using lucky egg ... you have 12
[21:17:42] Server is throttling, reconnecting in 30sec
[21:18:12] [x] Coordinates found in passed in location, not geocoding.
[21:18:12] 
[21:18:12] Location Found: 43.63954594864653,-79.3757164478302 // Jack Leyton Ferry
[21:18:12] GeoPosition: (43.6395459, -79.3757164, 0)
[21:18:12] 
[21:18:12] Attempting login to Pokemon Go.
[21:18:13]  Login to Pokemon Go successful. 
[21:18:14] 
[21:18:14]  --- TrainerName --- 
[21:18:14]  Level: 31 (Next Level: 188540 XP) (Total: 2811460 XP) 
[21:18:14]  Pokemon Captured: 5558 | Pokestops Visited: 6307 
[21:18:14]  Pokemon Bag: 152/300 
[21:18:14]  Items: 439/600 
[21:18:14]  Stardust: 320615 | Pokecoins: 30 
[21:18:14]  PokeBalls: 124 | GreatBalls: 20 | UltraBalls: 43 
[21:18:14]  RazzBerries: 49 | BlukBerries: 0 | NanabBerries: 0 
[21:18:14]  LuckyEgg: 12 | Incubator: 11 | TroyDisk: 5 
[21:18:14]  Potion: 1 | SuperPotion: 0 | HyperPotion: 0 
[21:18:14]  Incense: 22 | IncenseSpicy: 0 | IncenseCool: 0 
[21:18:14]  Revive: 0 | MaxRevive: 25 
[21:18:14] 
[21:18:14] 
[21:18:18]  Starting PokemonGo Bot.... 
[21:18:19] Using lucky egg ... you have 12
[21:18:37] Server is throttling, reconnecting in 30sec
[21:19:07] [x] Coordinates found in passed in location, not geocoding.
[21:19:07] 
[21:19:07] Location Found: 43.63954594864653,-79.3757164478302 // Jack Leyton Ferry
[21:19:07] GeoPosition: (43.6395459, -79.3757164, 0)
[21:19:07] 
[21:19:07] Attempting login to Pokemon Go.
[21:19:09]  Login to Pokemon Go successful. 
[21:19:10] 
[21:19:10]  --- TrainerName --- 
[21:19:10]  Level: 31 (Next Level: 188540 XP) (Total: 2811460 XP) 
[21:19:10]  Pokemon Captured: 5558 | Pokestops Visited: 6307 
[21:19:10]  Pokemon Bag: 152/300 
[21:19:10]  Items: 439/600 
[21:19:10]  Stardust: 320615 | Pokecoins: 30 
[21:19:10]  PokeBalls: 124 | GreatBalls: 20 | UltraBalls: 43 
[21:19:10]  RazzBerries: 49 | BlukBerries: 0 | NanabBerries: 0 
[21:19:10]  LuckyEgg: 12 | Incubator: 11 | TroyDisk: 5 
[21:19:10]  Potion: 1 | SuperPotion: 0 | HyperPotion: 0 
[21:19:10]  Incense: 22 | IncenseSpicy: 0 | IncenseCool: 0 
[21:19:10]  Revive: 0 | MaxRevive: 25 
[21:19:10] 
[21:19:10] 
[21:19:14]  Starting PokemonGo Bot.... 
[21:19:16] Using lucky egg ... you have 12
[21:19:39] Server is throttling, reconnecting in 30sec

Those are just a few, but you get the idea.

It eventually sorts itself out, but I've seen it waste at least 1 - 2 eggs trying.

I'd open a new issue, but since everyone's already here, figured I'd just post it and change the title.

Is the exception handler running after the EvolvePokemon task?

@Vvkmnn Vvkmnn changed the title [dev] Bot crashing on API throttling exception [dev] Bot using lucky eggs before reconnect after API exception Aug 3, 2016
@Vvkmnn
Copy link
Author

Vvkmnn commented Aug 3, 2016

Btw, if you want me to just make a new issue and close this one, lemme know.

@Vvkmnn
Copy link
Author

Vvkmnn commented Aug 3, 2016

Also, everything works much nicer with "use_lucky_egg": false. Seems to avoid the reconnection loop.

@paulohdc
Copy link

paulohdc commented Aug 3, 2016

Traceback (most recent call last):
File "pokecli.py", line 38, in
from pgoapi.exceptions import NotLoggedInException, ServerSideRequestThrottlingException, ServerBusyOrOfflineException
ImportError: cannot import name ServerSideRequestThrottlingException

@MikeLund
Copy link

MikeLund commented Aug 3, 2016

Hi, I am unsure if this is 100% related. But if you already have an egg active and run the script with use_lucky_egg:true, it will get into this loop:

[10:18:08] Using lucky egg ... you have 1
[10:18:28] Server is throttling, reconnecting in 30sec

Disabling egg fixes it.

@Vvkmnn
Copy link
Author

Vvkmnn commented Aug 3, 2016

Still occurring on commit 4a1f649.

use_lucky_egg:false does fix the loop.

@d0s000m
Copy link

d0s000m commented Aug 3, 2016

ok now i get only the spam

[16:16:23] Server is throttling, let's slow down a bit
[16:16:25] Server is throttling, let's slow down a bit
[16:16:26] Server is throttling, let's slow down a bit
[16:16:27] Server is throttling, let's slow down a bit
[16:16:28] Server is throttling, let's slow down a bit

But the bot is working

@mico
Copy link

mico commented Aug 8, 2016

same error: "Server throttled too many times" when using Lucky egg
after set Lucky Egg to false - starts working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants