tejado / pgoapi

Pokemon Go API lib
Other
1.4k stars 445 forks source link

get_api_endpoint fails: Unexpected end-group tag #31

Closed akcom closed 8 years ago

akcom commented 8 years ago

Output: [!] Your given location: --- [!] lat/long/alt: ---, --- 0.0 [!] login for: ---- [+] RPC Session Token: TGT-6730523-TUZOag4OqN1wU ... Unexpected end-group tag. [-] RPC server offline

Seems that get_api_endpoint() is failing, potentially related to an updated constant in the newest release?

tejado commented 8 years ago

I guess, just a server issue if they are too busy or offline. I rewrote the codebase. If this happens again, please notify me :) Thanks for reporting.

nborrmann commented 8 years ago

Still an issue after the rewrite.

$ python pokecli.py -a ptc -u xxx -p xxx -l "Muenchen"
2016-07-19 17:01:30,266 [   pokecli] [ INFO] Your given location: Munich, Germany
2016-07-19 17:01:30,266 [   pokecli] [ INFO] lat/long/alt: 48.1351253 11.5819806 0.0
2016-07-19 17:01:30,269 [  auth_ptc] [ INFO] Login for: xxx
2016-07-19 17:01:31,082 [  auth_ptc] [ INFO] PTC Login successful
2016-07-19 17:01:31,082 [    pgoapi] [ INFO] Starting RPC login sequence (app simulation)
2016-07-19 17:01:31,084 [    pgoapi] [ INFO] Create new request...
2016-07-19 17:01:31,084 [    pgoapi] [ INFO] Adding 'GET_PLAYER' to RPC request
2016-07-19 17:01:31,085 [    pgoapi] [ INFO] Adding 'GET_HATCHED_EGGS' to RPC request
2016-07-19 17:01:31,085 [    pgoapi] [ INFO] Adding 'GET_INVENTORY' to RPC request
2016-07-19 17:01:31,085 [    pgoapi] [ INFO] Adding 'CHECK_AWARDED_BADGES' to RPC request
2016-07-19 17:01:31,085 [    pgoapi] [ INFO] Adding 'DOWNLOAD_SETTINGS' to RPC request including arguments
2016-07-19 17:01:31,085 [    pgoapi] [ INFO] Execution of RPC
2016-07-19 17:01:33,936 [    pgoapi] [ INFO] Cleanup of request!
2016-07-19 17:01:33,940 [    pgoapi] [ INFO] Finished RPC login sequence (app simulation)
2016-07-19 17:01:33,940 [    pgoapi] [ INFO] Login process completed
2016-07-19 17:01:33,940 [    pgoapi] [ INFO] Create new request...
2016-07-19 17:01:33,940 [    pgoapi] [ INFO] Adding 'GET_PLAYER' to RPC request
2016-07-19 17:01:33,944 [    pgoapi] [ INFO] Adding 'GET_MAP_OBJECTS' to RPC request including arguments
2016-07-19 17:01:33,944 [    pgoapi] [ INFO] Execution of RPC
Traceback (most recent call last):
  File "pokecli.py", line 162, in <module>
    main()
  File "pokecli.py", line 155, in main
    response_dict = api.call()
  File "D:\Users\Test\Downloads\poke\pgoapi\pgoapi\pgoapi.py", line 78, in call
    response = request.request(api_endpoint, self._req_method_list, player_position)
  File "D:\Users\Test\Downloads\poke\pgoapi\pgoapi\rpc_api.py", line 84, in request
    response_dict = self._parse_main_request(response, subrequests)
  File "D:\Users\Test\Downloads\poke\pgoapi\pgoapi\rpc_api.py", line 160, in _parse_main_request
    response_proto.ParseFromString(response_raw.content)
  File "D:\Program Files\python27\lib\site-packages\google\protobuf\message.py", line 186, in ParseFromString
    self.MergeFromString(serialized)
  File "D:\Program Files\python27\lib\site-packages\google\protobuf\internal\python_message.py", line 844, in MergeFromString
    raise message_mod.DecodeError('Unexpected end-group tag.')
google.protobuf.message.DecodeError: Unexpected end-group tag.
tejado commented 8 years ago

Yes... servers are overloaded :(

nborrmann commented 8 years ago

Imo this should show an error message (and possibly retry) and not a stack trace.

tejado commented 8 years ago

Yeah I will fix it.

volksport commented 8 years ago

Perhaps this should be reopened then?

tejado commented 8 years ago

Fix is in few minutes online ;)

tejado commented 8 years ago

Done! https://github.com/tejado/pgoapi/commit/b80166f56d5fab25f3d083993f0ddb3dfae9c900