PokemonGoF / PokemonGo-Bot

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

bot not running #5909

Closed saliapin closed 7 years ago

saliapin commented 7 years ago

I am consistently getting this error at bot start. Is this the same issue as #5900 ?

Expected Behavior

Bot starts

Actual Behavior

Bot stops immediately.

Your FULL config.json (remove your username, password, gmapkey and any other private info)

default with hash key activated

Output when issue occurred

2017-02-13 15:50:58,216 [ cli] [INFO] PokemonGO Bot v1.0 2017-02-13 15:50:58,224 [ cli] [INFO] commit: 024d3253 2017-02-13 15:50:58,228 [ cli] [INFO] Configuration initialized 2017-02-13 15:50:58,229 [pokemongo_bot.health_record.bot_event] [INFO] Health check is enabled. For more information: 2017-02-13 15:50:58,229 [pokemongo_bot.health_record.bot_event] [INFO] https://github.com/PokemonGoF/PokemonGo-Bot/tree/dev#analytics 2017-02-13 15:50:58,247 [requests.packages.urllib3.connectionpool] [INFO] Starting new HTTP connection (1): www.google-analytics.com [2017-02-13 15:50:58] [yoyo.migrations] [INFO] Applying pokemongobot [2017-02-13 15:50:58] [yoyo.migrations] [INFO] - applying step 0 [2017-02-13 15:50:58] [yoyo.migrations] [INFO] Marking pokemongobot applied [2017-02-13 15:50:58] [yoyo.migrations] [INFO] Applying catch_log [2017-02-13 15:50:58] [yoyo.migrations] [INFO] - applying step 0 [2017-02-13 15:50:58] [yoyo.migrations] [INFO] Marking catch_log applied [2017-02-13 15:50:58] [yoyo.migrations] [INFO] Applying eggs_hatched_log [2017-02-13 15:50:58] [yoyo.migrations] [INFO] - applying step 0 [2017-02-13 15:50:58] [yoyo.migrations] [INFO] Marking eggs_hatched_log applied [2017-02-13 15:50:58] [yoyo.migrations] [INFO] Applying evolve_log [2017-02-13 15:50:58] [yoyo.migrations] [INFO] - applying step 0 [2017-02-13 15:50:58] [yoyo.migrations] [INFO] Marking evolve_log applied [2017-02-13 15:50:58] [yoyo.migrations] [INFO] Applying pokestop_log [2017-02-13 15:50:58] [yoyo.migrations] [INFO] - applying step 0 [2017-02-13 15:50:58] [yoyo.migrations] [INFO] Marking pokestop_log applied [2017-02-13 15:50:58] [yoyo.migrations] [INFO] Applying softban_log [2017-02-13 15:50:58] [yoyo.migrations] [INFO] - applying step 0 [2017-02-13 15:50:58] [yoyo.migrations] [INFO] Marking softban_log applied [2017-02-13 15:50:58] [yoyo.migrations] [INFO] Applying transfer_log [2017-02-13 15:50:58] [yoyo.migrations] [INFO] - applying step 0 [2017-02-13 15:50:58] [yoyo.migrations] [INFO] Marking transfer_log applied [2017-02-13 15:50:58] [yoyo.migrations] [INFO] Applying vanish_log [2017-02-13 15:50:58] [yoyo.migrations] [INFO] - applying step 0 [2017-02-13 15:50:58] [yoyo.migrations] [INFO] Marking vanish_log applied (7379) wsgi starting up on http://127.0.0.1:4000 [2017-02-13 15:50:58] [SleepSchedule] [INFO] Next sleep at 18:00:47, for a duration of 00:59:43 [2017-02-13 15:50:58] [PokemonGoBot] [INFO] Setting start location. [2017-02-13 15:50:58] [PokemonGoBot] [INFO] Favorite location found: work ([xxx]) [2017-02-13 15:50:58] [PokemonGoBot] [INFO] Location found: Work (xxx) [2017-02-13 15:50:58] [PokemonGoBot] [INFO] Now at (xxx) [2017-02-13 15:50:58] [PokemonGoBot] [INFO] Login procedure started. _inventory was not initialized _inventory was not initialized [2017-02-13 15:51:00] [ cli] [INFO] [2017-02-13 15:51:00] [ cli] [INFO] Ran for 0:00:02 [2017-02-13 15:51:00] [ cli] [INFO] Total XP Earned: 0 Average: 0.00/h [2017-02-13 15:51:00] [ cli] [INFO] Travelled 0.00km [2017-02-13 15:51:00] [ cli] [INFO] Visited 0 stops [2017-02-13 15:51:00] [ cli] [INFO] Encountered 0 pokemon, 0 caught, 0 released, 0 evolved, 0 never seen before () [2017-02-13 15:51:00] [ cli] [INFO] Threw 0 pokeballs [2017-02-13 15:51:00] [ cli] [INFO] Earned 0 Stardust [2017-02-13 15:51:00] [ cli] [INFO] Hatched eggs 0 [2017-02-13 15:51:00] [ cli] [INFO] [2017-02-13 15:51:00] [ cli] [INFO] Highest CP Pokemon: [2017-02-13 15:51:00] [ cli] [INFO] Most Perfect Pokemon: Traceback (most recent call last): File "pokecli.py", line 865, in main() File "pokecli.py", line 195, in main bot = start_bot(bot, config) File "pokecli.py", line 147, in start_bot bot.start() File "/Users/xxx/PokemonGo-Bot/pokemongo_bot/init.py", line 153, in start self._setup_api() File "/Users/xxx/PokemonGo-Bot/pokemongo_bot/init.py", line 1076, in _setup_api self.login() File "/Users/xxx/PokemonGo-Bot/pokemongo_bot/init.py", line 953, in login str(self.config.password)) File "/Users/xxx/PokemonGo-Bot/pokemongo_bot/api_wrapper.py", line 132, in login response = PGoApi.app_simulation_login(self) File "/Users/xxx/PokemonGo-Bot/lib/python2.7/site-packages/pgoapi/pgoapi.py", line 152, in app_simulation_login response = request.call() File "/Users/xxx/PokemonGo-Bot/lib/python2.7/site-packages/pgoapi/pgoapi.py", line 264, in call response = request.request(self._api_endpoint, self._req_method_list, self.get_position()) File "/Users/xxx/PokemonGo-Bot/lib/python2.7/site-packages/pgoapi/rpc_api.py", line 153, in request self.request_proto = self.request_proto or self._build_main_request(subrequests, player_position) File "/Users/xxx/PokemonGo-Bot/lib/python2.7/site-packages/pgoapi/rpc_api.py", line 233, in _build_main_request self._hash_engine.hash(sig.timestamp, request.latitude, request.longitude, request.accuracy, ticket_serialized, sig.session_hash, request.requests) File "/Users/xxx/PokemonGo-Bot/lib/python2.7/site-packages/pgoapi/hash_server.py", line 47, in hash raise BadHashRequestException("400: Bad request, error: {}".format(response.text)) pgoapi.exceptions.BadHashRequestException: 400: Bad request, error: Unauthorized [2017-02-13 15:51:00] [sentry.errors] [ERROR] Sentry responded with an error: 'ascii' codec can't decode byte 0x9c in position 1: ordinal not in range(128) (url: https://app.getsentry.com/api/90254/store/) Traceback (most recent call last): File "/Users/xxx/PokemonGo-Bot/lib/python2.7/site-packages/raven/transport/threaded.py", line 174, in send_sync super(ThreadedHTTPTransport, self).send(data, headers) File "/Users/xxx/PokemonGo-Bot/lib/python2.7/site-packages/raven/transport/http.py", line 47, in send ca_certs=self.ca_certs, File "/Users/xxx/PokemonGo-Bot/lib/python2.7/site-packages/raven/utils/http.py", line 66, in urlopen return opener.open(url, data, timeout) File "/Users/xxx/PokemonGo-Bot/lib/python2.7/site-packages/future/backports/urllib/request.py", line 494, in open response = self._open(req, data) File "/Users/xxx/PokemonGo-Bot/lib/python2.7/site-packages/future/backports/urllib/request.py", line 512, in _open '_open', req) File "/Users/xxx/PokemonGo-Bot/lib/python2.7/site-packages/future/backports/urllib/request.py", line 466, in _call_chain result = func(*args) File "/Users/xxx/PokemonGo-Bot/lib/python2.7/site-packages/raven/utils/http.py", line 46, in https_open return self.do_open(ValidHTTPSConnection, req) File "/Users/xxx/PokemonGo-Bot/lib/python2.7/site-packages/future/backports/urllib/request.py", line 1284, in do_open h.request(req.get_method(), req.selector, req.data, headers) File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1057, in request self._send_request(method, url, body, headers) File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1097, in _send_request self.endheaders(body) File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1053, in endheaders self._send_output(message_body) File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 895, in _send_output msg += message_body UnicodeDecodeError: 'ascii' codec can't decode byte 0x9c in position 1: ordinal not in range(128) [2017-02-13 15:51:00] [sentry.errors.uncaught] [ERROR] [u'BadHashRequestException: 400: Bad request, error: Unauthorized', u' File "pokecli.py", line 865, in ', u' File "pokecli.py", line 195, in main', u' File "pokecli.py", line 147, in start_bot', u' File "pokemongo_bot/init.py", line 153, in start', u' File "pokemongo_bot/init.py", line 1076, in _setup_api', u' File "pokemongo_bot/init.py", line 953, in login', u' File "pokemongo_bot/api_wrapper.py", line 132, in login', u' File "pgoapi/pgoapi.py", line 152, in app_simulation_login', u' File "pgoapi/pgoapi.py", line 264, in call', u' File "pgoapi/rpc_api.py", line 153, in request', u' File "pgoapi/rpc_api.py", line 233, in _build_main_request', u' File "pgoapi/hash_server.py", line 47, in hash'] Mon Feb 13 15:51:00 PST 2017 Pokebot Stopped. Press any button or wait 20 seconds to continue.

Steps to Reproduce

./run.sh Every time.

Other Information

OS: OSX Branch: dev and master, both do it Git Commit: 024d3253 (dev) Python Version: 2.7.12

MerlionRock commented 7 years ago

Did you have a valid hash key? Make sure you copy and paste and not type them in

davidakachaos commented 7 years ago

I also think it's because you have an invalid/missing hash, because of this line in the log you posted:

pgoapi.exceptions.BadHashRequestException: 400: Bad request, error: Unauthorized
saliapin commented 7 years ago

I am using a new hash key bought today from www.buddyauth.com. Here is the evidence it is active:

Keys

ACTIVE Purchased Activated (First Used) Allowed Days Allowed Sessions Key Expires Type Last Region Actions 2/13/2017 10:36:13 PM 2/13/2017 10:37:19 PM 92 1 redacted 5/16/2017 10:37:19 PM Pokefarmer Europe Disable Tripwire

Copied and pasted it into auth.json. Here is my auth.json (redacted): { "auth_service": "ptc", "username": "xxx", "password": "yyy", "location": "Home", "favorite_locations":[ {"name": "Home", "coords": "X,Z"} ], "gmapkey": "mygmapkey-working", "hashkey" : "20-characters-hash-key-active", "encrypt_location": "" }

snorlax100 commented 7 years ago

@saliapin you may have made the same mistake as I did - the links to buy a hashing key can be found at: https://talk.pogodev.org/d/51-api-hashing-service-by-pokefarmer When you say you bought it from the website, I suspect you bought a PokeFarmer key; These are not the same as the keys used for the hashing service. Both are 20 characters long.

saliapin commented 7 years ago

@snorlax100 Bingo! I think you hit the nail on the head! I wrote to www.buddyauth.com to try and correct this silly mistake. Thanks also @davidakachaos and @MerlionRock for your correct comments.