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

[BUG] Please fix this crash utf_8_decode pokecli.py #2928

Closed
DimaVIII opened this issue Aug 7, 2016 · 12 comments
Closed

[BUG] Please fix this crash utf_8_decode pokecli.py #2928

DimaVIII opened this issue Aug 7, 2016 · 12 comments

Comments

@DimaVIII
Copy link

DimaVIII commented Aug 7, 2016

Actual Behavior

Bot is crashing while running.

Traceback (most recent call last):
  File "pokecli.py", line 504, in <module>
    main()
  File "pokecli.py", line 135, in main
    raise e
TypeError: None has type <type 'NoneType'>, but expected one of: (<type 'str'>, <type 'unicode'>)
2016-08-07 23:05:50,898 [sentry.errors] [ERROR] Sentry responded with an error: 'utf8' codec can't decode byte 0x9c in position 1: invalid start byte (url: https://app.getsentry.com/api/90254/store/)
Traceback (most recent call last):
  File "/Users/DimaPro/PokemonGo-Bot/Master-Bot-1/PokemonGo-Bot/lib/python2.7/site-packages/raven/transport/threaded.py", line 174, in send_sync
    super(ThreadedHTTPTransport, self).send(data, headers)
  File "/Users/DimaPro/PokemonGo-Bot/Master-Bot-1/PokemonGo-Bot/lib/python2.7/site-packages/raven/transport/http.py", line 47, in send
    ca_certs=self.ca_certs,
  File "/Users/DimaPro/PokemonGo-Bot/Master-Bot-1/PokemonGo-Bot/lib/python2.7/site-packages/raven/utils/http.py", line 66, in urlopen
    return opener.open(url, data, timeout)
  File "/Users/DimaPro/PokemonGo-Bot/Master-Bot-1/PokemonGo-Bot/lib/python2.7/site-packages/future/backports/urllib/request.py", line 494, in open
    response = self._open(req, data)
  File "/Users/DimaPro/PokemonGo-Bot/Master-Bot-1/PokemonGo-Bot/lib/python2.7/site-packages/future/backports/urllib/request.py", line 512, in _open
    '_open', req)
  File "/Users/DimaPro/PokemonGo-Bot/Master-Bot-1/PokemonGo-Bot/lib/python2.7/site-packages/future/backports/urllib/request.py", line 466, in _call_chain
    result = func(*args)
  File "/Users/DimaPro/PokemonGo-Bot/Master-Bot-1/PokemonGo-Bot/lib/python2.7/site-packages/raven/utils/http.py", line 46, in https_open
    return self.do_open(ValidHTTPSConnection, req)
  File "/Users/DimaPro/PokemonGo-Bot/Master-Bot-1/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
  File "/Users/DimaPro/PokemonGo-Bot/Master-Bot-1/PokemonGo-Bot/lib/python2.7/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0x9c in position 1: invalid start byte
2016-08-07 23:05:50,904 [sentry.errors.uncaught] [ERROR] [u"TypeError: None has type <type 'NoneType'>, but expected one of: (<type 'str'>, <type 'unicode'>)", u'  File "pokecli.py", line 504, in <module>', u'  File "pokecli.py", line 135, in main']

Other Information

OS: OSX
Git Commit: CURRENT DEV

@MikeDX
Copy link
Contributor

MikeDX commented Aug 7, 2016

I have also experienced this

@guokan-shang
Copy link

here is the fix
#2909

@DimaVIII
Copy link
Author

DimaVIII commented Aug 7, 2016

@shangguokan is not related.

@DimaVIII
Copy link
Author

DimaVIII commented Aug 7, 2016

Added in pokecli.py:

reload(sys)
sys.setdefaultencoding('utf8')

before:
logger.info('PokemonGO Bot v1.0')

And running a test again...

@DimaVIII
Copy link
Author

DimaVIII commented Aug 7, 2016

#2887

@DimaVIII
Copy link
Author

DimaVIII commented Aug 7, 2016

Still same error after 17 min of running:

Traceback (most recent call last):
  File "pokecli.py", line 506, in <module>
    main()
  File "pokecli.py", line 137, in main
    raise e
