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

bot crashed with UnicodeDecodeError #3343

Closed
buzzo123 opened this issue Aug 9, 2016 · 5 comments
Closed

bot crashed with UnicodeDecodeError #3343

buzzo123 opened this issue Aug 9, 2016 · 5 comments

Comments

@buzzo123
Copy link

buzzo123 commented Aug 9, 2016

my bot crash with this:

Traceback (most recent call last):
  File "pokecli.py", line 521, in <module>
    main()
  File "pokecli.py", line 95, in main
    bot.tick()
  File "/home/buzzo/Desktop/pogo/PokemonGo-Bot-master/pokemongo_bot/__init__.py", line 441, in tick
    if worker.work() == WorkerResult.RUNNING:
  File "/home/buzzo/Desktop/pogo/PokemonGo-Bot-master/pokemongo_bot/cell_workers/evolve_pokemon.py", line 28, in work
    response_dict = self.api.get_inventory()
  File "/home/buzzo/Desktop/pogo/PokemonGo-Bot-master/src/pgoapi/pgoapi/pgoapi.py", line 122, in function
    return request.call()
  File "/home/buzzo/Desktop/pogo/PokemonGo-Bot-master/pokemongo_bot/api_wrapper.py", line 106, in call
    result = self._call()
  File "/home/buzzo/Desktop/pogo/PokemonGo-Bot-master/pokemongo_bot/api_wrapper.py", line 63, in _call
    return PGoApiRequest.call(self)
  File "/home/buzzo/Desktop/pogo/PokemonGo-Bot-master/src/pgoapi/pgoapi/pgoapi.py", line 220, in call
    response = request.request(self._api_endpoint, self._req_method_list, self.get_position())
  File "/home/buzzo/Desktop/pogo/PokemonGo-Bot-master/src/pgoapi/pgoapi/rpc_api.py", line 126, in request
    request_proto = self._build_main_request(subrequests, player_position)
  File "/home/buzzo/Desktop/pogo/PokemonGo-Bot-master/src/pgoapi/pgoapi/rpc_api.py", line 216, in _build_main_request
    request.auth_info.token.contents = self._auth_provider.get_access_token()
  File "/home/buzzo/Desktop/pogo/PokemonGo-Bot-master/src/pgoapi/pgoapi/auth_ptc.py", line 145, in get_access_token
    raise AuthException("Could not retrieve a PTC Access Token")
pgoapi.exceptions.AuthException: Could not retrieve a PTC Access Token
2016-08-09 21:49:23,840 [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 "/usr/local/lib/python2.7/dist-packages/raven/transport/threaded.py", line 174, in send_sync
    super(ThreadedHTTPTransport, self).send(data, headers)
  File "/usr/local/lib/python2.7/dist-packages/raven/transport/http.py", line 47, in send
    ca_certs=self.ca_certs,
  File "/usr/local/lib/python2.7/dist-packages/raven/utils/http.py", line 66, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/local/lib/python2.7/dist-packages/future/backports/urllib/request.py", line 494, in open
    response = self._open(req, data)
  File "/usr/local/lib/python2.7/dist-packages/future/backports/urllib/request.py", line 512, in _open
    '_open', req)
  File "/usr/local/lib/python2.7/dist-packages/future/backports/urllib/request.py", line 466, in _call_chain
    result = func(*args)
  File "/usr/local/lib/python2.7/dist-packages/raven/utils/http.py", line 46, in https_open
    return self.do_open(ValidHTTPSConnection, req)
  File "/usr/local/lib/python2.7/dist-packages/future/backports/urllib/request.py", line 1284, in do_open
    h.request(req.get_method(), req.selector, req.data, headers)
  File "/usr/lib/python2.7/httplib.py", line 1057, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python2.7/httplib.py", line 1097, in _send_request
    self.endheaders(body)
  File "/usr/lib/python2.7/httplib.py", line 1053, in endheaders
    self._send_output(message_body)
  File "/usr/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)
2016-08-09 21:49:24,094 [sentry.errors.uncaught] [ERROR] [u'AuthException: Could not retrieve a PTC Access Token', u'  File "pokecli.py", line 521, in <module>', u'  File "pokecli.py", line 95, in main', u'  File "pokemongo_bot/__init__.py", line 441, in tick', u'  File "pokemongo_bot/cell_workers/evolve_pokemon.py", line 28, in work', u'  File "pgoapi/pgoapi.py", line 122, in function', u'  File "pokemongo_bot/api_wrapper.py", line 106, in call', u'  File "pokemongo_bot/api_wrapper.py", line 63, in _call', u'  File "pgoapi/pgoapi.py", line 220, in call', u'  File "pgoapi/rpc_api.py", line 126, in request', u'  File "pgoapi/rpc_api.py", line 216, in _build_main_request', u'  File "pgoapi/auth_ptc.py", line 145, in get_access_token']
Sentry is attempting to send 1 pending error messages
Waiting up to 10 seconds
Press Ctrl-C to quit
@buzzo123 buzzo123 changed the title bot crashed with unicodecodeerror bot crashed with UnicodeDecodeError Aug 9, 2016
@Sijmenjeromkok
Copy link

I get the same error after about an hour of bot-time

@tvpman
Copy link

tvpman commented Aug 9, 2016

got the same any solutions?

@chr1spy
Copy link

chr1spy commented Aug 9, 2016

Restart the bot...

@Quantra
Copy link
Contributor

Quantra commented Aug 9, 2016

Yup restart the bot is a solution. This exception is occuring when...

pgoapi.exceptions.AuthException: Could not retrieve a PTC Access Token

So either it crashing out is expected behaviour or the bot needs updating to handle this exception and perhaps try getting another PTC access token.

@buzzo123
Copy link
Author

buzzo123 commented Aug 9, 2016

restart is a solution, but i report this bug so someone can fix it :)

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

6 participants