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

Selective deployment errors not visible in Pod logs #228

Open
kate-goldenring opened this issue Nov 7, 2024 · 2 comments
Open

Selective deployment errors not visible in Pod logs #228

kate-goldenring opened this issue Nov 7, 2024 · 2 comments

Comments

@kate-goldenring
Copy link
Collaborator

kate-goldenring commented Nov 7, 2024

Say you apply this spin app that has two components hello and goodbye but select that nonexistent component foo is run:

apiVersion: core.spinkube.dev/v1alpha1
kind: SpinApp
metadata:
  name: hello-salutation-spinapp
spec:
  # TODO: change to image hosted at ghcr.io/spinkube/spin-operator/salutations when published
  image: "ghcr.io/kate-goldenring/spin-operator/examples/spin-salutations:20241022-144454"
  replicas: 1
  executor: containerd-shim-spin
  # Configure the application to only contain the "hello" component
  components: ["foo"]

The pod with Error with no logs. You have to look at the containerd logs to find that an improper component was selected:

time="2024-11-07T06:09:43.569108376Z" level=error msg="run_wasi ERROR >>>  failed: Specified component "foo" not found in application"

time="2024-11-07T06:09:43.569570479Z" level=info msg="error running start function: Specified component "foo" not found in application"

Could we somehow surface this in the Pod logs?

@kate-goldenring kate-goldenring changed the title Selective deployment errors not visible in logs Selective deployment errors not visible in Pod logs Nov 7, 2024
@jsturtevant
Copy link
Contributor

I think the shim related stuff really shouldn't be in the pod logs but it would be possible to get them surface by moving the stio.redirect() before any logs that you want redirected.

This sort of relates to containerd/runwasi#619

Something like this should really be surfaced up to Kubernetes as an event IMO, sort of like when not pulling fails. I don't know if it is possible to pass this info up through cri though.

@kate-goldenring
Copy link
Collaborator Author

I 100% agree this should be surfaced as a K8s event. We also don't surface things like precompilation failing as K8s events. That would maybe be a good first one to target because runwasi could define a strategy for surfacing it. In the mean time, it may make sense to surface this error. I put up a PR for that: #229

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants