-
Notifications
You must be signed in to change notification settings - Fork 96
fix: Add actionable logs and improve UX after buildkit endpoint checks are exhausted #1186
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: amanycodes <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1186 +/- ##
==========================================
- Coverage 42.67% 42.59% -0.09%
==========================================
Files 24 24
Lines 3934 3942 +8
==========================================
Hits 1679 1679
- Misses 2127 2135 +8
Partials 128 128 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
return c, nil | ||
} | ||
c.Close() | ||
} | ||
log.WithError(err).Debug("Could not use buildkitd driver") | ||
return nil, errors.Join(retErr, fmt.Errorf("could not use buildkitd driver: %w", err)) | ||
if err == nil { | ||
err = validateErr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did we change err to validateErr and set it here again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this improved the logic of printing nil error:
could not use buildkitd driver: %!w(<nil>)
when the last dummy client connection succeeds but validation check fails for builkitd driver check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw this in the user logs they shared in the issue
return nil, fmt.Errorf( | ||
"%w\n\nAll BuildKit connection checks exhausted. Copa requires a working BuildKit instance to function.\n"+ | ||
"Please refer to the documentation for setup instructions: https://project-copacetic.github.io/copacetic/website/custom-address", | ||
errors.Join(retErr, fmt.Errorf("could not use buildkitd driver: %w", err)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe in the docs also we can explicitly clarify that for Docker Desktop default connection containerd image store needs to be enabled as it says in the issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes i was thinking exactly about this! In the custom address docs we can explicitly clarify this using an admonition and mentioning that for Docker Desktop default connection containerd image store needs to be enabled.
After all the buildkit endpoint checks fail the user is prompted with an error message telling them copa can't function and our custom-address docs are provided for next steps
Also improved the logic of printing nil error:
could not use buildkitd driver: %!w(<nil>)
when the last dummy client connection succeeds but validation check fails for builkitd driver check
Closes #977