Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: "expected a non-empty string in .status.artifact.url" #345

Closed
lukehoban opened this issue Oct 19, 2022 · 3 comments
Closed

Error: "expected a non-empty string in .status.artifact.url" #345

lukehoban opened this issue Oct 19, 2022 · 3 comments
Assignees
Labels
kind/enhancement Improvements or new features resolution/fixed This issue was fixed

Comments

@lukehoban
Copy link
Contributor

Following #344, I recreated the GitRepository and Stack. This time I got many instances of this in logs:

{"level":"error","ts":"2022-10-19T04:41:14.857Z","logger":"controller_stack","msg":"Failed to update Stack","Request.Namespace":"default","Request.Name":"basic-c7099c01","Stack.Name":"lukehoban/basic/docker-desktop","error":"expected a non-empty string in .status.artifact.url","stacktrace":"github.com/pulumi/pulumi-kubernetes-operator/pkg/controller/stack.(*ReconcileStack).Reconcile\n\t/home/runner/work/pulumi-kubernetes-operator/pulumi-kubernetes-operator/pkg/controller/stack/stack_controller.go:345\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:298\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:253\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\t/home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:214"}

I can see the artifact url is present (at least after I checked):

status:
  artifact:
    checksum: f8fe96008820b8f01e04d3a6fcf9611366dc4413c9c23953fc536d9b8eef9e0a
    lastUpdateTime: "2022-10-19T04:41:14Z"
    path: gitrepository/default/pko-dev-625ef86f/421a9b36cf29f2a3e433018d1959edb63e7af8eb.tar.gz
    revision: main/421a9b36cf29f2a3e433018d1959edb63e7af8eb
    size: 778
    url: http://source-controller.flux-system.svc.cluster.local./gitrepository/default/pko-dev-625ef86f/421a9b36cf29f2a3e433018d1959edb63e7af8eb.tar.gz
  conditions:
  - lastTransitionTime: "2022-10-19T04:41:14Z"
    message: stored artifact for revision 'main/421a9b36cf29f2a3e433018d1959edb63e7af8eb'
    observedGeneration: 1
    reason: Succeeded
    status: "True"
    type: Ready
  - lastTransitionTime: "2022-10-19T04:41:14Z"
    message: stored artifact for revision 'main/421a9b36cf29f2a3e433018d1959edb63e7af8eb'
    observedGeneration: 1
    reason: Succeeded
    status: "True"
    type: ArtifactInStorage
  contentConfigChecksum: sha256:fcbcf165908dd18a9e49f7ff27810176db8e9f63b4352213741664245224f8aa
  observedGeneration: 1
  url: http://source-controller.flux-system.svc.cluster.local./gitrepository/default/pko-dev-625ef86f/latest.tar.gz
@squaremo
Copy link
Contributor

squaremo commented Oct 19, 2022

OK I see. It'll probably bounce off a new source a few times (quickly, but with a backoff), while the source-controller is fetching the artifact. The stack controller checks to see whether the resource is explicitly marked as not ready; but, it can't assume anything while the source has no indication of being ready or not, which will be the case until the source controller has processed it at least once.

It can do a slightly better job at assessing readiness by looking for a "reconciling" condition in the source; but that won't help when the controller hasn't even seen the resource yet.

This would be improved by fixing the Flux source part of #343, because the stack controller would rely on the watch to tell it when the source has changed, rather than retry-with-backoff. In the meantime, we can reduce logs coming from unready sources by requeuing at a fixed period (with the disadvantages that not having a backoff entails).

@squaremo squaremo self-assigned this Oct 21, 2022
@squaremo squaremo added the resolution/fixed This issue was fixed label Jan 3, 2023
@squaremo
Copy link
Contributor

squaremo commented Jan 3, 2023

Resolved with #348 (watch Flux sources, rather than polling them) and #359 (explicitly check sources for an artifact and wait for a change if there isn't one).

@squaremo squaremo closed this as completed Jan 3, 2023
@pulumi-bot pulumi-bot reopened this Jan 3, 2023
@pulumi-bot
Copy link
Contributor

Cannot close issue without required labels: kind/

@squaremo squaremo added the kind/enhancement Improvements or new features label Jan 3, 2023
@squaremo squaremo closed this as completed Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Improvements or new features resolution/fixed This issue was fixed
Projects
None yet
Development

No branches or pull requests

3 participants