IndexError: list index out of range
2016-08-08 01:03:59,521 [sentry.errors] [ERROR] Sentry responded with an error: 'utf8' codec can't decode byte 0x9c in position 1: invalid start byte (url: https://app.getsentry.com/api/90254/store/)
Traceback (most recent call last):
  File "/Users/DimaPro/PokemonGo-Bot/Master-Bot-1/PokemonGo-Bot/lib/python2.7/site-packages/raven/transport/threaded.py", line 174, in send_sync
    super(ThreadedHTTPTransport, self).send(data, headers)
  File "/Users/DimaPro/PokemonGo-Bot/Master-Bot-1/PokemonGo-Bot/lib/python2.7/site-packages/raven/transport/http.py", line 47, in send
    ca_certs=self.ca_certs,
  File "/Users/DimaPro/PokemonGo-Bot/Master-Bot-1/PokemonGo-Bot/lib/python2.7/site-packages/raven/utils/http.py", line 66, in urlopen
    return opener.open(url, data, timeout)
  File "/Users/DimaPro/PokemonGo-Bot/Master-Bot-1/PokemonGo-Bot/lib/python2.7/site-packages/future/backports/urllib/request.py", line 494, in open
    response = self._open(req, data)
  File "/Users/DimaPro/PokemonGo-Bot/Master-Bot-1/PokemonGo-Bot/lib/python2.7/site-packages/future/backports/urllib/request.py", line 512, in _open
    '_open', req)
  File "/Users/DimaPro/PokemonGo-Bot/Master-Bot-1/PokemonGo-Bot/lib/python2.7/site-packages/future/backports/urllib/request.py", line 466, in _call_chain
    result = func(*args)
  File "/Users/DimaPro/PokemonGo-Bot/Master-Bot-1/PokemonGo-Bot/lib/python2.7/site-packages/raven/utils/http.py", line 46, in https_open
    return self.do_open(ValidHTTPSConnection, req)
  File "/Users/DimaPro/PokemonGo-Bot/Master-Bot-1/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
  File "/Users/DimaPro/PokemonGo-Bot/Master-Bot-1/PokemonGo-Bot/lib/python2.7/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0x9c in position 1: invalid start byte
2016-08-08 01:03:59,529 [sentry.errors.uncaught] [ERROR] [u'IndexError: list index out of range', u'  File "pokecli.py", line 506, in <module>', u'  File "pokecli.py", line 137, in main']

@youweit
Copy link

youweit commented Aug 8, 2016

same here

@Happyrain67
Copy link

same here.

More details :

File "/usr/share/PokemonGo-Bot/lib/python2.7/encodings/utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0x9c in position 1: invalid start byte
2016-08-07 22:52:46,572 [sentry.errors.uncaught] [ERROR] [u"TypeError: None has type <type 'NoneType'>, but expected one of: (<type 'str'>, <type 'unicode'>)", u' File "pokecli.py", line 496, in ', u' File "pokecli.py", line 132, in main']
Sentry is attempting to send 1 pending error messages
Waiting up to 10 seconds
Press Ctrl-C to quit

And

return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0x9c in position 1: invalid start byte
2016-08-08 00:31:01,456 [sentry.errors.uncaught] [ERROR] [u'IndexError: list index out of range', u' File "pokecli.py", line 496, in ', u' File "pokecli.py", line 132, in main']

This is random times (after 5 hours or after 10 min....)
After a task SpinFort or MoveToFort

@DimaVIII
Copy link
Author

DimaVIII commented Aug 8, 2016

new:

