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

KeyError: 'returns'

Open DavidTai1 opened this issue 10 years ago • 9 comments

Expected Behavior

Continue work...

Actual Behavior

[2016-07-26 19:12:50] [x] Captured Doduo! [CP 189] [IV 0.51] [2016-07-26 19:12:50] [#] Doduo has been exchanged for candy! Traceback (most recent call last): File "pokecli.py", line 220, in main() File "pokecli.py", line 211, in main bot.take_step() File "/Users/David/Dropbox/pokbot/PokemonGo-Bot/pokemongo_bot/init.py", line 36, in take_step self.stepper.take_step() File "/Users/David/Dropbox/pokbot/PokemonGo-Bot/pokemongo_bot/stepper.py", line 62, in take_step self._work_at_position(position[0], position[1], position[2], True) File "/Users/David/Dropbox/pokbot/PokemonGo-Bot/pokemongo_bot/stepper.py", line 139, in _work_at_position self.bot.work_on_cell(cell, position, pokemon_only) File "/Users/David/Dropbox/pokbot/PokemonGo-Bot/pokemongo_bot/init.py", line 93, in work_on_cell worker.work() File "/Users/David/Dropbox/pokbot/PokemonGo-Bot/pokemongo_bot/cell_workers/move_to_fort_worker.py", line 30, in work self.stepper._walk_to(self.config.walk, *position) File "/Users/David/Dropbox/pokbot/PokemonGo-Bot/pokemongo_bot/stepper.py", line 88, in _walk_to alt, False) File "/Users/David/Dropbox/pokbot/PokemonGo-Bot/pokemongo_bot/stepper.py", line 139, in _work_at_position self.bot.work_on_cell(cell, position, pokemon_only) File "/Users/David/Dropbox/pokbot/PokemonGo-Bot/pokemongo_bot/init.py", line 76, in work_on_cell if self.catch_pokemon(pokemon) == PokemonCatchWorker.NO_POKEBALLS: File "/Users/David/Dropbox/pokbot/PokemonGo-Bot/pokemongo_bot/init.py", line 190, in catch_pokemon return_value = worker.work() File "/Users/David/Dropbox/pokbot/PokemonGo-Bot/pokemongo_bot/cell_workers/pokemon_catch_worker.py", line 30, in work response_dict = self.api.call() File "/Users/David/Dropbox/pokbot/PokemonGo-Bot/src/pgoapi/pgoapi/pgoapi.py", line 80, in call response = request.request(api_endpoint, self._req_method_list, player_position) File "/Users/David/Dropbox/pokbot/PokemonGo-Bot/src/pgoapi/pgoapi/rpc_api.py", line 93, in request response_dict = self._parse_main_response(response, subrequests) File "/Users/David/Dropbox/pokbot/PokemonGo-Bot/src/pgoapi/pgoapi/rpc_api.py", line 201, in _parse_main_response response_proto_dict = self._parse_sub_responses(response_proto, subrequests, response_proto_dict) File "/Users/David/Dropbox/pokbot/PokemonGo-Bot/src/pgoapi/pgoapi/rpc_api.py", line 208, in _parse_sub_responses del response_proto_dict['returns'] KeyError: 'returns'

Steps to Reproduce

Run about 1 hour, it just crashed.

Other Information

OS: Mac OS X 10.11.5 Git Commit: (run 'git log -n 1 --pretty=format:"%H"' and paste it here)

DavidTai1 avatar Jul 27 '16 00:07 DavidTai1

Please run this command: git log -n 1 --pretty=format:"%H" and tell me your result.

AdaptCharm avatar Jul 27 '16 01:07 AdaptCharm

@TheGoldenXY =format:3aca6d798f8a3e173dce0beb7b13c9505cc5b251 This is the newest version for code

DavidTai1 avatar Jul 27 '16 01:07 DavidTai1

It happens at startup for me... image

JonathanRosado avatar Jul 27 '16 01:07 JonathanRosado

See this thread [https://github.com/tejado/pgoapi/issues/77] and the fix seems to have been pushed on 1f25e90

I would consider doing a merge for that...

kriswong avatar Jul 27 '16 02:07 kriswong

Thanks for the fix : ) @kriswong

DavidTai1 avatar Jul 27 '16 02:07 DavidTai1

No problem! If you want an easy way to fix this (and avoid the 1 hour log out, still to be tested) go into the ~/PokemonGo-Bot/src/pgoapi/pgoapi/ folder and run the following: git reset --hard HEAD git pull

Shoudl resolve at least it did for me.

kriswong avatar Jul 27 '16 02:07 kriswong

This issue has been solved.

/closed

AdaptCharm avatar Jul 27 '16 02:07 AdaptCharm

We have an issue.

This solution conflicts with Issue # 1042. If you do one you will get the other issue.

kriswong avatar Jul 27 '16 02:07 kriswong

I fixed issue #1042 and after 2 hours of running the bot, got the same 'KeyError: 'returns'' error.

Now ran pip install -r requirements.txt again and it has restarted fine. Lets see how long it lasts.

snorlaxrazzi avatar Jul 27 '16 12:07 snorlaxrazzi