{"record":{"id":"79b7b6222d136505","repo":"zitadel/zitadel","slug":"s-get-instance-ids-w","errorCode":null,"errorMessage":"%s get instance IDs: %w","messagePattern":"(.+?) get instance IDs: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/setup/59.go","lineNumber":34,"sourceCode":"\teventstore *eventstore.Eventstore\n\tcommands   *command.Commands\n}\n\nfunc (mig *SetupWebkeys) Execute(ctx context.Context, _ eventstore.Event) error {\n\tinstances, err := mig.eventstore.InstanceIDs(\n\t\tctx,\n\t\teventstore.NewSearchQueryBuilder(eventstore.ColumnsInstanceIDs).\n\t\t\tOrderDesc().\n\t\t\tAddQuery().\n\t\t\tAggregateTypes(instance.AggregateType).\n\t\t\tEventTypes(instance.InstanceAddedEventType).\n\t\t\tBuilder().ExcludeAggregateIDs().\n\t\t\tAggregateTypes(instance.AggregateType).\n\t\t\tEventTypes(instance.InstanceRemovedEventType).\n\t\t\tBuilder(),\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"%s get instance IDs: %w\", mig, err)\n\t}\n\tconf := &crypto.WebKeyRSAConfig{\n\t\tBits:   crypto.RSABits2048,\n\t\tHasher: crypto.RSAHasherSHA256,\n\t}\n\n\tfor _, instance := range instances {\n\t\tctx := authz.WithInstanceID(ctx, instance)\n\t\tlogging.Info(ctx, \"prepare initial webkeys for instance\", \"instance\", instance, \"migration\", mig)\n\t\tif err := mig.commands.GenerateInitialWebKeys(ctx, conf); err != nil {\n\t\t\treturn fmt.Errorf(\"%s generate initial webkeys: %w\", mig, err)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (mig *SetupWebkeys) String() string {\n\treturn \"59_setup_webkeys\"","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/zitadel/zitadel/blob/13948f2bcd6f257794dbd6d342c2ac30bc88fe54/cmd/setup/59.go#L16-L52","documentation":"The SetupWebkeys migration (setup step 59) failed querying instance IDs from the eventstore: the search for instance-added events (excluding instance-removed) could not be executed. This is a database/eventstore read failure that aborts the whole setup step before any webkeys are generated.","triggerScenarios":"Thrown at cmd/setup/59.go:34 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check database connectivity and eventstore health","Inspect the wrapped error for the underlying SQL/query failure","Rerun `zitadel setup` — the step is idempotent and will retry the query"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"13948f2bcd6f257794dbd6d342c2ac30bc88fe54","analyzedAt":"2026-09-06T10:16:19.814Z","contentChangedAt":"2026-09-06T10:16:19.814Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}