PokemonGo-Bot icon indicating copy to clipboard operation
PokemonGo-Bot copied to clipboard

'PokemonGoBot' object has no attribute 'event_handler'

Open sparshgupta opened this issue 10 years ago • 9 comments

Expected Behavior

Should run normally without error

Actual Behavior

Traceback (most recent call last): File "pokecli.py", line 493, in main() File "pokecli.py", line 129, in main raise e AttributeError: 'PokemonGoBot' object has no attribute 'event_handler' 2016-08-07 10:27:03,808 [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 "/somewhere/PokemonGo-Bot/lib/python2.7/site-packages/raven/transport/threaded.py", line 174, in send_sync super(ThreadedHTTPTransport, self).send(data, headers) File "/somewhere/PokemonGo-Bot/lib/python2.7/site-packages/raven/transport/http.py", line 47, in send ca_certs=self.ca_certs, File "/somewhere/PokemonGo-Bot/lib/python2.7/site-packages/raven/utils/http.py", line 66, in urlopen return opener.open(url, data, timeout) File "/somewhere/PokemonGo-Bot/lib/python2.7/site-packages/future/backports/urllib/request.py", line 494, in open response = self._open(req, data) File "/somewhere/PokemonGo-Bot/lib/python2.7/site-packages/future/backports/urllib/request.py", line 512, in _open '_open', req) File "/somewhere/PokemonGo-Bot/lib/python2.7/site-packages/future/backports/urllib/request.py", line 466, in _call_chain result = func(*args) File "/somewhere/PokemonGo-Bot/lib/python2.7/site-packages/raven/utils/http.py", line 46, in https_open return self.do_open(ValidHTTPSConnection, req) File "/somewhere/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 "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1053, in request self._send_request(method, url, body, headers) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1093, in _send_request self.endheaders(body) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1049, in endheaders self._send_output(message_body) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 891, in _send_output msg += message_body UnicodeDecodeError: 'ascii' codec can't decode byte 0x9c in position 1: ordinal not in range(128) 2016-08-07 10:27:03,810 [sentry.errors.uncaught] [ERROR] [u"AttributeError: 'PokemonGoBot' object has no attribute 'event_handler'", u' File "pokecli.py", line 493, in ', u' File "pokecli.py", line 129, in main']

Steps to Reproduce

2016-08-07 10:27:01,989 [HandleSoftBan] [INFO] [softban_fix] Fixing softban.

Other Information

OS: Mac Git Commit: c21fad0e476a2ab77e8ec6eb898c03b1c3dbf3dd Python Version: Python 2.7.10

sparshgupta avatar Aug 07 '16 05:08 sparshgupta

Same result here: OS: Linux64 Git Commit: c21fad0 Python: 2.7.12

On softban, instead of spinning 2016-08-07 01:07:54,971 [HandleSoftBan] [INFO] [softban_fix] Fixing softban. Traceback (most recent call last): File "pokecli.py", line 493, in main() File "pokecli.py", line 129, in main raise e AttributeError: 'PokemonGoBot' object has no attribute 'event_handler'

Possible cause (although I don't see this specifcally)?

    except GeocoderQuotaExceeded:
        raise Exception("Google Maps API key over requests limit.")
    except Exception as e:
        # always report session summary and then raise exception
        if bot:
            report_summary(bot)

        raise e

middleagedman avatar Aug 07 '16 05:08 middleagedman

Tried on latest commit on dev after a bug fix: c58bed9d0f66cc093a097d5b2f611981c4602ee6

Still same issue

sparshgupta avatar Aug 07 '16 05:08 sparshgupta

I believe it's something in the softban fix code that's throwing an exception.

 spins = randint(50,60)
            self.emit_event(
                'softban_fix',
                formatted='Fixing softban.'
            )
            for i in xrange(spins):
                self.spin_fort(forts[0])
            self.bot.softban = False
            self.emit_event(
                'softban_fix_done',
                formatted='Softban should be fixed'
            )

middleagedman avatar Aug 07 '16 05:08 middleagedman

set health_record to false

bigkraig avatar Aug 07 '16 05:08 bigkraig

@bigkraig still getting the same error after setting health_record to false:

2016-08-07 10:59:58,609 [HandleSoftBan] [INFO] [softban_fix] Fixing softban.
2016-08-07 11:00:00,064 [       cli] [INFO] 
2016-08-07 11:00:00,065 [       cli] [INFO] Ran for 0:00:45
2016-08-07 11:00:00,065 [       cli] [INFO] Total XP Earned: 0  Average: 0.00/h
2016-08-07 11:00:00,065 [       cli] [INFO] Travelled 0.00km
2016-08-07 11:00:00,065 [       cli] [INFO] Visited 0 stops
2016-08-07 11:00:00,065 [       cli] [INFO] Encountered 0 pokemon, 0 caught, 0 released, 0 evolved, 0 never seen before
2016-08-07 11:00:00,065 [       cli] [INFO] Threw 0 pokeballs
2016-08-07 11:00:00,065 [       cli] [INFO] Earned 0 Stardust
2016-08-07 11:00:00,065 [       cli] [INFO] 
2016-08-07 11:00:00,066 [       cli] [INFO] Highest CP Pokemon: 
2016-08-07 11:00:00,066 [       cli] [INFO] Most Perfect Pokemon: 
Traceback (most recent call last):
  File "pokecli.py", line 493, in <module>
    main()
  File "pokecli.py", line 129, in main
    raise e
AttributeError: 'PokemonGoBot' object has no attribute 'event_handler'

sparshgupta avatar Aug 07 '16 05:08 sparshgupta

Getting same issue as last comment

TechDaddyKB avatar Aug 07 '16 05:08 TechDaddyKB

I think it works once you remove handlesoftban from config. Just have to wait till it spins 40 times

lchen-24 avatar Aug 07 '16 06:08 lchen-24

This is fixed with the latest commit on dev branch

sparshgupta avatar Aug 07 '16 06:08 sparshgupta

@sparshgupta can you close this now please?

k4n30 avatar Aug 07 '16 12:08 k4n30