PokemonGo-Bot icon indicating copy to clipboard operation
PokemonGo-Bot copied to clipboard

KeyError: 'GET_INVENTORY'

Open Lunik opened this issue 10 years ago • 35 comments

Expected Behavior

Actual Behavior

Traceback (most recent call last):
  File "./pokecli.py", line 357, in <module>
    main()
  File "./pokecli.py", line 68, in main
    bot.tick()
  File "/home/lunik/PokemonGo-Bot/pokemongo_bot/__init__.py", line 64, in tick
    if worker(self).work() == WorkerResult.RUNNING:
  File "/home/lunik/PokemonGo-Bot/pokemongo_bot/cell_workers/recycle_items_worker.py", line 14, in work
    item_count_dict = self.bot.item_inventory_count('all')
  File "/home/lunik/PokemonGo-Bot/pokemongo_bot/__init__.py", line 361, in item_inventory_count
    'GET_INVENTORY']['inventory_delta']['inventory_items']
KeyError: 'GET_INVENTORY'

Steps to Reproduce

run ./run.sh in dev branch

Other Information

OS: Ubuntu Git Commit: c11af09b64df4be77257207dfd147649489c776e

Lunik avatar Jul 28 '16 21:07 Lunik

I'm getting the same. Traceback (most recent call last): File "pokecli.py", line 357, in <module> main() File "pokecli.py", line 68, in main bot.tick() File "/root/pgo/dev/PokemonGo-Bot/pokemongo_bot/__init__.py", line 64, in tick if worker(self).work() == WorkerResult.RUNNING: File "/root/pgo/dev/PokemonGo-Bot/pokemongo_bot/cell_workers/recycle_items_worker.py", line 14, in work item_count_dict = self.bot.item_inventory_count('all') File "/root/pgo/dev/PokemonGo-Bot/pokemongo_bot/__init__.py", line 361, in item_inventory_count 'GET_INVENTORY']['inventory_delta']['inventory_items'] KeyError: 'GET_INVENTORY'

banksymate avatar Jul 28 '16 21:07 banksymate

I can confirm and replicate this issue

./pokecli.py -cf conf.json [21:24:04] PokemonGO Bot v1.0 [21:24:04] Configuration initialized [21:24:04] [x] Coordinates found in passed in location, not geocoding. [21:24:04] [21:24:04] Location Found: ** [21:24:04] GeoPosition: (**) [21:24:04] [21:24:04] Attempting login to Pokemon Go. [21:24:05] Login to Pokemon Go successful. Traceback (most recent call last): File "./pokecli.py", line 357, in main() File "./pokecli.py", line 62, in main bot.start() File "/var/www/PokemonGo-Bot/pokemongo_bot/init.py", line 44, in start self._setup_api() File "/var/www/PokemonGo-Bot/pokemongo_bot/init.py", line 234, in _setup_api self._print_character_info() File "/var/www/PokemonGo-Bot/pokemongo_bot/init.py", line 265, in _print_character_info items_stock = self.current_inventory() File "/var/www/PokemonGo-Bot/pokemongo_bot/init.py", line 335, in current_inventory inventory_dict = inventory_req['responses']['GET_INVENTORY'][ KeyError: 'GET_INVENTORY'

d0t1q avatar Jul 28 '16 21:07 d0t1q

May be an issue with Pokemon GO servers.

banksymate avatar Jul 28 '16 21:07 banksymate

Can confirm, running bot exits wirh map_cells, and after restart GET_INVENTORY. Oh well, servers were really unstable today ;)

ramponee avatar Jul 28 '16 21:07 ramponee

Servers have been going up and down all day so the API can't return any info.

jonathanbalagot avatar Jul 28 '16 21:07 jonathanbalagot

Not sure about that, this only happened after I ran a pull request, and another account of mine running via the main branch is running fine.

And this commit did have a change to the init.py file and they introduced an api wrapper file

https://github.com/PokemonGoF/PokemonGo-Bot/commit/c11af09b64df4be77257207dfd147649489c776e

The servers are fine now, there were unstable a few hours ago but you can still run any api call you want(manually) if I can run an api call but the bot cant, its a problem with the code

d0t1q avatar Jul 28 '16 21:07 d0t1q

same issue here, I think the problem is server related, too but maybe they changed something... so the bot cn't parse correctly inventory infos. btw i'm just guessing....

A7F avatar Jul 28 '16 21:07 A7F

Maybe they're starting to block API requests that aren't using the "random bytes" https://www.reddit.com/r/pokemongodev/comments/4tzgbw/anyone_knowing_more_about_the_infamous_unknown/ edit: just saw d0t1q's post.

banksymate avatar Jul 28 '16 21:07 banksymate

Severs are unstable rn thats it dont worry guys

incizzle avatar Jul 28 '16 21:07 incizzle

ignore

banksymate avatar Jul 28 '16 21:07 banksymate

it's a server instability issue. this has been happening on both google accounts and ptc accounts

aTadTasty avatar Jul 28 '16 21:07 aTadTasty

Well since I can get my inventory when I am logged in in the actual application I wonder why the bot has this errors :(

skartoffel avatar Jul 28 '16 21:07 skartoffel

ya same here @skartoffel works on iphone just fine aswel ass on bluestacks android emulator

Dunduro avatar Jul 28 '16 21:07 Dunduro

~~Not sure if this is related, maybe someone can confirm:~~

~~My inventory was full. I opened the app, cleared some things out, set stricter limits in config.json, and then removed data/cells-[username].json before restarting.~~

~~It works for me now, though that could be coincidence. Need someone to confirm.~~

Update: Lasted for about 10 minutes, it's back now.

Kujawadl avatar Jul 28 '16 21:07 Kujawadl

Inventory was not full, deleting cells-username.json did nothing :(

skartoffel avatar Jul 28 '16 21:07 skartoffel

my inventory is NOT full. Still encountering this problem with the bot. Able to login to the game on my phone.

pickerflicker avatar Jul 28 '16 21:07 pickerflicker

Also, not only did it work on my phone while the bot was failing, but I have a second bot for my brother's account that is working just fine, so I think it's unlikely to be a server problem.

Kujawadl avatar Jul 28 '16 21:07 Kujawadl

@Kujawadl are the same bots? I mean, same bots with same commits?

A7F avatar Jul 28 '16 21:07 A7F

@A7F i was running 2 bots aswel and 1 failed a good 20-30 minutes before the other one, running on same install just different screen sessions

Dunduro avatar Jul 28 '16 21:07 Dunduro

@A7F Yes, same commits. His has been running several hours now without problems, mine crashes immediately after login.

Running on different screen sessions like @Dunduro

Kujawadl avatar Jul 28 '16 21:07 Kujawadl