{"record":{"id":"d5594074e84876cc","repo":"hashicorp/terraform","slug":"error-creating-multipart-upload-s","errorCode":null,"errorMessage":"error creating multipart upload: %s","messagePattern":"error creating multipart upload: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/backend/remote-state/oci/multipart_upload.go","lineNumber":79,"sourceCode":"\tmultipartUploadRequest := &objectstorage.CreateMultipartUploadRequest{\n\t\tNamespaceName:   common.String(multipartUploadData.client.namespace),\n\t\tBucketName:      common.String(multipartUploadData.client.bucketName),\n\t\tRequestMetadata: multipartUploadData.RequestMetadata,\n\t\tCreateMultipartUploadDetails: objectstorage.CreateMultipartUploadDetails{\n\t\t\tObject: common.String(multipartUploadData.client.path),\n\t\t},\n\t}\n\tif multipartUploadData.client.kmsKeyID != \"\" {\n\t\tmultipartUploadRequest.OpcSseKmsKeyId = common.String(multipartUploadData.client.kmsKeyID)\n\t} else if multipartUploadData.client.SSECustomerKey != \"\" && multipartUploadData.client.SSECustomerKeySHA256 != \"\" {\n\t\tmultipartUploadRequest.OpcSseCustomerKey = common.String(multipartUploadData.client.SSECustomerKey)\n\t\tmultipartUploadRequest.OpcSseCustomerKeySha256 = common.String(multipartUploadData.client.SSECustomerKeySHA256)\n\t\tmultipartUploadRequest.OpcSseCustomerAlgorithm = common.String(multipartUploadData.client.SSECustomerAlgorithm)\n\t}\n\n\tmultipartUploadResponse, err := multipartUploadData.client.objectStorageClient.CreateMultipartUpload(context.Background(), *multipartUploadRequest)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error creating multipart upload: %s\", err)\n\t}\n\n\tworkerCount := defaultNumberOfGoroutines\n\tosUploadPartResponses := make(chan objectStorageUploadPartResponse, len(sourceBlocks))\n\tsourceBlocksChan := make(chan objectStorageSourceBlock, len(sourceBlocks))\n\n\twg := &sync.WaitGroup{}\n\twg.Add(len(sourceBlocks))\n\n\t// Push all source blocks into the channel\n\tfor _, sourceBlock := range sourceBlocks {\n\t\tsourceBlocksChan <- sourceBlock\n\t}\n\tclose(sourceBlocksChan)\n\terrChan := make(chan error, workerCount)\n\t// Start workers\n\tfor i := 0; i < workerCount; i++ {\n\t\tgo func() {","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/hashicorp/terraform/blob/c9def3e214014c1188faabfc4a5bde5095139765/internal/backend/remote-state/oci/multipart_upload.go#L61-L97","documentation":"Raised in multiPartUploadImpl when the OCI CreateMultipartUpload API call fails. Until this succeeds no upload-id exists, so no parts can be uploaded. The wrap surfaces the raw SDK error (auth, authorization, bucket/object config, KMS, SSE-C, throttling, network).","triggerScenarios":"objectStorageClient.CreateMultipartUpload (multipart_upload.go:77) returns a non-nil error: 401/403 lacking permission, 400 for a bad OpcSseKmsKeyId / SSE-Customer fields, 404 bucket/namespace, 429, or 5xx/network.","commonSituations":"IAM principal lacks OBJECT_CREATE; KMS key id invalid or in wrong region; SSE-Customer key fields inconsistent; wrong namespace/bucket; throttling at upload start; network blip initiating the multipart session.","solutions":["Read the wrapped OCI ErrorCode: 403 -> grant OBJECT_CREATE; InvalidParameter -> fix kms_key_id/SSE-C fields.","Verify the KMS key OCID is valid in-region and the principal has KEY_USE on it.","Confirm bucket and namespace exist and the object key is valid.","Re-run; the create call is covered by getDefaultRetryPolicy for transient 429/5xx.","Note: when this fails the caller (client.Put) falls back to single-part upload if dataSize <= MaxFilePartSize, so a true failure here that also fails single-part points to auth/config."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Pre-flight config checks:\nif c.kmsKeyID != \"\" && !strings.HasPrefix(c.kmsKeyID, \"ocid1.key.\") {\n    return fmt.Errorf(\"invalid kms_key_id\")\n}\nif c.bucketName == \"\" || c.namespace == \"\" { return fmt.Errorf(\"bucket/namespace required\") }","typeGuard":"var se common.ServiceError\nif errors.As(err, &se) {\n    switch se.GetHTTPStatusCode() {\n    case 403: // OBJECT_CREATE missing\n    case 400: // bad KMS/SSE-C params\n    case 404: // bucket/namespace missing\n    case 429: // throttled\n    }\n}","tryCatchPattern":"multipartUploadResponse, err := c.objectStorageClient.CreateMultipartUpload(ctx, *req)\nif err != nil {\n    return fmt.Errorf(\"error creating multipart upload: %s\", err)\n}","preventionTips":["Grant OBJECT_CREATE for multipart.","Use a valid in-region KMS key OCID.","Rely on retry policy for transient create failures.","Note Put falls back to single-part if create fails and size allows."],"tags":["oci","multipart-upload","create-multipart","auth","permissions","kms","encryption","terraform-state"],"analyzedSha":"c9def3e214014c1188faabfc4a5bde5095139765","analyzedAt":"2026-08-07T15:39:49.278Z","schemaVersion":2},"datasetVersion":"2026-08-07T21:17:07.882Z"}