Skip to content
Latchkey

CUE "conflicting values" error in CI

CUE unifies every constraint on a field into one value. When two constraints cannot both hold (a string where an int is required, or two different concrete values), unification fails with "conflicting values" and shows both sides.

What this error means

cue vet or cue export fails with "conflicting values X and Y" (or "conflicting values \"a\" and int") plus the file:line of each constraint.

CUE
port: conflicting values "8080" and int (mismatched types string and int):
    ./schema.cue:3:9
    ./values.cue:2:7

Common causes

A value that violates its declared type

A field constrained to int is given a string like "8080", so the two constraints conflict.

Two files pin the same field to different concrete values

Unifying a base and an override that each set the field to a different literal has no consistent result.

How to fix it

Make the value satisfy every constraint

  1. Read both file:line locations CUE prints for the conflict.
  2. Fix the value to match the declared type, or reconcile the two literals.
  3. Re-run cue vet to confirm unification succeeds.
values.cue
# wrong: port declared int but set to a string
port: int
port: "8080"
# right
port: int
port: 8080

Loosen an over-constrained field

If both values are legitimately possible, use a disjunction or a default instead of two hard pins.

schema.cue
port: int | *8080

How to prevent it

  • Run cue vet in CI so conflicts surface before export.
  • Keep types and defaults in one schema file, overrides separate.
  • Use disjunctions/defaults instead of pinning a field twice.

Frequently asked questions

What causes ""conflicting values""?
A field constrained to int is given a string like "8080", so the two constraints conflict.
How do I fix "conflicting values"?
Make the value satisfy every constraint

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card