FAForever / server

The servercode for the Forged Alliance Forever lobby
http://www.faforever.com
GNU General Public License v3.0
66 stars 61 forks source link

Achievements are broken again #946

Closed Askaholic closed 1 year ago

Askaholic commented 1 year ago

Achievements have been broken for quite some time due to a change in how the API does authentication. The error currently looks like this:

ERROR    Dec 25  22:33:11 SessionManager                 404, message='Not Found', url=URL('https://api.test.faforever.com/oauth/token')
Traceback (most recent call last):
  File "/code/server/api/api_accessor.py", line 40, in get_session
    await self.session.fetch_token()
  File "/code/server/api/oauth_session.py", line 43, in fetch_token
    creds = await self._make_request(data=data)
  File "/code/server/api/oauth_session.py", line 69, in _make_request
    async with session.post(self.token_url, data=data) as resp:
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 1141, in __aenter__
    self._resp = await self._coro
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 643, in _request
    resp.raise_for_status()
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client_reqrep.py", line 1005, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found', url=URL('https://api.test.faforever.com/oauth/token')

The short term solution would be to fix the authentication code to work with the new method, however, we should really be persisting the achievements in some more reliable manner. Sending them to the API via HTTP is just bound to keep breaking in the future.

Brutus5000 commented 1 year ago

Send it to rabbitmq, the api is waiting for it https://github.com/FAForever/faf-java-api/pull/633