zachliu commented on issue #23512: URL: https://github.com/apache/airflow/issues/23512#issuecomment-1150469780
@arroadie only a layman solution here: https://github.com/apache/airflow/issues/23512#issuecomment-1140160062. it's just calling the `create_app` before spinning up all the workers and setting a env flag st the workers don't touch the fab permissions i did dig into the source code but still only have limited understanding on this. afaik, permission related setups should be done at the database init stage `airflow db init`, and yes most of them did occur during that stage: ``` webserver_1 | INFO [alembic.runtime.migration] Running upgrade 45ba3f1493b9 -> 849da589634d, Prefix DAG permissions. webserver_1 | INFO [alembic.runtime.migration] Running upgrade 849da589634d -> 2c6edca13270, Resource based permissions. webserver_1 | [2022-06-08 21:57:56,743] {{manager.py:244}} INFO - Inserted Role: Admin webserver_1 | [2022-06-08 21:57:56,748] {{manager.py:244}} INFO - Inserted Role: Public webserver_1 | [2022-06-08 21:57:56,750] {{manager.py:805}} WARNING - No user yet created, use flask fab command to do it. webserver_1 | [2022-06-08 21:57:57,705] {{providers_manager.py:215}} INFO - Optional provider feature disabled when importing 'airflow.providers.google.leveldb.hooks.leveldb.LevelDBHook' from 'apache-airflow-providers-google' package webserver_1 | [2022-06-08 21:57:57,779] {{providers_manager.py:215}} INFO - Optional provider feature disabled when importing 'airflow.providers.google.leveldb.hooks.leveldb.LevelDBHook' from 'apache-airflow-providers-google' package webserver_1 | [2022-06-08 21:57:58,715] {{manager.py:508}} INFO - Created Permission View: can delete on Connections webserver_1 | [2022-06-08 21:57:58,722] {{manager.py:508}} INFO - Created Permission View: can read on Connections webserver_1 | [2022-06-08 21:57:58,732] {{manager.py:508}} INFO - Created Permission View: can edit on Connections ... webserver_1 | [2022-06-08 21:58:00,121] {{manager.py:508}} INFO - Created Permission View: can edit on Passwords webserver_1 | [2022-06-08 21:58:00,124] {{manager.py:568}} INFO - Added Permission can edit on Passwords to role Admin webserver_1 | [2022-06-08 21:58:00,126] {{manager.py:568}} INFO - Added Permission can read on Roles to role Admin webserver_1 | [2022-06-08 21:58:00,128] {{manager.py:568}} INFO - Added Permission can edit on Roles to role Admin webserver_1 | INFO [alembic.runtime.migration] Running upgrade 2c6edca13270 -> 61ec73d9401f, Add description field to ``connection`` table webserver_1 | INFO [alembic.runtime.migration] Running upgrade 61ec73d9401f -> 64a7d6477aae, Fix description field in ``connection`` to be ``text`` ``` however, as i commented here https://github.com/apache/airflow/issues/23512#issuecomment-1140160062, certain methods are able to do it **after** the gunicorn workers are spun up. so the workers are doing the same actions on the same database causing a ton of conflicts. -- 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]
