PokemonGoF / PokemonGo-Bot

The Pokemon Go Bot, baking with community.
MIT License
3.85k stars 1.54k forks source link

KeyError: 'GET_INVENTORY' #2332

Closed kinvaris closed 7 years ago

kinvaris commented 7 years ago

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

pawamoy commented 7 years ago

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

Lunik commented 7 years ago

Issue: #1491

maestroi commented 7 years ago

works in dev.

ingcrengifo commented 7 years ago

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

maestroi commented 7 years ago

@INGCRENGIFO read the wiki..

maestroi commented 7 years ago

please close @MFizz is right

ingcrengifo commented 7 years ago

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

MFizz commented 7 years ago

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

then pip install -r requirements.txt

then you should be good to go

maestroi commented 7 years ago

@INGCRENGIFO for new clone:

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

ingcrengifo commented 7 years ago

@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 commented 7 years ago

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

iruy commented 7 years ago

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?

webbertakken commented 7 years ago

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 commented 7 years ago

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_botinit.py", line 61, in start self._setup_api() File "C:\PokemonGoBot\dev\PokemonGo-Bot\pokemongo_botinit.py", line 290, in _setup_api self.update_web_location() File "C:\PokemonGoBot\dev\PokemonGo-Bot\pokemongo_botinit.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