mrphlip / lrrbot

LoadingReadyRun Twitch chatbot
https://lrrbot.com/
Apache License 2.0
30 stars 20 forks source link

Alembic upgrade scripts are broken #1520

Closed Anaerin closed 5 months ago

Anaerin commented 5 months ago

Attempting to run the alembic upgrade as per the readme and it fails at 07ea7b63c8fc -> a6854cd2e5f1:

  File "/home/anaerin/lrrbot/alembic/versions/a6854cd2e5f1_users.py", line 50, in upgrade
    req.raise_for_status()
  File "/home/anaerin/.local/share/virtualenvs/lrrbot-9e_YOwWH/lib/python3.11/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://id.twitch.tv/oauth/token?client_id=<redacted>&client_secret=<redacted>&grant_type=client_credentials

It appears the oauth endpoint has moved from https://id.twitch.tv/oauth to https://id.twitch.tv/oauth2. Updating that lets us continue to the next step:

[2024-04-07 17:37:41,332] INFO:alembic.runtime.migration:Running upgrade a6854cd2e5f1 -> 77dc71b483ed
(...)
  File "/home/anaerin/lrrbot/alembic/versions/77dc71b483ed_users_foreign_keys.py", line 25, in upgrade
    conn.execute("UPDATE history SET changeuser = %s WHERE changeuser = %s", new, old)
TypeError: Connection.execute() takes from 2 to 3 positional arguments but 4 were given

Which makes absolutely no sense to me.

andreasots commented 5 months ago

Fixed in 0bc4870bd06614d1e08d8a4b2059e60057a0ec73.