Skip to content

Commit 614105e

Browse files
Luis Regino Hernándezfacebook-github-bot
authored andcommitted
Further clarify cert error message on Windows
Summary: As title, we've gotten quite a few reports on Windows Users group (see [post](https://fb.workplace.com/groups/winbook/permalink/3907943359478714/)) from this message. Based on the comments users are running the `getchef` command on a non-admin terminal which doesn't fix their issue. Here I'm modifying the error to explicitly mention they should run this on an admin PowerShell. I know this seems pretty hacky, but wanted to start a discussion on whether this is good and get suggestions if this is plain bad :D Reviewed By: JakobDegen Differential Revision: D75090979 fbshipit-source-id: b20605b7a891fb63ac33253731ab42b088796f82
1 parent 7c86286 commit 614105e

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

app/buck2_certs/src/certs.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,19 @@ async fn load_system_root_certs() -> buck2_error::Result<RootCertStore> {
2525
let native_certs =
2626
rustls_native_certs::load_native_certs().tag(buck2_error::ErrorTag::Environment);
2727
let native_certs = if cfg!(fbcode_build) {
28-
native_certs.buck_error_context(
28+
let windows_message = if cfg!(target_os = "windows") {
29+
" on an admin PowerShell"
30+
} else {
31+
""
32+
};
33+
let context = format!(
2934
"Error loading system root certificates native frameworks.
3035
This is usually due to Chef not installed or working properly.
31-
Please try `getchef -reason 'chef broken'`, `Fix My <OS>` via the f-menu, then `buck2 killall`.
36+
Please try `getchef -reason 'chef broken'`{}, `Fix My <OS>` via the f-menu, then `buck2 killall`.
3237
If that doesn't resolve it, please visit HelpDesk to get Chef back to a healthy state.",
33-
)
38+
windows_message
39+
);
40+
native_certs.buck_error_context(context)
3441
} else {
3542
native_certs.buck_error_context("Error loading system root certificates native frameworks.")
3643
};

0 commit comments

Comments
 (0)