TKul6 opened a new issue, #65375:
URL: https://github.com/apache/airflow/issues/65375

   ### 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: 
   ```python
   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?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to