{"record":{"id":"d49c509abf2f4294","repo":"argoproj/argo-workflows","slug":"error-listing-blobs-s-in-azure-blob-storage-conta","errorCode":null,"errorMessage":"error listing blobs %s in Azure Blob Storage container: %w","messagePattern":"error listing blobs (.+?) in Azure Blob Storage container: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"workflow/artifacts/azure/azure.go","lineNumber":435,"sourceCode":"\tlogger.WithField(\"endpoint\", artifact.Azure.Endpoint).\n\t\tWithField(\"container\", artifact.Azure.Container).\n\t\tWithField(\"blob\", artifact.Azure.Blob).\n\t\tInfo(ctx, \"Listing blobs in Azure Blob Storage\")\n\n\tcontainerClient, err := azblobDriver.newAzureContainerClient(ctx)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to create Azure Blob Container client: %w\", err)\n\t}\n\n\tlistOpts := azblob.ListBlobsFlatOptions{\n\t\tPrefix: &artifact.Azure.Blob,\n\t\tMarker: nil,\n\t}\n\tpager := containerClient.NewListBlobsFlatPager(&listOpts)\n\tfor pager.More() {\n\t\tresp, err := pager.NextPage(ctx)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error listing blobs %s in Azure Blob Storage container: %w\", artifact.Azure.Blob, err)\n\t\t}\n\t\tfor _, v := range resp.Segment.BlobItems {\n\t\t\tfiles = append(files, *v.Name)\n\t\t}\n\t}\n\treturn files, nil\n}\n\n// IsDirectory indicates whether or not the artifact represents a directory or a single file.\nfunc (azblobDriver *ArtifactDriver) IsDirectory(ctx context.Context, artifact *wfv1.Artifact) (bool, error) {\n\tblobPrefix := artifact.Azure.Blob\n\n\tif blobPrefix == \"\" {\n\t\treturn true, nil\n\t}\n\tif !strings.HasSuffix(blobPrefix, \"/\") {\n\t\tblobPrefix += \"/\"\n\t}","sourceCodeStart":417,"sourceCodeEnd":453,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/workflow/artifacts/azure/azure.go#L417-L453","documentation":"ListObjects iterates the List Blobs Flat pager; any failure from pager.NextPage (non-2xx response, auth failure, network error) is wrapped as 'error listing blobs %s in Azure Blob Storage container'. Note only the first failing page aborts the loop.","triggerScenarios":"Listing blobs under an artifact prefix when Azure returns 403 (no list permission), 404 (container missing), throttling (503) beyond retries, or a connection reset/DNS failure mid-pagination.","commonSituations":"Identity has only Reader (control plane) but not 'Storage Blob Data Reader' (data plane); container typo; private endpoint/firewall blocking egress; SAS token lacking 'l' (list) permission; storage account throttling large prefix listings.","solutions":["Grant the credential 'Storage Blob Data Reader' role (or SAS with list permission) on the container.","Verify the container name exists: az storage container list on the account.","Check for 403 vs 404 vs 503 in the wrapped error and fix accordingly (permissions / name / throttling).","If throttled, reduce listing pressure or retry with backoff; the SDK default retries may not be enough for sustained 503s.","Confirm network path: test from the same pod with curl to https://<account>.blob.core.windows.net."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// cheap pre-check that the container is listable\n_, err := driver.ListObjects(ctx, &wfv1.Artifact{ArtifactLocation: wfv1.ArtifactLocation{\n    Azure: &wfv1.AzureArtifact{Endpoint: ep, Container: c, Blob: probePrefix}}})\nif err != nil { return err }","typeGuard":null,"tryCatchPattern":"err := retry.Do(ctx, func() error {\n    files, err = driver.ListObjects(ctx, artifact)\n    var respErr *azcore.ResponseError\n    if err != nil && errors.As(err, &respErr) && respErr.StatusCode == 403 {\n        return retry.Fatal(err) // don't retry auth errors\n    }\n    return err\n})","preventionTips":["Assign Storage Blob Data Reader for listing operations.","Use SAS tokens that include list ('l') permission.","Back off on 503 throttling; don't hammer large prefixes.","Monitor storage account availability metrics."],"tags":["azure","blob-storage","list-objects","permissions"],"backgroundTag":"azure-blob-list-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"}