home..
Bug
April 2022 (119 Words, 1 Minutes)
airflow create user error
NAME READY STATUS RESTARTS AGE
airflow-create-user-5rv95 0/1 CrashLoopBackOff 3 2m31s
postgres=> \d public.ab_user;
Table "public.ab_user"
Column | Type | Collation | Nullable | Default
------------------+-----------------------------+-----------+----------+-------------------------------------
id | integer | | not null | nextval('ab_user_id_seq'::regclass)
first_name | character varying(64) | | not null |
last_name | character varying(64) | | not null |
username | character varying(64) | | not null |
password | character varying(256) | | |
active | boolean | | |
email | character varying(64) | | not null |
last_login | timestamp without time zone | | |
login_count | integer | | |
fail_login_count | integer | | |
created_on | timestamp without time zone | | |
changed_on | timestamp without time zone | | |
created_by_fk | integer | | |
changed_by_fk | integer | | |
Indexes:
"ab_user_pkey" PRIMARY KEY, btree (id)
"ab_user_email_key" UNIQUE CONSTRAINT, btree (email)
"ab_user_username_key" UNIQUE CONSTRAINT, btree (username)
Foreign-key constraints:
"ab_user_changed_by_fk_fkey" FOREIGN KEY (changed_by_fk) REFERENCES ab_user(id)
"ab_user_created_by_fk_fkey" FOREIGN KEY (created_by_fk) REFERENCES ab_user(id)
Referenced by:
TABLE "ab_user" CONSTRAINT "ab_user_changed_by_fk_fkey" FOREIGN KEY (changed_by_fk) REFERENCES ab_user(id)
TABLE "ab_user" CONSTRAINT "ab_user_created_by_fk_fkey" FOREIGN KEY (created_by_fk) REFERENCES ab_user(id)
TABLE "ab_user_role" CONSTRAINT "ab_user_role_user_id_fkey" FOREIGN KEY (user_id) REFERENCES ab_user(id)
airflow cluster를 배포하는데 오류가 발생한다.
airflow meta db 테이블에서 확인하면 ab_user_email_key
, ab_user_username_key
가 고유해야 하는데 기존에 있는 user와 충돌이 나서 기존 user를 지우고 새로 생성해서 해결한다.