Closed siuyiuyeung closed 7 years ago
i have had multiple unicode decode error due to wrong api.
Check if your pip install blabla installs 1.1.6 or 1.1.8 pgoapi. If its the wrong one try to delete the pgoapi and pgo....egg folder inn ex. C:\Python27\Lib\site-packages and do an install again to see if it installs the 1.1.8
Agree with @thereyrey . Was running into this issue on a few bots running against same code. Some worked, and some didn't. Doing a fresh install resolved the problem for me.
I did a fresh install. I then did a ./setup.sh -i. Then I entered the virtualenv with source bin/activate
. If I list the packages with pip list
it gives me pgoapi (1.1.8, /home/XXXXXX/projects/PokemonGo-Bot/src/pgoapi)
.
The same problem exists.
This happens in both master and dev branches that are updated to the latest commit. Master: 601e21d
and Dev 158e469
.
@thereyrey The correct version appears to be in installed. So I'm not sure it's the pgoapi.
The pgoapi submodule is from joelgreen:
chle@ (venv:PokemonGo-Bot) [~/projects/PokemonGo-Bot/src/pgoapi]
(master) $ git remote -v
origin https://github.com/joelgreen/pgoapi.git/ (fetch)
origin https://github.com/joelgreen/pgoapi.git/ (push)
chle@ (venv:PokemonGo-Bot) [~/projects/PokemonGo-Bot/src/pgoapi]
(master) $ cat setup.py | grep version
version = '1.1.8',
pip list
reports its version as 1.1.8:
chle@ (venv:PokemonGo-Bot) [~/projects/PokemonGo-Bot/src/pgoapi]
(master) $ cd ../..
chle@ (venv:PokemonGo-Bot) [~/projects/PokemonGo-Bot]
{master} $ pip list
click (6.6)
colorama (0.3.7)
contextlib2 (0.5.4)
decorator (4.0.10)
demjson (2.2.4)
enum34 (1.1.6)
eventlet (0.19.0)
Flask (0.11.1)
funcsigs (1.0.2)
future (0.15.2)
geopy (1.11.0)
googlemaps (2.4.4)
gpsoauth (0.3.0)
gpxpy (1.1.1)
greenlet (0.4.9)
haversine (0.4.5)
iniherit (0.3.4)
itsdangerous (0.24)
Jinja2 (2.8)
MarkupSafe (0.23)
mock (2.0.0)
networkx (1.11)
numpy (1.11.0)
pbr (1.10.0)
pgoapi (1.1.8, /home/chle/projects/PokemonGo-Bot/src/pgoapi)
pip (8.1.2)
polyline (1.3.1)
protobuf (3.0.0b4)
protobuf-to-dict (0.1.0)
pycryptodomex (3.4.2)
python-engineio (0.9.2)
python-slugify (1.2.0)
python-socketio (1.4.2)
PyYAML (3.11)
raven (5.23.0)
requests (2.10.0)
s2sphere (0.2.4)
setuptools (26.0.0)
six (1.10.0)
socketIO-client (0.7.0)
timeout-decorator (0.3.2)
Unidecode (0.4.19)
websocket-client (0.37.0)
Werkzeug (0.11.10)
wheel (0.29.0)
xxhash (0.6.1)
yoyo-migrations (5.0.3)
Running on the current master branch
chle@ (venv:PokemonGo-Bot) [~/projects/PokemonGo-Bot]
{master} $ git describe --tags
TAG_08132016_MASTER-201-g601e21d
It appears to die during 'GET_PLAYER' RPC request. It looks like it's trying to decode the protobuf for stats.
2016-08-21 16:33:24,030 [pgoapi.rpc_api] [DEBUG] Parsing main RPC response...
2016-08-21 16:33:24,030 [pgoapi.pgoapi] [INFO] Creating a new request...
2016-08-21 16:33:24,030 [pgoapi.pgoapi] [INFO] Adding 'GET_INVENTORY' to RPC request
2016-08-21 16:33:24,030 [pgoapi.pgoapi] [INFO] Adding 'GET_PLAYER' to RPC request
Traceback (most recent call last):
File "pokecli.py", line 674, in <module>
main()
File "pokecli.py", line 176, in main
report_summary(bot)
File "pokecli.py", line 211, in report_summary
metrics.capture_stats()
File "/home/chle/projects/PokemonGo-Bot/pokemongo_bot/metrics.py", line 84, in capture_stats
response_dict = request.call()
File "/home/chle/projects/PokemonGo-Bot/pokemongo_bot/api_wrapper.py", line 233, in call
result = self._call()
File "/home/chle/projects/PokemonGo-Bot/pokemongo_bot/api_wrapper.py", line 157, in _call
accelerometer_axes=3
File "/home/chle/projects/PokemonGo-Bot/local/lib/python2.7/site-packages/google/protobuf/internal/python_message.py", line 533, in init
setattr(self, field_name, field_value)
File "/home/chle/projects/PokemonGo-Bot/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 "/home/chle/projects/PokemonGo-Bot/local/lib/python2.7/site-packages/google/protobuf/internal/type_checkers.py", line 134, in CheckValue
raise ValueError('Value out of range: %d' % proposed_value)
ValueError: Value out of range: -89
2016-08-21 16:33:24,041 [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 "/home/chle/projects/PokemonGo-Bot/local/lib/python2.7/site-packages/raven/transport/threaded.py", line 174, in send_sync
super(ThreadedHTTPTransport, self).send(data, headers)
File "/home/chle/projects/PokemonGo-Bot/local/lib/python2.7/site-packages/raven/transport/http.py", line 47, in send
ca_certs=self.ca_certs,
File "/home/chle/projects/PokemonGo-Bot/local/lib/python2.7/site-packages/raven/utils/http.py", line 66, in urlopen
return opener.open(url, data, timeout)
File "/home/chle/projects/PokemonGo-Bot/local/lib/python2.7/site-packages/future/backports/urllib/request.py", line 494, in open
response = self._open(req, data)
File "/home/chle/projects/PokemonGo-Bot/local/lib/python2.7/site-packages/future/backports/urllib/request.py", line 512, in _open
'_open', req)
File "/home/chle/projects/PokemonGo-Bot/local/lib/python2.7/site-packages/future/backports/urllib/request.py", line 466, in _call_chain
result = func(*args)
File "/home/chle/projects/PokemonGo-Bot/local/lib/python2.7/site-packages/raven/utils/http.py", line 46, in https_open
return self.do_open(ValidHTTPSConnection, req)
File "/home/chle/projects/PokemonGo-Bot/local/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/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
File "/home/chle/projects/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-21 16:33:24,042 [sentry.errors.uncaught] [ERROR] [u'ValueError: Value out of range: -89', u' File "pokecli.py", line 674, in <module>', u' File "pokecli.py", line 176, in main', u' File "pokecli.py", line 211, in report_summary', u' File "pokemongo_bot/metrics.py", line 84, in capture_stats', u' File "pokemongo_bot/api_wrapper.py", line 233, in call', u' File "pokemongo_bot/api_wrapper.py", line 157, in _call', u' File "/home/chle/projects/PokemonGo-Bot/local/lib/python2.7/site-packages/google/protobuf/internal/python_message.py", line 533, in init', u' File "/home/chle/projects/PokemonGo-Bot/local/lib/python2.7/site-packages/google/protobuf/internal/python_message.py", line 669, in field_setter', u' File "/home/chle/projects/PokemonGo-Bot/local/lib/python2.7/site-packages/google/protobuf/internal/type_checkers.py", line 134, in CheckValue']
Sun Aug 21 16:33:24 UTC 2016 Pokebot Stopped.
Press any button or wait 20 seconds to continue.
SOLVED. The error message was misleading. The issue is that the IP is banned. (Running in a virtual machine in the cloud).
Solution: Use Torify to route traffic through Tor instead.
$ sudo apt-get install tor
$ torify ./run.sh
@chrisle wasn't a IP ban. so sad
@chrisle how to configure the exit node to specific country?
@thereyrey thanks a lot i lov u dude!!!! just delete
pgoapi and pgo....egg folder inn ex. C:\Python27\Lib\site-packages
and reinstall. That's it. Problem solved!
config.json is valid JSON by using http://jsonlint.com/ to check.
Expected Behavior
the bot should work after login successful.
Actual Behavior
Something went wrong and the bot needed to be restarted. 1.call() takes exactly 1 argument (2 given) 2.Sentry responded with an error: 'utf8' codec can't decode byte 0x9c in position 1 : invalid start byte
Your FULL config.json (remove your username, password, gmapkey and any other private info)
Output when issue occurred
Steps to Reproduce
Using PokemonGo-Bot-Start.bat to reinstall
Other Information
OS: windows 7
Branch: master Git Commit: 601e21dbf464e2b3631d6a58e508b26af7fd470f Python Version: 2.7.12 Any other relevant files/configs (eg: path files)