Traceback (most recent call last):
  File "pokecli.py", line 503, in <module>
    main()
  File "pokecli.py", line 89, in main
    bot.tick()
  File "/Users/DimaPro/PokemonGo-Bot/Master-Bot-2/PokemonGo-Bot/pokemongo_bot/__init__.py", line 434, in tick
    if worker.work() == WorkerResult.RUNNING:
  File "/Users/DimaPro/PokemonGo-Bot/Master-Bot-2/PokemonGo-Bot/pokemongo_bot/cell_workers/evolve_pokemon.py", line 28, in work
    response_dict = self.api.get_inventory()
  File "/Users/DimaPro/PokemonGo-Bot/Master-Bot-2/PokemonGo-Bot/src/pgoapi/pgoapi/pgoapi.py", line 122, in function
    return request.call()
  File "/Users/DimaPro/PokemonGo-Bot/Master-Bot-2/PokemonGo-Bot/pokemongo_bot/api_wrapper.py", line 106, in call
    result = self._call()
  File "/Users/DimaPro/PokemonGo-Bot/Master-Bot-2/PokemonGo-Bot/pokemongo_bot/api_wrapper.py", line 63, in _call
    return PGoApiRequest.call(self)
  File "/Users/DimaPro/PokemonGo-Bot/Master-Bot-2/PokemonGo-Bot/src/pgoapi/pgoapi/pgoapi.py", line 220, in call
    response = request.request(self._api_endpoint, self._req_method_list, self.get_position())
  File "/Users/DimaPro/PokemonGo-Bot/Master-Bot-2/PokemonGo-Bot/src/pgoapi/pgoapi/rpc_api.py", line 126, in request
    request_proto = self._build_main_request(subrequests, player_position)
  File "/Users/DimaPro/PokemonGo-Bot/Master-Bot-2/PokemonGo-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 "/Users/DimaPro/PokemonGo-Bot/Master-Bot-2/PokemonGo-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 "/Users/DimaPro/PokemonGo-Bot/Master-Bot-2/PokemonGo-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'>)
2016-08-08 15:43:51,660 [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/DimaPro/PokemonGo-Bot/Master-Bot-2/PokemonGo-Bot/lib/python2.7/site-packages/raven/transport/threaded.py", line 174, in send_sync
    super(ThreadedHTTPTransport, self).send(data, headers)
  File "/Users/DimaPro/PokemonGo-Bot/Master-Bot-2/PokemonGo-Bot/lib/python2.7/site-packages/raven/transport/http.py", line 47, in send
    ca_certs=self.ca_certs,
  File "/Users/DimaPro/PokemonGo-Bot/Master-Bot-2/PokemonGo-Bot/lib/python2.7/site-packages/raven/utils/http.py", line 66, in urlopen
    return opener.open(url, data, timeout)
  File "/Users/DimaPro/PokemonGo-Bot/Master-Bot-2/PokemonGo-Bot/lib/python2.7/site-packages/future/backports/urllib/request.py", line 494, in open
    response = self._open(req, data)
  File "/Users/DimaPro/PokemonGo-Bot/Master-Bot-2/PokemonGo-Bot/lib/python2.7/site-packages/future/backports/urllib/request.py", line 512, in _open
    '_open', req)
  File "/Users/DimaPro/PokemonGo-Bot/Master-Bot-2/PokemonGo-Bot/lib/python2.7/site-packages/future/backports/urllib/request.py", line 466, in _call_chain
    result = func(*args)
  File "/Users/DimaPro/PokemonGo-Bot/Master-Bot-2/PokemonGo-Bot/lib/python2.7/site-packages/raven/utils/http.py", line 46, in https_open
    return self.do_open(ValidHTTPSConnection, req)
  File "/Users/DimaPro/PokemonGo-Bot/Master-Bot-2/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)
2016-08-08 15:43:51,671 [sentry.errors.uncaught] [ERROR] [u"TypeError: None has type <type 'NoneType'>, but expected one of: (<type 'str'>, <type 'unicode'>)", u'  File "pokecli.py", line 503, in <module>', u'  File "pokecli.py", line 89, in main', u'  File "pokemongo_bot/__init__.py", line 434, 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 "/Users/DimaPro/PokemonGo-Bot/Master-Bot-2/PokemonGo-Bot/lib/python2.7/site-packages/google/protobuf/internal/python_message.py", line 669, in field_setter', u'  File "/Users/DimaPro/PokemonGo-Bot/Master-Bot-2/PokemonGo-Bot/lib/python2.7/site-packages/google/protobuf/internal/type_checkers.py", line 176, in CheckValue']

@Happyrain67
Copy link

See #3075

@k4n30
Copy link
Contributor

k4n30 commented Aug 12, 2016

@DimaVIII - Do you still have this issue on the latest version?

@k4n30
Copy link
Contributor

k4n30 commented Aug 14, 2016

Closing issue due to no response and time elapsed since original issue, please reopen if you feel it's an outstanding issue

@k4n30 k4n30 closed this as completed Aug 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants