{"record":{"id":"a06c70b1f14a2780","repo":"argoproj/argo-workflows","slug":"unable-to-open-blob-stream-for-s-w","errorCode":null,"errorMessage":"unable to open blob stream for %s: %w","messagePattern":"unable to open blob stream for (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"workflow/artifacts/azure/azure.go","lineNumber":268,"sourceCode":"\t\temptyFile = *response.ContentLength == 0\n\t\t// We have a normal file blob, so just return the response body stream\n\t\tif !emptyFile {\n\t\t\treturn response.Body, nil\n\t\t}\n\t} else if !bloberror.HasCode(origErr, bloberror.BlobNotFound) {\n\t\treturn nil, fmt.Errorf(\"unable to open stream for blob %s: %w\", artifact.Azure.Blob, origErr)\n\t}\n\n\tisDir, err := azblobDriver.IsDirectory(ctx, artifact)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to test if blob %s is a directory: %w\", artifact.Azure.Blob, err)\n\t}\n\tif isDir {\n\t\treturn nil, argoerrors.New(argoerrors.CodeNotImplemented, \"Directory Stream capability currently unimplemented for Azure Blob\")\n\t} else if !emptyFile {\n\t\t// Not a directory (and not successful retrieval of an empty file), so return\n\t\t// the original BlobNotFound error\n\t\treturn nil, fmt.Errorf(\"unable to open blob stream for %s: %w\", artifact.Azure.Blob, origErr)\n\t}\n\n\treturn response.Body, nil\n}\n\n// Save saves an artifact to Azure Blob Storage\nfunc (azblobDriver *ArtifactDriver) Save(ctx context.Context, path string, 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, \"Saving to Azure Blob Storage\")\n\n\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","sourceCodeStart":250,"sourceCodeEnd":286,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/workflow/artifacts/azure/azure.go#L250-L286","documentation":"When the initial DownloadStream fails with BlobNotFound and the driver determines the blob is neither a directory nor an empty file, it re-reports the original BlobNotFound wrapped in this message. In practice this means the requested blob genuinely does not exist in the container.","triggerScenarios":"OpenStream where the blob key is wrong, the upstream step never produced/saved the artifact, or the artifact was uploaded under a different prefix/container.","commonSituations":"Typo in artifact path; consumer workflow runs before producer saved the artifact (missing depends/dag dependency); archived artifact deleted; account/container mismatch.","solutions":["Verify the blob exists: az storage blob list --container-name <c> and compare exact names (case-sensitive).","Check the producing workflow step actually completed and saved the artifact under that key.","Add DAG/upstream dependencies so the consuming step runs after the artifact is saved.","Confirm artifact 'path' (save location) and consumer 'key' match.","Check you are pointing at the expected storage account/endpoint (production vs test)."],"exampleFix":"// before: consumer has no dependency on producer\ntasks:\n  - name: consume\n    artifacts: [{name: out, from: \"{{tasks.produce.outputs.artifacts.out}}\"}]\n// after: add dependency so artifact exists first\ntasks:\n  - name: consume\n    depends: \"produce\"\n    ...","handlingStrategy":"validation","validationCode":"iter := containerClient.NewListBlobsFlatPager(&azblob.ListBlobsFlatOptions{Prefix: &blob})\nexists := false\nfor iter.More() {\n  page, err := iter.NextPage(ctx)\n  if err != nil { return err }\n  for _, b := range page.Segment.BlobItems {\n    if *b.Name == blob { exists = true }\n  }\n}\nif !exists { return fmt.Errorf(\"blob %s does not exist yet\", blob) }","typeGuard":"func isBlobNotFound(err error) bool {\n  return bloberror.HasCode(err, bloberror.BlobNotFound)\n}","tryCatchPattern":"stream, err := driver.OpenStream(ctx, artifact)\nif err != nil {\n  if isBlobNotFound(errors.Unwrap(err)) {\n    // producer hasn't finished or key wrong — check workflow deps\n  }\n  return err\n}","preventionTips":["Always declare DAG/task dependencies so consumers run after producers.","Use artifact `from:` expressions instead of hand-typed keys.","Avoid setting `optional: false` artifacts unless the producer is guaranteed.","Lint workflows before submit to catch path typos."],"tags":["azure","blob-storage","not-found","artifact"],"backgroundTag":"azure-blob-not-found","analyzedSha":"35bff19146f5a6ada77468c431f2624bd577e373","analyzedAt":"2026-09-03T19:34:35.908Z","contentChangedAt":"2026-09-03T19:34:35.908Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}