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

Unstable alembic behaviour #1544

Open
SofiaSazonova opened this issue Sep 12, 2024 · 0 comments
Open

Unstable alembic behaviour #1544

SofiaSazonova opened this issue Sep 12, 2024 · 0 comments
Labels
priority: medium type: bug Something isn't working

Comments

@SofiaSazonova
Copy link
Contributor

Describe the bug

revision = '852cdf6cf1e0'
While executing code

PermissionService.save_permission(
            session,
            name=perm,
            description=ENVIRONMENT_REDSHIFT_ALL_WITH_DESC[perm],
            permission_type=PermissionType.RESOURCE.name,
        )

the DB_migration handler throws an error, while performing 'find permission' select:

[SQL: SELECT permission."permissionUri" AS "permission_permissionUri", permission.name AS permission_name, permission.type AS permission_type, permission.description AS permission_description, permission.created AS permission_created, permission.updated AS permission_updated   FROM permission WHERE permission.name = %(name_1)s AND permission.type = %(type_1)s LIMIT %(param_1)s]
[parameters: {'name_1': 'LIST_ENVIRONMENT_REDSHIFT_CONNECTIONS', 'type_1': 'RESOURCE', 'param_1': 1}]

Only information in the logs: (Background on this error at: http://sqlalche.me/e/13/2j85 )

The problem is unclear. The same issue was reported here but has no answer yet.

How to Reproduce

It certainly does not appear when all migrations are executed at once.
It doesn't depend on whether the permissions exist in DB or not.

apply this to the target database

alembic -c backend/alembic.ini downgrade 7c5b30fee306   
alembic -c backend/alembic.ini upgrade 852cdf6cf1e0    

Expected behavior

If we can't find the proper fix, I suggest to rewrite saving permission using alembic 'execute'

Your project

No response

Screenshots

No response

OS

macOs Sonoma 14.2

Python version

3.11

AWS data.all version

2.3.0

Additional context

No response

@SofiaSazonova SofiaSazonova added type: bug Something isn't working priority: medium labels Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: medium type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant