Crossplane "cannot compose resources" in CI
"cannot compose resources" is the top-level error the composite controller reports when it fails to expand an XR into its managed resources. The specific failure - a broken function, a bad patch, or an invalid template - follows in the same message.
What this error means
An XR shows SYNCED False with a ReconcileError and an event containing "cannot compose resources:" followed by the underlying cause.
cannot compose resources: cannot render composed resource from resource template
at index 0: cannot unmarshal JSON from patch at index 1 into *v1.BucketCommon causes
A patch or template produces an invalid resource
A patch writes an incompatible value or the base template is malformed, so the composed resource cannot be rendered.
The function pipeline returns an error
A composition function in the pipeline fails, and the controller surfaces it as a failure to compose resources.
How to fix it
Reproduce with render and fix the template
- Run
crossplane beta renderon the XR and composition to see the failing resource locally. - Correct the base template or the patch that produces the bad value.
- Re-apply and confirm the XR reaches SYNCED True.
crossplane beta render xr.yaml composition.yaml functions.yamlInspect the composite events for the real cause
Read the events on the XR to find the underlying function or patch error behind "cannot compose resources".
kubectl describe xstorage my-xr | sed -n '/Events/,$p'How to prevent it
- Render compositions in PR so template and patch errors surface before apply.
- Validate patch value types against the target CRD schema.
- Keep composition functions pinned and healthy before reconciling XRs.