{"record":{"id":"5f60c60f32827526","repo":"VictoriaMetrics/VictoriaMetrics","slug":"cannot-upload-data-to-q-at-s-remote-path-q","errorCode":null,"errorMessage":"cannot upload data to %q at %s (remote path %q): %w","messagePattern":"cannot upload data to %q at (.+?) \\(remote path %q\\): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/backup/azremote/azblob.go","lineNumber":288,"sourceCode":"\tif err1 := body.Close(); err1 != nil && err == nil {\n\t\terr = err1\n\t}\n\tif err != nil {\n\t\treturn fmt.Errorf(\"cannot download %q from at %s (remote path %q): %w\", p.Path, fs, bc.URL(), err)\n\t}\n\tif uint64(n) != p.Size {\n\t\treturn fmt.Errorf(\"wrong data size downloaded from %q at %s; got %d bytes; want %d bytes\", p.Path, fs, n, p.Size)\n\t}\n\treturn nil\n}\n\n// UploadPart uploads part p from r to fs.\nfunc (fs *FS) UploadPart(p common.Part, r io.Reader) error {\n\tbc := fs.clientForPart(p)\n\n\t_, err := bc.UploadStream(fs.ctx, r, &blockblob.UploadStreamOptions{})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"cannot upload data to %q at %s (remote path %q): %w\", p.Path, fs, bc.URL(), err)\n\t}\n\tif err := fs.maybeSetMetadata(bc); err != nil {\n\t\treturn fmt.Errorf(\"cannot set metadata for %q at %s: %w\", p.Path, fs, err)\n\t}\n\treturn nil\n}\n\nfunc (fs *FS) clientForPart(p common.Part) *blockblob.Client {\n\tpath := p.RemotePath(fs.Dir)\n\n\treturn fs.clientForPath(path)\n}\n\nfunc (fs *FS) clientForPath(path string) *blockblob.Client {\n\tbc := fs.client.NewBlockBlobClient(path)\n\treturn bc\n}\n","sourceCodeStart":270,"sourceCodeEnd":306,"githubUrl":"https://github.com/VictoriaMetrics/VictoriaMetrics/blob/5079fb58f1e8e62113f90c945ad71586c797d770/lib/backup/azremote/azblob.go#L270-L306","documentation":"Fires in azremote UploadPart when the Azure block blob UploadStream call fails. Inputs at fault are the part path and remote blob URL; wrapped Azure SDK error usually indicates auth failure, container access level, throttling, or network problems.","triggerScenarios":"UploadStream returns an error: 403 authorization failure (bad/expired key or SAS), 404 container-not-found, network interruption mid-stream, context cancellation, quota/account limits, or reader r failing mid-stream and propagating into the upload.","commonSituations":"Wrong connection string/account key in configuration; destination container deleted; proxy/firewall dropping long uploads; uploading from a reader backed by a failing local source; hitting storage account egress/ingress limits.","solutions":["Check the wrapped Azure error's HTTP status: 403 fix credentials; 404 create/verify the destination container.","Verify the storage account configuration (connection string, account name, endpoint).","Retry the upload with a longer-lived context; UploadStream (block blob) retries per-block, but a full retry is safe.","Ensure the source io.Reader is healthy and provides the expected bytes."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// verify destination container exists before upload\ncontainer := fs.Client().ServiceClient().NewContainerClient(fs.Dir())\nif _, err := container.GetProperties(ctx, nil); err != nil {\n    return fmt.Errorf(\"destination container missing: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"if err := fs.UploadPart(p, r); err != nil && strings.Contains(err.Error(), \"cannot upload data\") {\n    var respErr azhttp.ResponseError\n    if errors.As(err, &respErr) && respErr.StatusCode == 403 {\n        // refresh credentials before retrying\n    }\n    // otherwise retry with backoff; block-blob upload is idempotent\n}","preventionTips":["Create/verify the destination container before uploading","Use valid, unexpired credentials with write access","Provide a stable io.Reader with the expected byte count","Set context timeouts appropriate for part size and bandwidth"],"tags":["azure","azure-blob","upload","network","permissions"],"backgroundTag":"blob-upload-failed","analyzedSha":"5079fb58f1e8e62113f90c945ad71586c797d770","analyzedAt":"2026-09-03T18:10:26.153Z","contentChangedAt":"2026-09-03T18:10:26.153Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}