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

1 hour running crash - None has type <type 'NoneType'>, but expected one of: (<type 'str'>, <type 'unicode'>)

Open noncicredo opened this issue 10 years ago • 8 comments

Expected Behavior

Bot should run without crashing

Actual Behavior

Bot stops running and crashes after 1 hour, giving this error

Traceback (most recent call last): File "pokecli.py", line 521, in main() File "pokecli.py", line 95, in main bot.tick() File "/Users/Alessio/PokemonGo-Bot/pokemongo_bot/init.py", line 441, in tick if worker.work() == WorkerResult.RUNNING: File "/Users/Alessio/PokemonGo-Bot/pokemongo_bot/cell_workers/evolve_pokemon.py", line 28, in work response_dict = self.api.get_inventory() File "/Users/Alessio/PokemonGo-Bot-Desktop/gofbot/src/pgoapi/pgoapi/pgoapi.py", line 122, in function return request.call() File "/Users/Alessio/PokemonGo-Bot/pokemongo_bot/api_wrapper.py", line 106, in call result = self._call() File "/Users/Alessio/PokemonGo-Bot/pokemongo_bot/api_wrapper.py", line 63, in _call return PGoApiRequest.call(self) File "/Users/Alessio/PokemonGo-Bot-Desktop/gofbot/src/pgoapi/pgoapi/pgoapi.py", line 220, in call response = request.request(self._api_endpoint, self._req_method_list, self.get_position()) File "/Users/Alessio/PokemonGo-Bot-Desktop/gofbot/src/pgoapi/pgoapi/rpc_api.py", line 126, in request request_proto = self._build_main_request(subrequests, player_position) File "/Users/Alessio/PokemonGo-Bot-Desktop/gofbot/src/pgoapi/pgoapi/rpc_api.py", line 216, in _build_main_request request.auth_info.token.contents = self._auth_provider.get_access_token() File "/usr/local/lib/python2.7/site-packages/google/protobuf/internal/python_message.py", line 669, in field_setter new_value = type_checker.CheckValue(new_value) File "/usr/local/lib/python2.7/site-packages/google/protobuf/internal/type_checkers.py", line 176, in CheckValue raise TypeError(message) TypeError: None has type <type 'NoneType'>, but expected one of: (<type 'str'>, <type 'unicode'>)

I've also tried ALL the trick found about that, even adding the token on line 94, but nothing worked

Steps to Reproduce

Let the bot running until the user stops it

Other Information

OS: OSX Last dev commit Python Version: 2.7

noncicredo avatar Aug 09 '16 01:08 noncicredo

same

icecubeice avatar Aug 09 '16 01:08 icecubeice

python 2016-08-09 11:32:17,053 [PokemonGoBot] [INFO] [login_started] Login procedure started. Traceback (most recent call last): File "pokecli.py", line 524, in <module> main() File "pokecli.py", line 140, in main report_summary(bot) File "pokecli.py", line 149, in report_summary metrics.capture_stats() File "/root/Bot/pokemongo_bot/metrics.py", line 76, in capture_stats response_dict = request.call() File "/root/Bot/pokemongo_bot/api_wrapper.py", line 106, in call result = self._call() File "/root/Bot/pokemongo_bot/api_wrapper.py", line 63, in _call return PGoApiRequest.call(self) File "/root/Bot/src/pgoapi/pgoapi/pgoapi.py", line 220, in call response = request.request(self._api_endpoint, self._req_method_list, self.get_position()) File "/root/Bot/src/pgoapi/pgoapi/rpc_api.py", line 126, in request request_proto = self._build_main_request(subrequests, player_position) File "/root/Bot/src/pgoapi/pgoapi/rpc_api.py", line 216, in _build_main_request request.auth_info.token.contents = self._auth_provider.get_access_token() File "/root/Bot/lib/python2.7/site-packages/google/protobuf/internal/python_message.py", line 669, in field_setter new_value = type_checker.CheckValue(new_value) File "/root/Bot/lib/python2.7/site-packages/google/protobuf/internal/type_checkers.py", line 176, in CheckValue raise TypeError(message) TypeError: None has type <type 'NoneType'>, but expected one of: (<type 'str'>, <type 'unicode'>)

und3fined avatar Aug 09 '16 04:08 und3fined

Same - 1 hour, bot crashes

nicholasjohn avatar Aug 09 '16 06:08 nicholasjohn

Same problem

2016-08-09 04:09:49,761 [RecycleItems] [INFO] [item_discarded] Discarded 1x Greatball (maximum 90).
2016-08-09 04:09:49,768 [MoveToFort] [INFO] [moving_to_lured_fort] Moving towards pokestop Ibirapuera Escultura - 0.07km (attraction of lure 0.07km)
2016-08-09 04:10:03,754 [       cli] [INFO] 
2016-08-09 04:10:03,755 [       cli] [INFO] Ran for 0:59:59
2016-08-09 04:10:03,755 [       cli] [INFO] Total XP Earned: 14210  Average: 14214.64/h
2016-08-09 04:10:03,755 [       cli] [INFO] Travelled 1.71km
2016-08-09 04:10:03,755 [       cli] [INFO] Visited 45 stops
2016-08-09 04:10:03,755 [       cli] [INFO] Encountered 26 pokemon, 26 caught, 33 released, 11 evolved, 0 never seen before
2016-08-09 04:10:03,755 [       cli] [INFO] Threw 33 pokeballs
2016-08-09 04:10:03,755 [       cli] [INFO] Earned 5053 Stardust
2016-08-09 04:10:03,755 [       cli] [INFO] 
2016-08-09 04:10:03,756 [       cli] [INFO] Highest CP Pokemon: Pinsir [CP: 535] [IV: 15/11/14] Potential: 0.89 
2016-08-09 04:10:03,756 [       cli] [INFO] Most Perfect Pokemon: Magikarp [CP: 18] [IV: 15/12/13] Potential: 0.89 
Traceback (most recent call last):
  File "pokecli.py", line 502, in <module>
    main()
  File "pokecli.py", line 133, in main
    raise e
TypeError: None has type <type 'NoneType'>, but expected one of: (<type 'str'>, <type 'unicode'>)

renatorib avatar Aug 09 '16 07:08 renatorib

Removed and updated pgoapi. 1+ hour running right now. No crash. Will update if it crashes (or not). ## Update: Total Run time 1h 08m Traceback (most recent call last): File "/usr/lib/python2.7/logging/init.py", line 851, in emit msg = self.format(record) File "/usr/lib/python2.7/logging/init.py", line 724, in format return fmt.format(record) File "/usr/lib/python2.7/logging/init.py", line 464, in format record.message = record.getMessage() File "/usr/lib/python2.7/logging/init.py", line 328, in getMessage msg = msg % self.args TypeError: not all arguments converted during string formatting Logged from file init.py, line 547

Followed by Traceback (most recent call last): File "pokecli.py", line 493, in main() File "pokecli.py", line 129, in main raise e TypeError: None has type <type 'NoneType'>, but expected one of: (<type 'str'>, <type 'unicode'>)

pranavperfect avatar Aug 09 '16 07:08 pranavperfect

Duplicate of #2864, #2874

pranavperfect avatar Aug 09 '16 08:08 pranavperfect

update to latest dev and upgrade pip packages

eriweb avatar Aug 09 '16 13:08 eriweb

This should be resolved with #3241 being merged days ago.

leadboots5 avatar Aug 11 '16 21:08 leadboots5