crossplane: cannot get composite resource
What happened?
Please note I use realtime compositions feature of crossplane 1.14
Some of my compositions are creating other composite resources, triggering near instant reconciliation of multiple nested level of composite/composed resources.
In a fair amount of tries, composition creation get stuck because of the following error:
2023-12-19T16:33:55Z DEBUG crossplane cannot get composite resource {"controller": "defined/compositeresourcedefinition.apiextensions.crossplane.io", "controller": "composite/xuserswithattachment.iam.crossplane.airnity.net", "request": {"name":"crossplane-dev-user"}, "error": "XUserWithAttachment.iam.crossplane.airnity.net \"crossplane-dev-user\" not found"}
This error happens the exact moment composite is created by crossplane and should be reconciled.
There is maybe a race condition here and crossplane does not retry reconciliation so my composition is stuck until i delete the composite resource:
return reconcile.Result{}, errors.Wrap(resource.IgnoreNotFound(err), errGet)
How can we reproduce it?
I can make it happens regulary (once every 3/4 apply of my composition) with the setup i described: a composite resource creating other composite resources, realtime compositions feature enabled, and maybe functions are involved in the bug (server side apply?)
https://github.com/crossplane/crossplane/assets/7392946/797e884b-eb57-4e6d-b17c-1ae48396b984
Here you can see on argocd, i delete my composition, and creation get stuck after the creation of XPolicy because of this bug. Crossplane never retries and I have to trigger a reconciliation manually, by deleting the XPolicy for example.
What environment did it happen in?
Crossplane version: 1.14.4
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 34 (30 by maintainers)
Juuuust kidding I didn’t have the realtime feature flag enabled when I was trying to reproduce. 🙃 I can reproduce it now pretty reliably.
/fresh
/fresh
Looks like the current HEAD of
masteris available atxpkg.upbound.io/crossplane/crossplane:v1.17.0-rc.0.175.g93610dc7.Instructions for installing latest from
masterchannel can be found at https://docs.crossplane.io/latest/software/install/#install-pre-release-crossplane-versions. Note there may be an issue to clean up in that flow though after we recently transitioned our build system to Earthly in #5711 - we’ll look into that ASAP 🙇♂️/fresh
Wondering, could you attach full debug logs around the time this happens?
CC @sttts
First try deleting an XR with realtime compositions enabled resulted in parent resource never got composed after all tree was successfully deleted. Here are the logs | grep resource-name, you can see a lot of enqueuing and deletions happening the same second, and the
cannot get composite resourceat the end of logs.logs
@negz With realtime compositions disabled, i can’t reproduce (made 10 tries, everything always went smooth)