Skip to content

SchemaUpdateAvailable advice is rejected: explicit schemaVersion needs documentDBVersion #502

Open

Description

@hossain-rayhan

Summary

After a binary-only engine upgrade, the operator emits:

SchemaUpdateAvailable: Schema update available: binary version is 1.0.0, schema is at 0.117.0. Set spec.schemaVersion to "1.0.0" or "auto" to finalize the upgrade.

Following that advice with the explicit version is rejected by the webhook when the binary version comes from the defaults (no spec.documentDBVersion or spec.image.documentDB):

$ kubectl patch documentdb upg3 --type merge -p '{"spec":{"schemaVersion":"1.0.0"}}'
The DocumentDB "upg3" is invalid: spec.schemaVersion: Invalid value: "1.0.0": cannot set an explicit
schemaVersion without also setting spec.documentDBVersion or spec.documentDBImage; the webhook needs a
binary version to validate against

Reproduction (Azure Local, combined mode, operator 1.1.0)

  1. Create a cluster with spec.image.documentDB/gateway pinned to a 0.117.0 test build.
  2. Upgrade the binary by removing the image overrides (spec.image: null); the cluster now runs the default 1.0.0 and emits the event above.
  3. Set spec.schemaVersion: "1.0.0" as the event says. It's rejected.

Workaround: set both, {"spec":{"documentDBVersion":"1.0.0","schemaVersion":"1.0.0"}}.

Cause

SchemaVersionNotExceedsBinary (operator/src/internal/validation/validation.go:61-75) rejects an explicit schema version when no binary version is set in the spec, instead of validating against the operator's effective default (DOCUMENTDB_VERSION / compiled default). The event text is in operator/src/internal/engine/extension.go:247-257.

This hits the most common setup: users who never pin the engine version and pick up a new default after an operator upgrade.

Suggested fix

Either:

  • validate against the effective binary version the operator will run (preferred), or
  • change the event text to give a command that works (for example, also set spec.documentDBVersion).

Also mention the requirement in the upgrade docs.

Activity

  1. added
    bug
    on Nov 6, 2026
  2. documentdb-triage-tool commented on Nov 6, 2026

    @documentdb-triage-tool

    🤖 Auto-triaged by documentdb-triage-tool.

    Applied: go
    Project fields suggested: Component controllers · Priority P1 · Effort M · Status Triage
    Confidence: 0.88 (llm)

    Reasoning

    LLM: Webhook rejects the exact upgrade command emitted by the operator's own advice, actively blocking schema finalization for users who rely on the default engine version (the most common setup).

    If a label is wrong, remove it manually and ping @patty-chow so the rules can be tuned. The bot will not re-label items that already have component labels.

  3. added
    go
    on Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggo

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions