Skip to content

Commit 6e20528

Browse files
committed
fix: add helpful documentation link for keepalive ping errors
When users encounter the "keepalive ping failed to receive ACK within timeout" error, the CLI now appends a link to the troubleshooting documentation to help them resolve the issue.
1 parent 1dffd0d commit 6e20528

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pkg/buildx/commands/build.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,6 +1096,10 @@ func wrapBuildError(err error, bake bool) error {
10961096
msg += " Named contexts are supported since Dockerfile v1.4. Use #syntax directive in Dockerfile or update to latest BuildKit."
10971097
return &wrapped{err, msg}
10981098
}
1099+
if st.Code() == codes.Unavailable && strings.Contains(st.Message(), "keepalive ping failed") {
1100+
msg := st.Message() + "\n\nFor more information, please consult https://depot.dev/docs/container-builds/troubleshooting#error-keep-alive-ping-failed-to-receive-ack-within-timeout"
1101+
return &wrapped{err, msg}
1102+
}
10991103
}
11001104
return err
11011105
}
@@ -1173,6 +1177,9 @@ func rewriteFriendlyErrors(err error) error {
11731177
if strings.Contains(err.Error(), "code = Canceled desc = grpc: the client connection is closing") {
11741178
return errors.New("build canceled")
11751179
}
1180+
if strings.Contains(err.Error(), "keepalive ping failed") {
1181+
return errors.New(err.Error() + "\n\nFor more information, please consult https://depot.dev/docs/container-builds/troubleshooting#error-keep-alive-ping-failed-to-receive-ack-within-timeout")
1182+
}
11761183
return err
11771184
}
11781185

0 commit comments

Comments
 (0)