russellvt / pychallonge

Drop-in Replacement of pychallonge
https://challonge.com/api
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

502 Gateway Error #2

Closed russellvt closed 3 years ago

russellvt commented 3 years ago

Taken from ZEDGR/pychallonge#6.

Current stacktrace:

File "/usr/lib/python3.6/site-packages/challonge/tournaments.py", line 6, in index
    return api.fetch_and_parse("GET", "tournaments", **params)
  File "/usr/lib/python3.6/site-packages/challonge/api.py", line 96, in fetch_and_parse
    response = fetch(method, uri, params_prefix, **params)
  File "/usr/lib/python3.6/site-packages/challonge/api.py", line 85, in fetch
    response.raise_for_status()
  File "/usr/lib/python3.6/site-packages/requests/models.py", line 941, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 502 Server Error:
    Bad Gateway for url: https://api.challonge.com/v1/tournaments.json?state=all

Note thatt my Bourne Shell scripts, using curl, still work without issue. Assuming this has something to do with user authentication methods (URL versus posted or URI values).

russellvt commented 3 years ago

This is/was actually a problem with not setting the user-agent properly, and leaving it to python requests. ZEDGR fixed this quickly, in his stream.