Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BadHashRequestException #5981

Closed
Yasheshpandita opened this issue Mar 28, 2017 · 6 comments
Closed

BadHashRequestException #5981

Yasheshpandita opened this issue Mar 28, 2017 · 6 comments

Comments

@Yasheshpandita
Copy link

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/user123/Desktop/PokemonGo-Bot-master/pokemongo_bot/init.py", line 155, in start
self._setup_api()
File "/Users/user123/Desktop/PokemonGo-Bot-master/pokemongo_bot/init.py", line 1149, in _setup_api
self.login()
File "/Users/user123/Desktop/PokemonGo-Bot-master/pokemongo_bot/init.py", line 957, in login
str(self.config.password))
File "/Users/user123/Desktop/PokemonGo-Bot-master/pokemongo_bot/api_wrapper.py", line 108, in login
response = PGoApi.app_simulation_login(self)
File "/Users/user123/Desktop/PokemonGo-Bot-master/lib/python2.7/site-packages/pgoapi/pgoapi.py", line 152, in app_simulation_login
response = request.call()
File "/Users/user123/Desktop/PokemonGo-Bot-master/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/user123/Desktop/PokemonGo-Bot-master/lib/python2.7/site-packages/pgoapi/rpc_api.py", line 149, in request
self.request_proto = self.request_proto or self._build_main_request(subrequests, player_position)
File "/Users/user123/Desktop/PokemonGo-Bot-master/lib/python2.7/site-packages/pgoapi/rpc_api.py", line 229, 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/user123/Desktop/PokemonGo-Bot-master/lib/python2.7/site-packages/pgoapi/hash_server.py", line 48, in hash
raise BadHashRequestException("400: Bad request, error: {}".format(response.text))
pgoapi.exceptions.BadHashRequestException: 400: Bad request, error: Unauthorized
[2017-03-29 01:00:16] [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/user123/Desktop/PokemonGo-Bot-master/lib/python2.7/site-packages/raven/transport/threaded.py", line 174, in send_sync
super(ThreadedHTTPTransport, self).send(data, headers)
File "/Users/user123/Desktop/PokemonGo-Bot-master/lib/python2.7/site-packages/raven/transport/http.py", line 47, in send
ca_certs=self.ca_certs,
File "/Users/user123/Desktop/PokemonGo-Bot-master/lib/python2.7/site-packages/raven/utils/http.py", line 66, in urlopen
return opener.open(url, data, timeout)
File "/Users/user123/Desktop/PokemonGo-Bot-master/lib/python2.7/site-packages/future/backports/urllib/request.py", line 494, in open
response = self._open(req, data)
File "/Users/user123/Desktop/PokemonGo-Bot-master/lib/python2.7/site-packages/future/backports/urllib/request.py", line 512, in _open
'_open', req)
File "/Users/user123/Desktop/PokemonGo-Bot-master/lib/python2.7/site-packages/future/backports/urllib/request.py", line 466, in _call_chain
result = func(*args)
File "/Users/user123/Desktop/PokemonGo-Bot-master/lib/python2.7/site-packages/raven/utils/http.py", line 46, in https_open
return self.do_open(ValidHTTPSConnection, req)
File "/Users/user123/Desktop/PokemonGo-Bot-master/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.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1042, in request
self._send_request(method, url, body, headers)
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1082, in _send_request
self.endheaders(body)
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1038, in endheaders
self._send_output(message_body)
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 880, in _send_output
msg += message_body
UnicodeDecodeError: 'ascii' codec can't decode byte 0x9c in position 1: ordinal not in range(128)
[2017-03-29 01:00:16] [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 155, in start', u' File "pokemongo_bot/init.py", line 1149, in _setup_api', u' File "pokemongo_bot/init.py", line 957, in login', u' File "pokemongo_bot/api_wrapper.py", line 108, 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 149, in request', u' File "pgoapi/rpc_api.py", line 229, in _build_main_request', u' File "pgoapi/hash_server.py", line 48, in hash']

@pogarek
Copy link
Contributor

pogarek commented Mar 28, 2017

looks like wrong/missing hashing key

@Yasheshpandita
Copy link
Author

Server is throttling, reconnecting in 853 seconds
Exception in thread Thread-4:
Traceback (most recent call last):
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 1073, in run
self.function(*self.args, **self.kwargs)
File "/Users/yasheshpandita/Desktop/PokemonGo-Bot-master/pokemongo_bot/init.py", line 1510, in heartbeat
responses = request.call()
File "/Users/yasheshpandita/Desktop/PokemonGo-Bot-master/pokemongo_bot/api_wrapper.py", line 222, in call
raise ServerSideRequestThrottlingException('Server throttled too many times')
ServerSideRequestThrottlingException: Server throttled too many times

@Yasheshpandita
Copy link
Author

Yasheshpandita commented Mar 30, 2017

This occurs like 5-6 times before it is sucessful. What should be done ??
And the bot works for like 5 mins max before giving the same exception.

@MerlionRock
Copy link
Contributor

So did you have a vaild hash key?

It is no longer possible to run the bot without hashing service.

@Yasheshpandita
Copy link
Author

Yes i do. And it runs for sometime then gets disconnected.

@davidakachaos
Copy link
Contributor

Closing old issue, if you think this is an error let me know or open a new issue. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants