Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

connection was closed in the middle of operation #128

Open
AntonOfTheWoods opened this issue May 15, 2024 · 2 comments
Open

connection was closed in the middle of operation #128

AntonOfTheWoods opened this issue May 15, 2024 · 2 comments

Comments

@AntonOfTheWoods
Copy link

I'm just getting started trying to set up a trigger and function for a supabase user profile table with autogenerate.

Any attempt to import anything from alembic_utils fails when I try to autogenerate:

...
  File "/usr/local/lib/python3.12/site-packages/sqlalchemy/dialects/postgresql/asyncpg.py", line 789, in _handle_exception
    raise translated_error from error
sqlalchemy.exc.DBAPIError: (sqlalchemy.dialects.postgresql.asyncpg.Error) <class 'asyncpg.exceptions.ConnectionDoesNotExistError'>: connection was closed in the middle of operation
[SQL: SAVEPOINT sa_savepoint_1]
(Background on this error at: https://sqlalche.me/e/20/dbapi)
command terminated with exit code 1

I'm using alembic==1.13.1, alembic-utils==0.8.2 and sqlalchemy==2.0.30. I couldn't find anything in the instructions.

Is this a bug or am I holding it wrong?

@olirice
Copy link
Owner

olirice commented May 15, 2024

Could you please try to produce a minimal reproducible example so I can dig into it locally?

please include your env.py, definition of the trigger, and asyncpg version

@olirice
Copy link
Owner

olirice commented May 15, 2024

It'd be worth testing it with psycopg2-binary to see if you still get the error too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants