ory/kratos · error

continuity container name must be set

Error message

continuity container name must be set

What it means

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.

Solutions

  1. Ensure a non-empty container name is passed to Pause (typically a flow or session ID).
  2. Check upstream code that produces the name — an empty flow ID usually indicates the request was missing its flow parameter.
  3. Guard the call site: return a client error instead of invoking Pause when the name is empty.

Example fix

// before
_, err := manager.Pause(ctx, w, r, flowIDFromRequest, store)
// after
if flowIDFromRequest == "" {
    return errors.New("flow id is required")
}
_, err := manager.Pause(ctx, w, r, flowIDFromRequest, store)
Defensive patterns

Strategy: type-guard

Validate before calling

if containerName == "" {
    return errors.New("continuity: cannot pause with empty container name")
}

Type guard

func hasContainerName(name string) bool { return strings.TrimSpace(name) != "" }

Try / catch

containerID, err := manager.Pause(ctx, w, r, name, store)
if err != nil {
    if strings.Contains(err.Error(), "container name must be set") {
        httpx.Error(w, r, errors.WithStack(ErrFlowMissing))
        return
    }
    httpx.Error(w, r, err)
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.


AI-assisted analysis of ory/kratos@b86338da04 (2026-09-07). Data as JSON: /api/errors/620d6302b45ddae3. Report an issue: GitHub.

Appendix: source

Thrown at continuity/manager.go:106

		}
		o.payload = b.Bytes()
		o.payloadRaw = payload
		return nil
	}
}

func WithExpireInsteadOfDelete(duration time.Duration) ManagerOption {
	return func(o *managerOptions) error {
		o.setExpiresIn = duration
		return nil
	}
}

func (m *Manager) Pause(ctx context.Context, w http.ResponseWriter, r *http.Request, name string, store ContainerReferenceStore, opts ...ManagerOption) (containerID uuid.UUID, err error) {
	ctx, span := m.d.Tracer(ctx).Tracer().Start(ctx, "continuity.ManagerDefault.Pause")
	defer otelx.End(span, &err)
	if len(name) == 0 {
		return uuid.Nil, errors.Errorf("continuity container name must be set")
	}

	o, err := newManagerOptions(opts)
	if err != nil {
		return uuid.Nil, err
	}
	c := NewContainer(name, *o)

	if err := m.d.ContinuityPersister().SaveContinuitySession(ctx, c); err != nil {
		return uuid.Nil, errors.WithStack(err)
	}

	if err := store.Store(ctx, w, r, name, c.ID); err != nil {
		return uuid.Nil, err
	}

	return c.ID, nil
}

View on GitHub (pinned to b86338da04)