{"record":{"id":"dd01f108a1d1eafe","repo":"dagger/dagger","slug":"send-uncommitted-patch-chunk-w","errorCode":null,"errorMessage":"send uncommitted patch chunk: %w","messagePattern":"send uncommitted patch chunk: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/session/git/git_uncommitted.go","lineNumber":214,"sourceCode":"\t\t\t},\n\t\t},\n\t}); err != nil {\n\t\treturn fmt.Errorf(\"send uncommitted metadata: %w\", err)\n\t}\n\n\tpatch, err = os.Open(patchPath)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"open uncommitted patch: %w\", err)\n\t}\n\tdefer patch.Close()\n\tbuf := make([]byte, packCheckoutChunkSize)\n\tfor {\n\t\tn, readErr := patch.Read(buf)\n\t\tif n > 0 {\n\t\t\tif err := srv.Send(&PackUncommittedResponse{\n\t\t\t\tMsg: &PackUncommittedResponse_Chunk{Chunk: buf[:n]},\n\t\t\t}); err != nil {\n\t\t\t\treturn fmt.Errorf(\"send uncommitted patch chunk: %w\", err)\n\t\t\t}\n\t\t}\n\t\tif readErr != nil {\n\t\t\tif !errors.Is(readErr, io.EOF) {\n\t\t\t\treturn fmt.Errorf(\"read uncommitted patch: %w\", readErr)\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\treturn nil\n}\n\ntype limitedGitPackWriter struct {\n\tw         io.Writer\n\tremaining int64\n}\n\nfunc (w *limitedGitPackWriter) Write(p []byte) (int, error) {","sourceCodeStart":196,"sourceCodeEnd":232,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/engine/session/git/git_uncommitted.go#L196-L232","documentation":"Thrown by PackUncommitted when srv.Send of a PackUncommittedResponse_Chunk fails while streaming the binary patch from disk to the client. The metadata was already delivered, so this mid-stream failure indicates the transport broke partway through transferring the patch.","triggerScenarios":"gRPC send fails during chunk streaming: client cancelled the context, connection reset, message-size/stream limits hit, or the send exceeded the remaining gitPackTimeout deadline.","commonSituations":"Very large uncommitted patches over slow links, laptop clients going to sleep mid-transfer, proxies/load-balancers killing idle-looking streams, client crash during sync.","solutions":["Retry the sync on a stable connection","Commit or stash large working-tree changes to shrink the patch","Check for intermediary proxies with short idle/stream timeouts","Verify client-side gRPC max message sizes if chunks are large (packCheckoutChunkSize)"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// ensure the stream can carry the patch: check link and idle timeout config\n// client side: increase receive window / max message size if configured\n// e.g. grpc.MaxRecvMsgSize(maxGitPackBytes + overhead)","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"send uncommitted patch chunk\") {\n    // transient transport failure: reconnect and retry the whole pack\n    return retryWithBackoff(3, func() error { return packUncommitted(...) })\n}","preventionTips":["Sync on stable networks; avoid suspending the client mid-transfer","Keep uncommitted deltas small (commit/stash often) so streams finish quickly","Configure proxies and LBs with timeouts longer than gitPackTimeout"],"tags":["grpc","network","stream","go"],"backgroundTag":"grpc-stream-send-failed","analyzedSha":"82ba2681dbe30d3547a1dc50ea495900ab5b6047","analyzedAt":"2026-09-05T07:21:37.930Z","contentChangedAt":"2026-09-05T07:21:37.930Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}