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

   ### Apache Airflow Provider(s)
   
   fab
   
   ### Versions of Apache Airflow Providers
   
   apache-airflow-providers-fab==2.4.2
   
   ### Apache Airflow version
   
   3.0.6
   
   ### Operating System
   
   Debian GNU/Linux 12 (bookworm)
   
   ### Deployment
   
   Official Apache Airflow Helm Chart
   
   ### Deployment details
   
   _No response_
   
   ### What happened
   
   I'm upgrading an Airflow instance from 2.11.0 to 3.0.6 while setting 
`auth_manager = 
airflow.providers.fab.auth_manager.fab_auth_manager.FabAuthManager` as detailed 
in the migration guide.
   
   During the deployment, the `airflow-run-airflow-migrations` container is 
erroring with the following:
   
   ```
    sqlalchemy.exc.ProgrammingError: (psycopg2.errors.DuplicateTable) relation 
"ab_view_menu" already exists                                                   
 │
   │                                                                            
                                                                                
 │
   │ [SQL:                                                                      
                                                                                
 │
   │ CREATE TABLE ab_view_menu (                                                
                                                                                
 │
   │     id SERIAL NOT NULL,                                                    
                                                                                
 │
   │     name VARCHAR(250) NOT NULL,                                            
                                                                                
 │
   │     CONSTRAINT ab_view_menu_pkey PRIMARY KEY (id),                         
                                                                                
 │
   │     CONSTRAINT ab_view_menu_name_uq UNIQUE (name)                          
                                                                                
 │
   │ )                                                                          
                                                                                
 │
   │                                                                            
                                                                                
 │
   │ ]                                                                          
                                                                                
 │
   │ (Background on this error at: https://sqlalche.me/e/14/f405) 
   ```
   
   I did some investigation and I noticed that in the [migration 
file](https://github.com/apache/airflow/blob/1b88626ac3904ac98a293bef934c8b136eb21b42/providers/fab/src/airflow/providers/fab/migrations/versions/0001_1_4_0_create_ab_tables_if_missing.py#L119-L123)
 the only table that does not have `if_not_exists=True` is `ab_view_menu`, the 
one that is giving me an error. Is this intended?
   
   ### What you think should happen instead
   
   The migration should complete when `ab_view_menu` already exists.
   
   ### How to reproduce
   
   Upgrade an already existing airflow instance with FabAuthManager from 2.11.0 
to 3.0.6. Running FAB migrations should fail.
   
   ### Anything else
   
   _No response_
   
   ### 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