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

CmdError error messages should provide more information #4428

Merged
merged 8 commits into from
Nov 8, 2023

Conversation

papertigers
Copy link
Contributor

Fixes: #4419

This commit is a little invasive at various call sites so I would appreciate some feedback.

Before this commit you would see:

sled-agent: Failed to delete all XDE devices

After this commit we now see:

sled-agent: Failed to delete all XDE devices

Caused by:
    0: Failure interacting with the OPTE ioctl(2) interface: command ListPorts failed: BadApiVersion { user: 25, kernel: 23 }
    1: command ListPorts failed: BadApiVersion { user: 25, kernel: 23 }

@papertigers
Copy link
Contributor Author

CI failed because I neglected the non illumos cfg sections. Is there a good way to make sure one doesn't miss these in the future before CI runs?

Copy link
Contributor

@jgallagher jgallagher left a comment

Choose a reason for hiding this comment

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

Thanks! These feel like kinda tedious changes, but better error messages are a huge 👍 for everybody.

gateway/src/bin/mgs.rs Outdated Show resolved Hide resolved
gateway/src/bin/mgs.rs Outdated Show resolved Hide resolved
oximeter/collector/src/bin/oximeter.rs Outdated Show resolved Hide resolved
gateway/src/bin/mgs.rs Outdated Show resolved Hide resolved
sled-agent/src/bin/sled-agent.rs Outdated Show resolved Hide resolved
sled-agent/src/bin/sled-agent.rs Outdated Show resolved Hide resolved
sled-agent/src/bin/sled-agent.rs Outdated Show resolved Hide resolved
wicketd/src/bin/wicketd.rs Outdated Show resolved Hide resolved
wicketd/src/bin/wicketd.rs Outdated Show resolved Hide resolved
wicketd/src/bin/wicketd.rs Outdated Show resolved Hide resolved
@jgallagher
Copy link
Contributor

CI failed because I neglected the non illumos cfg sections. Is there a good way to make sure one doesn't miss these in the future before CI runs?

In theory one can do something like cargo check --target x86_64-unknown-linux-gnu, but I suspect that won't work for annoying reasons (OpenSSL for one). If I'm working in cfg-controlled areas like this I end up just building on both platforms locally, which isn't super satisfying. Would be happy to hear from others if there's a better option.

@citrus-it
Copy link
Contributor

Thanks! These feel like kinda tedious changes, but better error messages are a huge 👍 for everybody.

Speaking as someone who hit exactly this today and only managed to resolve it quickly because I was chatting to @papertigers - most definitely!

@papertigers
Copy link
Contributor Author

Thanks! These feel like kinda tedious changes, but better error messages are a huge 👍 for everybody.

Speaking as someone who hit exactly this today and only managed to resolve it quickly because I was chatting to @papertigers - most definitely!

And because we were speaking I realized that ./tools/install_prerequisites.sh gets you a working env on macOS making the cfg illumos bits easier to spot locally. Thanks!

@papertigers
Copy link
Contributor Author

Sorry for all the commit noise on this. I used a macro to fix up all of the e.into() -> anyhow!(e) so that we are consistent everywhere. I also applied all of your other suggested fixes @jgallagher. Hopefully this is in better shape now -- I will try to do one more manual run on a bench gimlet before merging this.

Copy link
Contributor

@jgallagher jgallagher left a comment

Choose a reason for hiding this comment

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

Looks great - thanks!

@papertigers
Copy link
Contributor Author

With the latest patchset things still look good:

sled-agent: Failed to delete all XDE devices

Caused by:
    0: Failure interacting with the OPTE ioctl(2) interface: command ListPorts failed: BadApiVersion { user: 25, kernel: 23 }
    1: command ListPorts failed: BadApiVersion { user: 25, kernel: 23 }

Copy link
Contributor

@jordanhendricks jordanhendricks left a comment

Choose a reason for hiding this comment

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

Thanks for jumping on this so quickly! Will be so nice to have when someone hits this again.

@papertigers papertigers merged commit 03c7f12 into main Nov 8, 2023
20 checks passed
@papertigers papertigers deleted the mike/cmderr branch November 8, 2023 14:45
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.

CmdError error messages should provide more information
4 participants