{"record":{"id":"620d6302b45ddae3","repo":"ory/kratos","slug":"continuity-container-name-must-be-set","errorCode":null,"errorMessage":"continuity container name must be set","messagePattern":"continuity container name must be set","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"continuity/manager.go","lineNumber":106,"sourceCode":"\t\t}\n\t\to.payload = b.Bytes()\n\t\to.payloadRaw = payload\n\t\treturn nil\n\t}\n}\n\nfunc WithExpireInsteadOfDelete(duration time.Duration) ManagerOption {\n\treturn func(o *managerOptions) error {\n\t\to.setExpiresIn = duration\n\t\treturn nil\n\t}\n}\n\nfunc (m *Manager) Pause(ctx context.Context, w http.ResponseWriter, r *http.Request, name string, store ContainerReferenceStore, opts ...ManagerOption) (containerID uuid.UUID, err error) {\n\tctx, span := m.d.Tracer(ctx).Tracer().Start(ctx, \"continuity.ManagerDefault.Pause\")\n\tdefer otelx.End(span, &err)\n\tif len(name) == 0 {\n\t\treturn uuid.Nil, errors.Errorf(\"continuity container name must be set\")\n\t}\n\n\to, err := newManagerOptions(opts)\n\tif err != nil {\n\t\treturn uuid.Nil, err\n\t}\n\tc := NewContainer(name, *o)\n\n\tif err := m.d.ContinuityPersister().SaveContinuitySession(ctx, c); err != nil {\n\t\treturn uuid.Nil, errors.WithStack(err)\n\t}\n\n\tif err := store.Store(ctx, w, r, name, c.ID); err != nil {\n\t\treturn uuid.Nil, err\n\t}\n\n\treturn c.ID, nil\n}","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/ory/kratos/blob/b86338da04a040247a07f46100a86dcfb3875909/continuity/manager.go#L88-L124","documentation":"continuity.Manager.Pause requires a non-empty container name to look up/store the continuity container. If the name argument is an empty string, it immediately returns uuid.Nil with this error before creating manager options. It is an argument validation guard protecting against anonymous containers.","triggerScenarios":"Calling Pause(ctx, w, r, \"\", store) — i.e. passing an empty name — for example when the calling flow's flow ID or session identifier used as the container name was empty.","commonSituations":"A login/registration flow whose ID failed to generate or was not propagated to the continuity layer, or custom integration code calling Pause directly without a name.","solutions":["Ensure a non-empty container name is passed to Pause (typically a flow or session ID).","Check upstream code that produces the name — an empty flow ID usually indicates the request was missing its flow parameter.","Guard the call site: return a client error instead of invoking Pause when the name is empty."],"exampleFix":"// before\n_, err := manager.Pause(ctx, w, r, flowIDFromRequest, store)\n// after\nif flowIDFromRequest == \"\" {\n    return errors.New(\"flow id is required\")\n}\n_, err := manager.Pause(ctx, w, r, flowIDFromRequest, store)","handlingStrategy":"type-guard","validationCode":"if containerName == \"\" {\n    return errors.New(\"continuity: cannot pause with empty container name\")\n}","typeGuard":"func hasContainerName(name string) bool { return strings.TrimSpace(name) != \"\" }","tryCatchPattern":"containerID, err := manager.Pause(ctx, w, r, name, store)\nif err != nil {\n    if strings.Contains(err.Error(), \"container name must be set\") {\n        httpx.Error(w, r, errors.WithStack(ErrFlowMissing))\n        return\n    }\n    httpx.Error(w, r, err)\n}","preventionTips":["Always derive the container name from a validated flow ID","Reject requests missing the flow parameter before reaching continuity","Add unit tests covering empty-name pause calls"],"tags":["continuity","argument-validation","empty-value"],"backgroundTag":"empty-required-field","analyzedSha":"b86338da04a040247a07f46100a86dcfb3875909","analyzedAt":"2026-09-07T15:58:15.934Z","contentChangedAt":"2026-09-07T15:58:15.934Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}