{"record":{"id":"24599b29238a6e50","repo":"hashicorp/terraform","slug":"failed-to-upload-part-s","errorCode":null,"errorMessage":"failed to upload part: %s","messagePattern":"failed to upload part: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/backend/remote-state/oci/multipart_upload.go","lineNumber":126,"sourceCode":"\t\t\tctx.uploadPartsWorker()\n\t\t}()\n\t}\n\n\twg.Wait()\n\tclose(osUploadPartResponses)\n\tclose(errChan)\n\n\t// Collect errors from workers\n\tfor workerErr := range errChan {\n\t\tif workerErr != nil {\n\t\t\treturn workerErr\n\t\t}\n\t}\n\tcommitMultipartUploadPartDetails := make([]objectstorage.CommitMultipartUploadPartDetails, len(sourceBlocks))\n\ti := 0\n\tfor response := range osUploadPartResponses {\n\t\tif response.error != nil || response.partNumber == nil || response.response.ETag == nil {\n\t\t\treturn fmt.Errorf(\"failed to upload part: %s\", response.error)\n\t\t}\n\t\tpartNumber, etag := *response.partNumber, *response.response.ETag\n\t\tcommitMultipartUploadPartDetails[i] = objectstorage.CommitMultipartUploadPartDetails{\n\t\t\tPartNum: common.Int(partNumber),\n\t\t\tEtag:    common.String(etag),\n\t\t}\n\t\ti++\n\t}\n\n\tif len(commitMultipartUploadPartDetails) != len(sourceBlocks) {\n\t\tabortReq := objectstorage.AbortMultipartUploadRequest{\n\t\t\tUploadId:      multipartUploadResponse.MultipartUpload.UploadId,\n\t\t\tNamespaceName: multipartUploadResponse.Namespace,\n\t\t\tBucketName:    multipartUploadResponse.Bucket,\n\t\t\tObjectName:    multipartUploadResponse.Object,\n\t\t}\n\t\t_, abortErr := multipartUploadData.client.objectStorageClient.AbortMultipartUpload(context.Background(), abortReq)\n\t\tif abortErr != nil {","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/hashicorp/terraform/blob/c9def3e214014c1188faabfc4a5bde5095139765/internal/backend/remote-state/oci/multipart_upload.go#L108-L144","documentation":"Raised while collecting worker responses in multiPartUploadImpl when an uploaded-part response is structurally invalid: response.error is set, or partNumber is nil, or response.response.ETag is nil. The commit phase needs both a part number and an ETag per part, so a response missing either cannot be committed. (Per-worker hard upload failures are instead reported via errChan as 'failed to upload part %d'.)","triggerScenarios":"Iterating osUploadPartResponses (multipart_upload.go:124) yields a response where response.error != nil, response.partNumber == nil, or response.response.ETag == nil — e.g. the OCI service accepted the UploadPart call but returned no ETag, or an SDK-level anomaly produced an incomplete response object.","commonSituations":"An OCI/SDK anomaly returning a 2xx UploadPart response with no ETag header; an unexpected response shape after an SDK upgrade; rare service hiccup that the retry policy did not smooth over.","solutions":["Re-run the apply; an anomalous missing-ETag response is usually transient.","Check the OCI-SDK version (oci-go-sdk/v65) is current and compatible with the object storage service response shape.","Capture the OpcRequestId of the offending UploadPart call from TF_LOG=TRACE to report to OCI support.","If it recurs, fall back is automatic via client.Put (single-part) when size permits; otherwise reduce state size to avoid multipart."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// No caller-side validation can prevent an anomalous missing-ETag response;\n// ensure SDK version is current before relying on response shape.","typeGuard":"// Detect the structural defect after collection:\nif response.error != nil || response.partNumber == nil || response.response.ETag == nil {\n    // cannot commit this part\n}","tryCatchPattern":"for response := range osUploadPartResponses {\n    if response.error != nil || response.partNumber == nil || response.response.ETag == nil {\n        return fmt.Errorf(\"failed to upload part: %s\", response.error)\n    }\n    // ...\n}","preventionTips":["Keep oci-go-sdk up to date so UploadPart response parsing is current.","Retry on anomalous responses; usually transient.","Capture OpcRequestId via TF_LOG=TRACE for support."],"tags":["oci","multipart-upload","upload-part","etag","data-integrity","terraform-state"],"analyzedSha":"c9def3e214014c1188faabfc4a5bde5095139765","analyzedAt":"2026-08-07T15:39:49.278Z","schemaVersion":2},"datasetVersion":"2026-08-07T21:17:07.882Z"}