PokemonGoF / PokemonGo-Bot

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

KeyError: 'returns' #1092

Closed DavidTai1 closed 8 years ago

DavidTai1 commented 8 years ago

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)

AdaptCharm commented 8 years ago

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

DavidTai1 commented 8 years ago

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

JonathanRosado commented 8 years ago

It happens at startup for me... image

kriswong commented 8 years ago

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...

DavidTai1 commented 8 years ago

Thanks for the fix : ) @kriswong

kriswong commented 8 years ago

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.

AdaptCharm commented 8 years ago

This issue has been solved.

/closed

kriswong commented 8 years ago

We have an issue.

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

snorlaxrazzi commented 8 years ago

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.