Reputation: 19913
We are using Airflow in GCP using composer-2.9.7-airflow-2.9.3 using SSO auth. In our Active Directory I have a new account using same old email address, (and old email address is changed)
Unfortunately Airflow is still having my old AD Id and hence when I login it says "Not authorized or account inactive" I have this issue on all 3 airflow envs we have.
I tried below and deleted user on dev environment, then login again and I have access again
gcloud composer environments run composer-dev-processing-001 --location northamerica-northeast1 users delete -- -e [email protected]
but when I try to delete user on uat env, seems there is a Foreign Key between dag_run_note
table and users
and it doesn't let me to delete, also I tried to find a way to change email address instead of deleting also can't find a way
[2024-10-21T20:16:55.244+0000] {override.py:1643} ERROR - Remove Register User Error: (psycopg2.errors.ForeignKeyViolation) update or delete on table "ab_user" violates foreign key constraint "dag_run_note_user_fkey" on table "dag_run_note"
DETAIL: Key (id)=(1) is still referenced from table "dag_run_note".
[SQL: DELETE FROM ab_user WHERE ab_user.id = %(id)s]
[parameters: {'id': 1}]
(Background on this error at: https://sqlalche.me/e/14/gkpj)
ERROR: Error message: /opt/python3.11/lib/python3.11/site-packages/airflow/metrics/statsd_logger.py:184 RemovedInAirflow3Warning: The basic metric validator will be deprecated in the future in favor of pattern-matching. You can try this now by setting config option metrics_use_pattern_match to True.
/opt/python3.11/lib/python3.11/site-packages/airflow/www/extensions/init_appbuilder.py:164 DeprecationWarning: The update_fab_perms option in [webserver] has been moved to the update_fab_perms option in [fab] - the old setting has been used, but please update your config.
/opt/python3.11/lib/python3.11/site-packages/flask_limiter/extension.py:333 UserWarning: Using the in-memory storage for tracking rate limits as no storage was explicitly specified. This is not recommended for production use. See: https://flask-limiter.readthedocs.io#configuring-a-storage-backend for documentation about configuring the storage backend.
/opt/python3.11/lib/python3.11/site-packages/paramiko/transport.py:219 CryptographyDeprecationWarning: Blowfish has been deprecated
/opt/python3.11/lib/python3.11/site-packages/airflow/plugins_manager.py:277 RemovedInAirflow3Warning: This decorator is deprecated.
In previous versions, all subclasses of BaseOperator must use apply_default decorator for the `default_args` feature to work properly.
In current version, it is optional. The decorator is applied automatically using the metaclass.
/opt/python3.11/lib/python3.11/site-packages/airflow/www/extensions/init_appbuilder.py:164 DeprecationWarning: The update_fab_perms option in [webserver] has been moved to the update_fab_perms option in [fab] - the old setting has been used, but please update your config.
/opt/python3.11/lib/python3.11/site-packages/flask_limiter/extension.py:333 UserWarning: Using the in-memory storage for tracking rate limits as no storage was explicitly specified. This is not recommended for production use. See: https://flask-limiter.readthedocs.io#configuring-a-storage-backend for documentation about configuring the storage backend.
Failed to delete user
ERROR: Command exit code: 1
Wondering if there is a way to either
Any help appreciated
Upvotes: 0
Views: 95