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

Improved error message for Executor::exec #655

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

Mossaka
Copy link
Member

@Mossaka Mossaka commented Jul 23, 2024

this commit imrpoves the error message for exec function, particularlly when the user forgot to provide Wasm file path as the arg0 for the container, it will log an error message in containerd

Related #637

this commit imrpoves the error message for exec function, particularlly when the user forgot to provide Wasm file path as the arg0 for the container, it will log an error message in containerd

Signed-off-by: jiaxiao zhou <[email protected]>
@Mossaka Mossaka requested a review from jsturtevant July 23, 2024 18:30
Err(err) => {
// log an error and return
log::error!("error checking if wasm container: {err}. Note: arg0 must be a path to a Wasm file");
InnerExecutor::CantHandle
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be nice if we could pass some context to this error message so it got bubbled up to the CTR/cri error message with out having to look into the logs.

It looks like we pass the name as context, maybe we could extend it take in a message too?

https://github.com/containerd/runwasi/blob/main/crates/containerd-shim-wasm/src/sys/unix/container/executor.rs#L40

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah good point! I was thinking about that. I will make a PR against youki anad see if they like this idea.

Copy link
Contributor

@jsturtevant jsturtevant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

This is an improvement and we can follow up with a change to the libcontainer api if we want to

@Mossaka Mossaka merged commit f27de28 into containerd:main Jul 23, 2024
52 checks passed
@Mossaka Mossaka deleted the better-error-validate branch July 23, 2024 20:48
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

Successfully merging this pull request may close these issues.

2 participants