You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/06/08 15:16:47 UTC

[GitHub] [airflow] zachliu commented on issue #23512: Random "duplicate key value violates unique constraint" errors when initializing the postgres database

zachliu commented on issue #23512:
URL: https://github.com/apache/airflow/issues/23512#issuecomment-1150056527

   @jhtimmins the fix https://github.com/apache/airflow/pull/24065 didn't fix this issue:
   
   ```
   webserver_1  | [2022-06-08 15:14:49 +0000] [108] [INFO] Listening at: http://0.0.0.0:5000 (108)
   webserver_1  | [2022-06-08 15:14:49 +0000] [108] [INFO] Using worker: sync
   webserver_1  | [2022-06-08 15:14:49 +0000] [118] [INFO] Booting worker with pid: 118
   webserver_1  | [2022-06-08 15:14:49 +0000] [119] [INFO] Booting worker with pid: 119
   webserver_1  | [2022-06-08 15:14:49 +0000] [120] [INFO] Booting worker with pid: 120
   webserver_1  | [2022-06-08 15:14:49 +0000] [121] [INFO] Booting worker with pid: 121
   webserver_1  | [2022-06-08 15:14:49,915] {{logging_config.py:46}} INFO - Successfully imported user-defined logging config from log_config.LOGGING_CONFIG
   webserver_1  | [2022-06-08 15:14:49,993] {{logging_config.py:46}} INFO - Successfully imported user-defined logging config from log_config.LOGGING_CONFIG
   webserver_1  | [2022-06-08 15:14:49,994] {{logging_config.py:46}} INFO - Successfully imported user-defined logging config from log_config.LOGGING_CONFIG
   webserver_1  | [2022-06-08 15:14:50,172] {{logging_config.py:46}} INFO - Successfully imported user-defined logging config from log_config.LOGGING_CONFIG
   webserver_1  | [2022-06-08 15:14:50,232] {{manager.py:585}} INFO - Removed Permission can create on Users to role Admin
   webserver_1  | [2022-06-08 15:14:50,255] {{manager.py:543}} INFO - Removed Permission View: can_create on Users
   webserver_1  | [2022-06-08 15:14:50,435] {{manager.py:585}} INFO - Removed Permission menu access on Permissions to role Admin
   webserver_1  | [2022-06-08 15:14:50,448] {{manager.py:543}} INFO - Removed Permission View: menu_access on Permissions
   postgres_1   | 2022-06-08 15:14:50.544 UTC [41] ERROR:  duplicate key value violates unique constraint "ab_view_menu_name_key"
   postgres_1   | 2022-06-08 15:14:50.544 UTC [41] DETAIL:  Key (name)=(Permission Pairs) already exists.
   postgres_1   | 2022-06-08 15:14:50.544 UTC [41] STATEMENT:  INSERT INTO ab_view_menu (id, name) VALUES (nextval('ab_view_menu_id_seq'), 'Permission Pairs') RETURNING ab_view_menu.id
   webserver_1  | [2022-06-08 15:14:50,545] {{manager.py:420}} ERROR - Add View Menu Error: (psycopg2.errors.UniqueViolation) duplicate key value violates unique constraint "ab_view_menu_name_key"
   webserver_1  | DETAIL:  Key (name)=(Permission Pairs) already exists.
   webserver_1  |
   webserver_1  | [SQL: INSERT INTO ab_view_menu (id, name) VALUES (nextval('ab_view_menu_id_seq'), %(name)s) RETURNING ab_view_menu.id]
   webserver_1  | [parameters: {'name': 'Permission Pairs'}]
   webserver_1  | (Background on this error at: http://sqlalche.me/e/14/gkpj)
   postgres_1   | 2022-06-08 15:14:50.554 UTC [42] ERROR:  duplicate key value violates unique constraint "ab_permission_view_permission_id_view_menu_id_key"
   postgres_1   | 2022-06-08 15:14:50.554 UTC [42] DETAIL:  Key (permission_id, view_menu_id)=(5, 84) already exists.
   postgres_1   | 2022-06-08 15:14:50.554 UTC [42] STATEMENT:  INSERT INTO ab_permission_view (id, permission_id, view_menu_id) VALUES (nextval('ab_permission_view_id_seq'), 5, 84) RETURNING ab_permission_view.id
   webserver_1  | [2022-06-08 15:14:50,554] {{manager.py:508}} INFO - Created Permission View: menu access on Permission Pairs
   webserver_1  | [2022-06-08 15:14:50,555] {{manager.py:511}} ERROR - Creation of Permission View Error: (psycopg2.errors.UniqueViolation) duplicate key value violates unique constraint "ab_permission_view_permission_id_view_menu_id_key"
   webserver_1  | DETAIL:  Key (permission_id, view_menu_id)=(5, 84) already exists.
   webserver_1  |
   webserver_1  | [SQL: INSERT INTO ab_permission_view (id, permission_id, view_menu_id) VALUES (nextval('ab_permission_view_id_seq'), %(permission_id)s, %(view_menu_id)s) RETURNING ab_permission_view.id]
   webserver_1  | [parameters: {'permission_id': 5, 'view_menu_id': 84}]
   webserver_1  | (Background on this error at: http://sqlalche.me/e/14/gkpj)
   webserver_1  | [2022-06-08 15:14:50,564] {{manager.py:568}} INFO - Added Permission menu access on Permission Pairs to role Admin
   ```


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org