Skip to content
Latchkey

Crossplane "crossplane beta validate" error in CI

crossplane beta validate renders your resources and checks each one against the CRD schemas of the providers and XRDs you point it at. A non-zero exit means at least one resource violates a schema, so the PR check fails before anything is applied.

What this error means

A PR step running crossplane beta validate exits non-zero and prints one or more "schema validation error" lines naming the resource and the offending field.

crossplane
[x] schema validation error: apiextensions.crossplane.io/v1, Kind=Composition,
example-composition : spec.resources[0].base.spec.forProvider.region:
Invalid value: "null": spec.resources[0].base.spec.forProvider.region in body must be of type string

Common causes

A rendered resource violates the provider CRD schema

A required field is missing, has the wrong type, or uses a value the provider CRD rejects, so validation fails against the extracted schemas.

Validating against stale or incomplete schemas

The schema source (a directory of CRDs or extracted provider packages) does not include every CRD the resources reference, so validation cannot confirm them.

How to fix it

Validate against the real provider CRDs

  1. Point validate at a directory containing the provider and XRD CRDs plus your composition.
  2. Read the field path in the error and correct the base resource.
  3. Re-run validate until it exits zero.
Terminal
crossplane beta validate ./crds ./composition.yaml

Fix the field the error names

Set the required field with a real value (or a patch) so the rendered resource satisfies the CRD schema.

composition.yaml
- name: bucket
  base:
    apiVersion: s3.aws.upbound.io/v1beta1
    kind: Bucket
    spec:
      forProvider:
        region: us-east-1

How to prevent it

  • Run crossplane beta validate on every PR that touches compositions.
  • Keep the CRD set you validate against in sync with the providers you deploy.
  • Treat validation failures as blocking so bad schemas never reach the cluster.

Frequently asked questions

What causes ""crossplane beta validate" fails"?
A required field is missing, has the wrong type, or uses a value the provider CRD rejects, so validation fails against the extracted schemas.
How do I fix "crossplane beta validate" fails?
Validate against the real provider CRDs

Related guides

References

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