{"record":{"id":"65c435313377d0f4","repo":"argoproj/argo-workflows","slug":"unable-to-upload-file-s-to-azure-w","errorCode":null,"errorMessage":"unable to upload file %s to Azure: %w","messagePattern":"unable to upload file (.+?) to Azure: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"workflow/artifacts/azure/azure.go","lineNumber":300,"sourceCode":"\tisDir, err := file.IsDirectory(path)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to test if %s is a directory: %w\", path, err)\n\t}\n\n\tcontainerClient, err := azblobDriver.newAzureContainerClient(ctx)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to create Azure Blob Container client for %s: %w\", outputArtifact.Azure.Blob, err)\n\t}\n\n\tif isDir {\n\t\terr := PutDirectory(ctx, containerClient, outputArtifact.Azure.Blob, path)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unable to upload directory %s to Azure: %w\", path, err)\n\t\t}\n\t} else {\n\t\terr := PutFile(ctx, containerClient, outputArtifact.Azure.Blob, path)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unable to upload file %s to Azure: %w\", path, err)\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// SaveStream saves an artifact from an io.Reader to Azure Blob Storage\nfunc (azblobDriver *ArtifactDriver) SaveStream(ctx context.Context, reader io.Reader, outputArtifact *wfv1.Artifact) error {\n\tlogger := logging.RequireLoggerFromContext(ctx)\n\tlogger.WithField(\"endpoint\", outputArtifact.Azure.Endpoint).\n\t\tWithField(\"container\", outputArtifact.Azure.Container).\n\t\tWithField(\"blob\", outputArtifact.Azure.Blob).\n\t\tInfo(ctx, \"Streaming to Azure Blob Storage\")\n\n\tcontainerClient, err := azblobDriver.newAzureContainerClient(ctx)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to create Azure Blob Container client for %s: %w\", outputArtifact.Azure.Blob, err)\n\t}","sourceCodeStart":282,"sourceCodeEnd":318,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/workflow/artifacts/azure/azure.go#L282-L318","documentation":"Fired in ArtifactDriver.Save while uploading a single file to Azure Blob Storage: PutFile (or the preceding client/dir logic) failed and the error is wrapped with the local path. Indicates Azure-side rejection, auth, or network trouble during artifact save.","triggerScenarios":"Saving a file artifact when os.Open fails (permission, disappeared mid-run) or blobClient.UploadFile fails (auth, network, quota, oversized blob).","commonSituations":"File deleted between generation and save; read-permission problems for the emissary user; single blob exceeding 195GB block-blob limit; transient network errors.","solutions":["Read the wrapped inner error to distinguish local open failure vs Azure upload failure.","If local: fix permissions/existence of the artifact path.","If Azure: check credentials, retries, and blob size limits; split large files.","Verify container-level write permissions for the account key.","Retry on transient network/storage errors."],"exampleFix":"// before: unreadable file saved as artifact\ncmd: [sh, -c, \"umask 077; generate > /work/out.txt\"]\n// after: ensure readable by executor user\ncmd: [sh, -c, \"generate > /work/out.txt && chmod 644 /work/out.txt\"]","handlingStrategy":"validation","validationCode":"info, err := os.Stat(path)\nif err != nil {\n  return fmt.Errorf(\"artifact file missing: %w\", err)\n}\nif info.Size() > 195*1024*1024*1024 {\n  return errors.New(\"file exceeds Azure block blob limit\")\n}","typeGuard":"func isUploadErr(err error) bool {\n  return errors.As(err, new(*azcore.ResponseError))\n}","tryCatchPattern":"err := driver.Save(ctx, path, artifact)\nif err != nil && strings.Contains(err.Error(), \"unable to upload file\") {\n  var re *azcore.ResponseError\n  if errors.As(errors.Unwrap(err), &re) && re.StatusCode >= 500 {\n    // retry with backoff\n  }\n  return err\n}","preventionTips":["Ensure artifact files are readable by the executor user (chmod 644).","Keep files under the Azure block blob size limit.","Don't delete/move artifact files before save completes.","Retry transient 5xx upload errors."],"tags":["azure","blob-storage","upload","artifact"],"backgroundTag":"azure-blob-upload-failed","analyzedSha":"35bff19146f5a6ada77468c431f2624bd577e373","analyzedAt":"2026-09-03T19:34:35.908Z","contentChangedAt":"2026-09-03T19:34:35.908Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}