Skip to content

Error when deleting role using FAB. #65375

@TKul6

Description

@TKul6

Under which category would you file this issue?

Providers

Apache Airflow version

3.1.7

What happened and how to reproduce it?

I'm trying to delete role using the HTTP route of the FAB api.
The Route I'm using is /auth/fab/v1/roles/<ROLE_NAME>.
When running the HttpRequest I get status codew 500. I entered the api-server pod and saw there is a FK violation in the db:

sqlalchemy.exc.IntegrityError: (psycopg2.errors.ForeignKeyViolation) update or delete on table "ab_role" violates foreign key constraint "ab_permission_view_role_role_id_fkey" on table "ab_permission_view_role"
DETAIL:  Key (id)=(103) is still referenced from table "ab_permission_view_role".
[SQL: DELETE FROM ab_role WHERE ab_role.name = %(name_1)s]
[parameters: {'name_1': '<ROLE_NAME>'}]
(Background on this error at: https://sqlalche.me/e/20/gkpj)

The strange thing is when deleting the role via the Airflow UI it works successfully.

What you think should happen instead?

I checked the db version and it seems to be up to date, moreover when running airflow db migrate it seems I'm on the right version.

Operating System

I'm using Airflow on Kubernetes.

Deployment

Official Apache Airflow Helm Chart

Apache Airflow Provider(s)

fab

Versions of Apache Airflow Providers

The fab version is 3.6.0

Official Helm Chart version

1.20.0 (latest released)

Kubernetes Version

No response

Helm Chart configuration

No response

Docker Image customizations

No response

Anything else?

The issue started when I installed airflow 3. In airflow 2.10 I had a route in the official rest api that handles that and it worked.

Really strange deleting from the UI is working.
Also, deleting using the airflow cli works.

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions