Skip to content

pgoapi.exceptions.UnexpectedResponseException: Unexpected HTTP server response - needs 200 got 502 #2406

@JSchwerberg

Description

@JSchwerberg

Expected Behavior

Bot continues to run, doesn't crash

Actual Behavior

Traceback (most recent call last):
  File "./pokecli.py", line 442, in <module>
    main()
  File "./pokecli.py", line 85, in main
    report_summary(bot)
  File "./pokecli.py", line 93, in report_summary
    metrics.capture_stats()
  File "/home/junaos/PokemonGo-Bot/pokemongo_bot/metrics.py", line 76, in capture_stats
    response_dict = request.call()
  File "/home/junaos/PokemonGo-Bot/pokemongo_bot/api_wrapper.py", line 100, in call
    result = self._call()
  File "/home/junaos/PokemonGo-Bot/pokemongo_bot/api_wrapper.py", line 60, in _call
    return PGoApiRequest.call(self)
  File "/home/junaos/PokemonGo-Bot/src/pgoapi/pgoapi/pgoapi.py", line 182, in call
    response = request.request(self._api_endpoint, self._req_method_list, self.get_position())
  File "/home/junaos/PokemonGo-Bot/src/pgoapi/pgoapi/rpc_api.py", line 106, in request
    response_dict = self._parse_main_response(response, subrequests)
  File "/home/junaos/PokemonGo-Bot/src/pgoapi/pgoapi/rpc_api.py", line 237, in _parse_main_response
    raise UnexpectedResponseException(error)
pgoapi.exceptions.UnexpectedResponseException: Unexpected HTTP server response - needs 200 got 502

Steps to Reproduce

Nothing in particular -- just started happening as of 23:25 UTC, is now happening frequently.

502 is bad gateway, so the servers may be overloaded; we should catch this exception and retry.

Other Information

OS: Ubuntu 14.04.4 LTS
Git Commit: bdf2e7d
Python Version: Python 2.7.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions