tfmm
tfmm•8mo ago

Upgrade from 2.70.x to 2.71.x fails with migration errors

When upgrading from 2.70.7 to 2.71.5 running in docker from the official GHCR image, I get this error, and the container fails:
time="2025-03-28T17:41:50Z" level=info msg="starting migration" caller="/home/runner/work/zitadel/zitadel/internal/migration/migration.go:66" name=52_idp_templates6_ldap2
time="2025-03-28T17:41:50Z" level=error msg="migration failed" caller="/home/runner/work/zitadel/zitadel/internal/migration/migration.go:68" error="ERROR: relation \"idp_templates6_ldap2\" already exists (SQLSTATE 42P07)" name=52_idp_templates6_ldap2
time="2025-03-28T17:41:50Z" level=fatal msg="migration failed" caller="/home/runner/work/zitadel/zitadel/cmd/setup/setup.go:304" code=42P07 detail= error="ERROR: relation \"idp_templates6_ldap2\" already exists (SQLSTATE 42P07)" hint= message="relation \"idp_templates6_ldap2\" already exists" name=52_idp_templates6_ldap2 severity=ERROR
time="2025-03-28T17:41:50Z" level=info msg="starting migration" caller="/home/runner/work/zitadel/zitadel/internal/migration/migration.go:66" name=52_idp_templates6_ldap2
time="2025-03-28T17:41:50Z" level=error msg="migration failed" caller="/home/runner/work/zitadel/zitadel/internal/migration/migration.go:68" error="ERROR: relation \"idp_templates6_ldap2\" already exists (SQLSTATE 42P07)" name=52_idp_templates6_ldap2
time="2025-03-28T17:41:50Z" level=fatal msg="migration failed" caller="/home/runner/work/zitadel/zitadel/cmd/setup/setup.go:304" code=42P07 detail= error="ERROR: relation \"idp_templates6_ldap2\" already exists (SQLSTATE 42P07)" hint= message="relation \"idp_templates6_ldap2\" already exists" name=52_idp_templates6_ldap2 severity=ERROR
8 Replies
tfmm
tfmmOP•8mo ago
looks potentially related to https://github.com/zitadel/zitadel/pull/9292 but i'm not certain
GitHub
feat(ldap): adding root ca option to ldap config by kkrime · Pull ...
Which Problems Are Solved Adding ability to add a root CA to LDAP configs Additional Context Closes [Bug]: Identity Provider - LDAP cannot use LDAPS when certificate signed by unknown authority #7888
Unknown User
Unknown User•8mo ago
Message Not Public
Sign In & Join Server To View
Paul
Paul•8mo ago
Also happens from 2.71.4 to 2.71.5; 2.71.4 works fine Maybe this helps the devs to give us some hint about what to do. zitadel-1 | time="2025-03-30T17:44:12Z" level=info msg="starting migration" caller="/home/runner/work/zitadel/zitadel/internal/migration/migration.go:66" name=52_idp_templates6_ldap2 db-1 | 2025-03-30 17:44:12.922 UTC [3685723] ERROR: relation "idp_templates6_ldap2" already exists db-1 | 2025-03-30 17:44:12.922 UTC [3685723] STATEMENT: ALTER TABLE IF EXISTS projections.idp_templates6_ldap3 RENAME COLUMN rootCA TO root_ca; db-1 | ALTER TABLE IF EXISTS projections.idp_templates6_ldap3 RENAME TO idp_templates6_ldap2; db-1 |
zitadel-1 | time="2025-03-30T17:44:12Z" level=error msg="migration failed" caller="/home/runner/work/zitadel/zitadel/internal/migration/migration.go:68" error="ERROR: relation "idp_templates6_ldap2" already exists (SQLSTATE 42P07)" name=52_idp_templates6_ldap2 zitadel-1 | time="2025-03-30T17:44:12Z" level=fatal msg="migration failed" caller="/home/runner/work/zitadel/zitadel/cmd/setup/setup.go:304" code=42P07 detail= error="ERROR: relation "idp_templates6_ldap2" already exists (SQLSTATE 42P07)" hint= message="relation "idp_templates6_ldap2" already exists" name=52_idp_templates6_ldap2 severity=ERROR zitadel-1 exited with code 1
Unknown User
Unknown User•8mo ago
Message Not Public
Sign In & Join Server To View
tfmm
tfmmOP•8mo ago
Thanks @stebenz !
Unknown User
Unknown User•8mo ago
Message Not Public
Sign In & Join Server To View
tfmm
tfmmOP•8mo ago
Yep, just tested, works great for me.
Paul
Paul•8mo ago
Thank you! works great 👍

Did you find this page helpful?