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

KeyError: 'GET_INVENTORY'

Open kinvaris opened this issue 10 years ago • 14 comments

Expected Behavior

The application to work

Actual Behavior

(PokemonGo-Bot) jonas@moon:~/PokemonGo-Bot⟫ ./pokecli.py --config config.json 
[2016-08-02 06:50:01] [x] PokemonGO Bot v1.0
[2016-08-02 06:50:01] [x] Configuration initialized
[2016-08-02 06:50:01] 
[2016-08-02 06:50:01] [x] Address found: Belgium, Kortrijk
[2016-08-02 06:50:01] [x] Position in-game set as: (50.8194776, 3.2577263, 0.0)
[2016-08-02 06:50:01] 
Traceback (most recent call last):
  File "./pokecli.py", line 220, in <module>
    main()
  File "./pokecli.py", line 206, in main
    bot.start()
  File "/home/jonas/PokemonGo-Bot/pokemongo_bot/__init__.py", line 31, in start
    self._setup_api()
  File "/home/jonas/PokemonGo-Bot/pokemongo_bot/__init__.py", line 159, in _setup_api
    balls_stock = self.pokeball_inventory()
  File "/home/jonas/PokemonGo-Bot/pokemongo_bot/__init__.py", line 234, in pokeball_inventory
    inventory_dict = inventory_req['responses']['GET_INVENTORY'][
KeyError: 'GET_INVENTORY'

Steps to Reproduce

./pokecli.py --config config.json

Other Information

OS: Linux moon 3.13.0-85-generic #129-Ubuntu SMP Thu Mar 17 20:50:15 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux Git Commit: 4182e93f9bfbe471d07b74e95c55cdfbacda127b Python Version: Python 2.7.6

kinvaris avatar Aug 02 '16 10:08 kinvaris

Happened to me in master branch few days ago. I just launched the bot again and it worked.

pawamoy avatar Aug 02 '16 11:08 pawamoy

Issue: #1491

Lunik avatar Aug 02 '16 11:08 Lunik

works in dev.

maestroi avatar Aug 02 '16 13:08 maestroi

Hello, I read in several posts that say, in dev works. But I can download dev ??? that command must write ??

ingcrengifo avatar Aug 02 '16 13:08 ingcrengifo

@INGCRENGIFO read the wiki..

maestroi avatar Aug 02 '16 13:08 maestroi

please close @MFizz is right

maestroi avatar Aug 02 '16 13:08 maestroi

@maestroi I do that? https://github.com/PokemonGoF/PokemonGo-Bot/wiki/Develop-PokemonGo-Bot

ingcrengifo avatar Aug 02 '16 13:08 ingcrengifo

@INGCRENGIFO go to your bot directory then write: git checkout dev

then pip install -r requirements.txt

then you should be good to go

MFizz avatar Aug 02 '16 13:08 MFizz

@INGCRENGIFO for new clone:

git clone -b dev https://github.com/PokemonGoF/PokemonGo-Bot.git

maestroi avatar Aug 02 '16 13:08 maestroi

@maestroi Thank you very much, sorry if my questions seem simple but the language barrier makes me a little difficult to understand the manuals.

ingcrengifo avatar Aug 02 '16 13:08 ingcrengifo

Thank you very much @maestroi @MFizz This new version is great !!!!!! :)

ingcrengifo avatar Aug 02 '16 14:08 ingcrengifo

I don't understand why in master config we have "relese_under_cp" while in dev is "release_below_cp". Plus there are other differences. Am I wrong?

iruy avatar Aug 02 '16 18:08 iruy

Also happens on dev

Had a solid run for 11 hours. Then another for 45 minutes after which it kept crashing with different KeyErrors;

Crash errors in this order:

KeyError: 'inventory_delta' KeyError: 'inventory_delta' KeyError: 'player_data'

Same config that ran just fine over 11 hours. Maybe server-response related?

Other Information

OS: Windows 10 Git Commit: b8eda52478bf216fab0561eb4fcd550a4e9721f4 Python Version: Python 2.7.12

webbertakken avatar Aug 03 '16 18:08 webbertakken

Update: shortly after i got this traceback. 502 = Bad Gateway;

Edit: Guess: This may be related to a server rebooting, but still in the loadbalancing pool.

Edit 2: Seems to be working just fine again 2 minutes later.

Traceback (most recent call last): File "pokecli.py", line 442, in main() File "pokecli.py", line 63, in main bot.start() File "C:\PokemonGoBot\dev\PokemonGo-Bot\pokemongo_bot__init__.py", line 61, in start self.setup_api() File "C:\PokemonGoBot\dev\PokemonGo-Bot\pokemongo_bot__init_.py", line 290, in setup_api self.update_web_location() File "C:\PokemonGoBot\dev\PokemonGo-Bot\pokemongo_bot__init_.py", line 150, in update_web_location gym_longitude=fort.get('longitude') File "c:\pokemongobot\dev\pokemongo-bot\src\pgoapi\pgoapi\pgoapi.py", line 84, in function return request.call() File "C:\PokemonGoBot\dev\PokemonGo-Bot\pokemongo_bot\api_wrapper.py", line 100, in call result = self._call() File "C:\PokemonGoBot\dev\PokemonGo-Bot\pokemongo_bot\api_wrapper.py", line 60, in _call return PGoApiRequest.call(self) File "c:\pokemongobot\dev\pokemongo-bot\src\pgoapi\pgoapi\pgoapi.py", line 182, in call response = request.request(self._api_endpoint, self._req_method_list, self.get_position()) File "c:\pokemongobot\dev\pokemongo-bot\src\pgoapi\pgoapi\rpc_api.py", line 106, in request response_dict = self._parse_main_response(response, subrequests) File "c:\pokemongobot\dev\pokemongo-bot\src\pgoapi\pgoapi\rpc_api.py", line 237, in _parse_main_response raise UnexpectedResponseException(error) pgoapi.exceptions.UnexpectedResponseException: Unexpected HTTP server response - needs 200 got 502

webbertakken avatar Aug 03 '16 18:08 webbertakken