boblack_zocker
boblack_zocker•2w ago

upgrading from v2.65.10 to v2.66.0 error at setup

Hello i am upgrading our zitadel infrastructure to the newest version. Right now i have a problem upgrading from v2.65.10 to v2.66.0. i get the following error in the logs: zitadel-1 | time="2025-10-09T11:09:44Z" level=info msg="starting migration" caller="/home/runner/work/zitadel/zitadel/internal/migration/migration.go:66" name=40_init_push_func zitadel-1 | time="2025-10-09T11:09:44Z" level=info msg="execute statement" caller="/home/runner/work/zitadel/zitadel/cmd/setup/40.go:41" file=40_init_push_func.sql migration=40_init_push_func dzitadel-1 | time="2025-10-09T11:09:44Z" level=error msg="migration failed" caller="/home/runner/work/zitadel/zitadel/internal/migration/migration.go:68" error="40_init_push_func 40_init_push_func.sql: ERROR: at or near "(": syntax error (SQLSTATE 42601)" name=40_init_push_func zitadel-1 | time="2025-10-09T11:09:45Z" level=fatal msg="migration failed" caller="/home/runner/work/zitadel/zitadel/cmd/setup/setup.go:261" error="40_init_push_func 40_init_push_func.sql: ERROR: at or near "(": syntax error (SQLSTATE 42601)" name=40_init_push_func as database i have cockroachdb v22.2.19
13 Replies
Ask Inkeep
Ask Inkeep•2w ago
Hi @boblack_zocker, I'm an AI assistant for ZITADEL. While a team member reviews this question, I'll see if I can find relevant sources for your question. Answer I wasn't able to find a direct answer, here are some relevant sources: 1. Stuck on "migration already started, will check again in 5 seconds" : This discusses using zitadel setup cleanup to resolve stuck migrations, which may help if your migration gets stuck after the current error (1) . 2. migration error updating from 2.20.2 to 2.22.3 : Shows similar migration issues during upgrades and suggests trying the zitadel setup cleanup command when migrations fail (2) . I'd suggest clicking the "Ask for help" button to tag a team member who can review this specific migration error with the 40_init_push_func step. ​ To learn more, see the sources I considered: [1] Stuck on "migration already started, will check again in 5 seconds" [2] migration error updating from 2.20.2 to 2.22.3 ​ Feel free to tag @Ask Inkeep with additional questions. Got it. Tagging @Rajat for additional help.
Rajat
Rajat•2w ago
hey @boblack_zocker can you pls give me more context?. What commands did you ran, what did you expect?. Thanks
boblack_zocker
boblack_zockerOP•2w ago
Hey, so for the context: Our zitadel is running on a old version v2.65.10. We want to update to the newest version. We use docker compose. How i am doing this: edit version in the compose file 1 version higher. so in my case to v2.66.0. then i run "zitadel setup". now in the process "zitadel setup" i ran into this error above. What also could help me if u cant help with the script failure: Is there a way to not update zitadel but instead import all the settings and users to a newly built zitadel v4. (surely only if this is possible) my aim is to get to the latest version
Rajat
Rajat•2w ago
hey @boblack_zocker I think the easiest way would be to migrate users which pretty much migrates everything that a user needs.
boblack_zocker
boblack_zockerOP•2w ago
yes i thought about this too. i am locally testing right now how this here is working: https://zitadel.com/docs/guides/migrate/sources/zitadel#use-file would this work to upgrade from v2 to v4? is there a documentation where i can find the error codes and what they are for? because i could export all into a file but now i struggle to import it on the new instance i think i found out now i found a mistake in the documentaion @Rajat https://zitadel.com/docs/guides/migrate/sources/zitadel#import-from-file Here it says to send the object as "data_orgsv1" But if you go to the api documentation its not "data_orgsv1" but its "dataOrgsv1" https://zitadel.com/docs/apis/resources/admin/admin-service-import-data thats why it didnt work rigth away for me šŸ˜„ hmm. its still not working
boblack_zocker
boblack_zockerOP•2w ago
what could be the reason?
No description
Rajat
Rajat•2w ago
hey @boblack_zocker it maybe habe to do with the export.json file, could you please share just ONE of the user data so I can try running it against my cluster?.
boblack_zocker
boblack_zockerOP•2w ago
"humanUsers": [ { "userId": "205336722215534595", "user": { "userName": "blabladominik23@muellmail.com", "profile": { "firstName": "Dominik", "lastName": ">B", "displayName": "Dominik >B", "preferredLanguage": "und" }, "email": { "email": "blabladominik23@muellmail.com", "isEmailVerified": true }, "hashedPassword": { "value": "$2a$14$hwOvUDw6P0CUqfSqjFE.g.29GWm0x5h5iVPWeD9DKILfAO1gMfMVy" } }} ] this are testdata so not tragic But to clarify, are we talking about the same api? because i talk about this import/export process: https://zitadel.com/docs/guides/migrate/sources/zitadel#use-file and i think you talk about this here: https://zitadel.com/docs/guides/migrate/users
Rajat
Rajat•2w ago
hey @boblack_zocker good morning!. I will try both of endpoints, no worries
boblack_zocker
boblack_zockerOP•2w ago
ā¤ļø
Rajat
Rajat•7d ago
hey @boblack_zocker but this was the command that you were struggling with correct?.
curl --request POST \
--url <custom-domain>/admin/v1/import \
--header "Authorization: Bearer $PAT_IMPORT_TOKEN" \
--header 'Content-Type: application/json' \
--data @export.json
{"errors":[{"type":"org","id":"299415687774972672","message":"ID=ORG-lapo2n Message=Errors.Org.AlreadyExisting"}],"success":{"orgs":[{"orgId":"299415687774972672","humanUserIds":["205336722215534596"]}]}}%
curl --request POST \
--url <custom-domain>/admin/v1/import \
--header "Authorization: Bearer $PAT_IMPORT_TOKEN" \
--header 'Content-Type: application/json' \
--data @export.json
{"errors":[{"type":"org","id":"299415687774972672","message":"ID=ORG-lapo2n Message=Errors.Org.AlreadyExisting"}],"success":{"orgs":[{"orgId":"299415687774972672","humanUserIds":["205336722215534596"]}]}}%
I adjusted your json body
{
"timeout": "10m",
"dataOrgs": {
"orgs": [
{
"orgId": "299415687774972672",
"org": {
"name": "get started"
},
"humanUsers": [
{
"userId": "205336722215534596",
"user": {
"userName": "blabladominik23@muellmail.com",
"profile": {
"firstName": "Dominik",
"lastName": "B",
"displayName": "Dominik B",
"preferredLanguage": "en"
},
"email": {
"email": "blabladominik23@muellmail.com",
"isEmailVerified": true
},
"hashedPassword": {
"value": "$2a$14$hwOvUDw6P0CUqfSqjFE.g.29GWm0x5h5iVPWeD9DKILfAO1gMfMVy"
}
}
}
]
}
]
}
}
{
"timeout": "10m",
"dataOrgs": {
"orgs": [
{
"orgId": "299415687774972672",
"org": {
"name": "get started"
},
"humanUsers": [
{
"userId": "205336722215534596",
"user": {
"userName": "blabladominik23@muellmail.com",
"profile": {
"firstName": "Dominik",
"lastName": "B",
"displayName": "Dominik B",
"preferredLanguage": "en"
},
"email": {
"email": "blabladominik23@muellmail.com",
"isEmailVerified": true
},
"hashedPassword": {
"value": "$2a$14$hwOvUDw6P0CUqfSqjFE.g.29GWm0x5h5iVPWeD9DKILfAO1gMfMVy"
}
}
}
]
}
]
}
}
let me know if this works šŸ™‚
Rajat
Rajat•7d ago
I was able to login too(I changed the password as idk the hashed value)
No description
boblack_zocker
boblack_zockerOP•7d ago
alrigth i will test out if i can import it tomorrow. thanks šŸ™‚ hey @Rajat i tested it out. looks like its working now 🄳

Did you find this page helpful?