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

[FIXED] Bot is really, really slow. / [ERROR] ["AttributeError: 'NoneType' object has no attribute 'refresh'"] #4957

Closed
imgidedin opened this issue Aug 30, 2016 · 10 comments

Comments

@imgidedin
Copy link

imgidedin commented Aug 30, 2016

Expected Behavior

I expected it to run properly and fast. Like it used to. Haven't opened it in a few days.

Actual Behavior

Bot took 28 minutes to try to start and stayed there. Nothing was done for the entire time.

Your FULL config.json

http://pastebin.com/JDCmZyMR

Output when issue occurred

http://pastebin.com/CsUWwdvd

Steps to Reproduce

I just did a new install and selected the default config.

Other Information

OS: CentOS Linux release 7.2.1511 (Core)
Branch: dev
Git Commit: 56339fb
Python Version: Python 3.6.0a4

@imgidedin
Copy link
Author

imgidedin commented Aug 30, 2016

I would like to add that I am running it on a proxy network. The proxy settings is done correctly and exported. Everything is working as intended. Firefox, wget, curl and yum are all accessing the internet without a problem.

Maybe the problem is tied to the Python Version? It must be a 2.7.x version or anything above that is alright?


Edit: It seems it isn't the Python version. I reverted it to the 2.7.5 version that comes native with Centos7 and the problem persists. No changes have been made to the proxy server in the last week, so, there is nothing on it that should be preventing the bot to work, as it connects to the account, but takes a really long time to process anything.

@sohje
Copy link
Contributor

sohje commented Aug 30, 2016

Any additional load like disk read/torrents/etc on that machine?

@db-coder
Copy link

try making enable_social: false

@imgidedin
Copy link
Author

db-coder. It seems like that was the problem. Now I am getting the following error after the Bot finds the encrypt.so:

Traceback (most recent call last):
  File "pokecli.py", line 781, in <module>
    main()
  File "pokecli.py", line 217, in main
    report_summary(bot)
  File "pokecli.py", line 265, in report_summary
    metrics.capture_stats()
  File "/root/PokemonGo-Bot/pokemongo_bot/metrics.py", line 117, in capture_stats
    inventory.refresh_inventory()
  File "/root/PokemonGo-Bot/pokemongo_bot/inventory.py", line 1338, in refresh_inventory
    _inventory.refresh(data)
AttributeError: 'NoneType' object has no attribute 'refresh'
[2016-08-30 15:49:42] [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 "/root/PokemonGo-Bot/lib/python2.7/site-packages/raven/transport/threaded.py", line 174, in send_sync
    super(ThreadedHTTPTransport, self).send(data, headers)
  File "/root/PokemonGo-Bot/lib/python2.7/site-packages/raven/transport/http.py", line 47, in send
    ca_certs=self.ca_certs,
  File "/root/PokemonGo-Bot/lib/python2.7/site-packages/raven/utils/http.py", line 66, in urlopen
    return opener.open(url, data, timeout)
  File "/root/PokemonGo-Bot/lib/python2.7/site-packages/future/backports/urllib/request.py", line 494, in open
    response = self._open(req, data)
  File "/root/PokemonGo-Bot/lib/python2.7/site-packages/future/backports/urllib/request.py", line 512, in _open
    '_open', req)
  File "/root/PokemonGo-Bot/lib/python2.7/site-packages/future/backports/urllib/request.py", line 466, in _call_chain
    result = func(*args)
  File "/root/PokemonGo-Bot/lib/python2.7/site-packages/raven/utils/http.py", line 46, in https_open
    return self.do_open(ValidHTTPSConnection, req)
  File "/root/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/lib64/python2.7/httplib.py", line 1017, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib64/python2.7/httplib.py", line 1051, in _send_request
    self.endheaders(body)
  File "/usr/lib64/python2.7/httplib.py", line 1013, in endheaders
    self._send_output(message_body)
  File "/usr/lib64/python2.7/httplib.py", line 862, in _send_output
    msg += message_body
  File "/root/PokemonGo-Bot/lib64/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-30 15:49:42] [sentry.errors.uncaught] [ERROR] [u"AttributeError: 'NoneType' object has no attribute 'refresh'", u'  File "pokecli.py", line 781, in <module>', u'  File "pokecli.py", line 217, in main', u'  File "pokecli.py", line 265, in report_summary', u'  File "pokemongo_bot/metrics.py", line 117, in capture_stats', u'  File "pokemongo_bot/inventory.py", line 1338, in refresh_inventory']

@imgidedin
Copy link
Author

I'll re-install it...

@imgidedin
Copy link
Author

Nope. The error persists even after doing a clean new install. Can anyone help me with it?

@imgidedin imgidedin changed the title Bot is really, really slow. Bot is really, really slow. / [ERROR] ["AttributeError: 'NoneType' object has no attribute 'refresh'"] Aug 30, 2016
@solderzzc
Copy link
Contributor

solderzzc commented Aug 30, 2016

latest code should already fixed this issue.
/ [ERROR] ["AttributeError: 'NoneType' object has no attribute 'refresh'"]
And telegram code running in thread mode.

@imgidedin
Copy link
Author

solderzzc. I did a git reset and a checkout to dev and it is working now.

It still gave me this error on the first time I ran it, but I think it was because the inventory file didn't existed:

[2016-08-30 16:09:19] [PokemonGoBot] [INFO] 
Traceback (most recent call last):
  File "/usr/lib64/python2.7/logging/__init__.py", line 851, in emit
    msg = self.format(record)
  File "/usr/lib64/python2.7/logging/__init__.py", line 724, in format
    return fmt.format(record)
  File "/usr/lib64/python2.7/logging/__init__.py", line 464, in format
    record.message = record.getMessage()
  File "/usr/lib64/python2.7/logging/__init__.py", line 328, in getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting
Logged from file __init__.py, line 1325
[2016-08-30 16:09:21] [PokemonGoBot] [INFO] No inventory file /root/PokemonGo-Bot/pokemongo_bot/../web/inventory-realgid1.json found. Creating a new one

It seems everything is running properly now.

@solderzzc
Copy link
Contributor

solderzzc commented Aug 30, 2016

@kevinsmendes
Yes, that's just a warning, I'm too lazy to figure out which log module should be used.

TypeError: not all arguments converted during string formatting

@imgidedin imgidedin changed the title Bot is really, really slow. / [ERROR] ["AttributeError: 'NoneType' object has no attribute 'refresh'"] [FIXED] Bot is really, really slow. / [ERROR] ["AttributeError: 'NoneType' object has no attribute 'refresh'"] Aug 30, 2016
@imgidedin
Copy link
Author

Haha. Thank you for the tips guys. I'll close the issue now.

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