ページの先頭行へ戻る
Enterprise Service Development Platform V1.2.0 トラブルシューティング集
FUJITSU Software

1.12 アップデート手順のCI Managementの切り戻しが失敗する

■事象

アップデート後にCI Managementの更新を切り戻すと失敗することがあります。

TASK [backout/ci_mng/redmine : Restore DB of redmine_db] ******************************************************
fatal: [172.16.1.0]: FAILED! => {"changed": true, "cmd": "docker exec fj_redmine_db /usr/bin/pg_restore -U postgres -d redmine -Fc /var/lib/postgresql/backup_fj_redmine_db.sqlc", "delta": "0:00:04.450302", "end": "2020-06-04 08:14:42.021331", "msg": "non-zero return code", "rc": 1, "start": "2020-06-04 08:14:37.571029", "stderr": "pg_restore: while PROCESSING TOC:\npg_restore: from TOC entry 3; 2615 2200 SCHEMA public postgres\npg_restore: error: could not execute query: ERROR:  schema \"public\" already exists\nCommand was: CREATE SCHEMA public;\n\n\npg_restore: warning: errors ignored on restore: 1", "stderr_lines": ["pg_restore: while PROCESSING TOC:", "pg_restore: from TOC entry 3; 2615 2200 SCHEMA public postgres", "pg_restore: error: could not execute query: ERROR:  schema \"public\" already exists", "Command was: CREATE SCHEMA public;", "", "", "pg_restore: warning: errors ignored on restore: 1"], "stdout": "", "stdout_lines": []} 

■原因

Redmineのデータベースの切り戻し処理で、DBのスキーマが競合しているため、切り戻しに失敗しています。

■対処方法

Automation Managerコンテナにログインし、/data/playbook/roles/backout/ci_mng/redmine/tasks/backout_redmine_db.ymlの下記部分をコメントアウトされていない状態に修正し、再実行します。

#- name: Drop duplicated schema
#  shell: "docker exec {{ redmine_postgres_container_name }} /usr/bin/psql -U {{ server.db.user }} {{ server.db_postgres }} -c 'drop schema if exists public;'"