Expected Behavior
Bot running.
Actual Behavior
Error message, see traceback below
Your FULL config.json (remove your username, password, gmapkey and any other private info)
http://pastebin.com/rGySE5GR
Output when issue occurred
2016-08-26 05:51:22,707 [ cli] [INFO] PokemonGO Bot v1.0
2016-08-26 05:51:22,707 [ cli] [INFO] commit: not found
2016-08-26 05:51:22,723 [ cli] [INFO] No config argument specified, checki
ng for /configs/config.json
2016-08-26 05:51:22,726 [ cli] [INFO] Configuration initialized
Traceback (most recent call last):
File "pokecli.py", line 705, in
main()
File "pokecli.py", line 103, in main
bot = PokemonGoBot(config)
File "D:\gamezone\pokebots\PokemonGo-Bot\pokemongo_bot__init__.py", line 106,
in init
if saved_info.has_key('client_id'):
File "C:\Python27\lib\shelve.py", line 107, in has_key
return key in self.dict
File "C:\Python27\lib_abcoll.py", line 388, in contains
self[key]
File "C:\Python27\lib\bsddb__init__.py", line 270, in getitem
return _DeadlockWrap(lambda: self.db[key]) # self.db[key]
File "C:\Python27\lib\bsddb\dbutils.py", line 68, in DeadlockWrap
return function(__args, *kwargs)
File "C:\Python27\lib\bsddb__init.py", line 270, in
return _DeadlockWrap(lambda: self.db[key]) # self.db[key]
TypeError: String or Integer object expected for key, unicode found
Steps to Reproduce
Run the bot
Other Information
OS:
Win7 64bit
Branch:
dev
Git Commit:
5e50264e7644b007dff7e0e057375cc433c36805
Python Version:
Python 2.7.12
I've added the full terminal output here http://pastebin.com/2QEd4g5H
commit: 0bedea3d78407b3313c3ceca90db1a156af63a08 still happening
I have the same error.
2016-08-26 07:14:41,699 [ cli] [INFO] PokemonGO Bot v1.0
2016-08-26 07:14:41,707 [ cli] [INFO] commit: 5e50264e7644b007dff7e0e057375cc433c36805
2016-08-26 07:14:41,715 [ cli] [INFO] Configuration initialized
2016-08-26 07:14:41,716 [pokemongo_bot.health_record.bot_event] [INFO] Health check is enabled. For more information:
2016-08-26 07:14:41,716 [pokemongo_bot.health_record.bot_event] [INFO] https://github.com/PokemonGoF/PokemonGo-Bot/tree/dev#analytics
2016-08-26 07:14:41,725 [requests.packages.urllib3.connectionpool] [INFO] Starting new HTTP connection (1): www.google-analytics.com
Traceback (most recent call last):
File "pokecli.py", line 705, in
main()
File "pokecli.py", line 103, in main
bot = PokemonGoBot(config)
File "/home/karloowlim/PokemonGo-Bot/pokemongo_bot/init.py", line 106, in init
if saved_info.has_key('client_id'):
File "/usr/lib/python2.7/shelve.py", line 107, in has_key
return key in self.dict
File "/home/karloowlim/PokemonGo-Bot/lib/python2.7/_abcoll.py", line 388, in contains
self[key]
File "/usr/lib/python2.7/bsddb/init.py", line 270, in getitem
return _DeadlockWrap(lambda: self.db[key]) # self.db[key]
File "/usr/lib/python2.7/bsddb/dbutils.py", line 68, in DeadlockWrap
return function(__args, *__kwargs)
File "/usr/lib/python2.7/bsddb/init.py", line 270, in
return _DeadlockWrap(lambda: self.db[key]) # self.db[key]
TypeError: String or Integer object expected for key, unicode found
2016-08-26 07:14:42,184 [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/karloowlim/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/karloowlim/PokemonGo-Bot/local/lib/python2.7/site-packages/raven/transport/http.py", line 47, in send
ca_certs=self.ca_certs,
File "/home/karloowlim/PokemonGo-Bot/local/lib/python2.7/site-packages/raven/utils/http.py", line 66, in urlopen
return opener.open(url, data, timeout)
File "/home/karloowlim/PokemonGo-Bot/local/lib/python2.7/site-packages/future/backports/urllib/request.py", line 494, in open
response = self._open(req, data)
File "/home/karloowlim/PokemonGo-Bot/local/lib/python2.7/site-packages/future/backports/urllib/request.py", line 512, in _open
'_open', req)
File "/home/karloowlim/PokemonGo-Bot/local/lib/python2.7/site-packages/future/backports/urllib/request.py", line 466, in _call_chain
result = func(*args)
File "/home/karloowlim/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/karloowlim/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/karloowlim/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-26 07:14:42,186 [sentry.errors.uncaught] [ERROR] [u'TypeError: String or Integer object expected for key, unicode found', u' File "pokecli.py", line 705, in ', u' File "pokecli.py", line 103, in main', u' File "pokemongo_bot/init.py", line 106, in init', u' File "python2.7/shelve.py", line 107, in has_key', u' File "python2.7/_abcoll.py", line 388, in contains', u' File "bsddb/init.py", line 270, in getitem', u' File "bsddb/dbutils.py", line 68, in DeadlockWrap', u' File "bsddb/init.py", line 270, in ']
Fri Aug 26 07:14:42 PHT 2016 Pokebot Stopped.
Press any button or wait 20 seconds to continue.
How to fix this?
Quick and dirty workaround:
In pokemongo_bot/init.py, remove lines 104 to 112.
That will at least allow the bot to run for now (might need to set enable_social to false as well, I haven't tested that).
Waiting on a proper solution.
In other words revert commit: dcda7a144508285dfc99d736aab75254bd489edc
IMHO nothing mqtt-related should happen if enable_social = false.
@Gobberwart No, removing lines 104-112 with enable_social = false should work fine. If you want to keep enable_social = true you have to revert social_handler.py back to self.mqttc = MyMQTTClass(bot)
I meant in general, not at the moment. No reason to have this stuff do anything if enable_social is false.
Currently, regardless of what enable_social is set to, this bit of code breaks everything. Since its only related to the social stuff, it shouldn't even be running if enable_social is false.
But it is, so yeah just remove/comment those lines and it should work for now.
@solderzzc your thoughts?
Since init.py runs whether or not enable_social is true or false that's why it causes the error. With it set to false removing the lines from init.py fixes the problem.
With it set to true it then calls upon social_handler.py which then throws an error because of the added code. just needs to be fixed up and should be good. hopefully that explains it?
That's exactly what I'm saying, mate :)
Just noting for future reference that the code should be changed NOT to run if enable_social = false.
Note that removing the lines was my suggestion, I'm not having trouble understanding it :)
Issue is gone and bot is running fine. should be closed now
@Bilibox awesome. I'll send the merge through.