Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blob: include blob key in errors #2564

Closed
vangent opened this issue Jul 16, 2019 · 0 comments · Fixed by #2565
Closed

blob: include blob key in errors #2564

vangent opened this issue Jul 16, 2019 · 0 comments · Fixed by #2565
Assignees
Labels
enhancement New feature or request

Comments

@vangent
Copy link
Contributor

vangent commented Jul 16, 2019

I noticed this from an issue filed against Pulumi. It doesn't appear to be a Go CDK issue, but the error message wasn't very clear ("The specified blob does not exist") and the user noted that it "doesnt tell which blob it would expect and what content that should have."

Services appear to be inconsistent about whether they include the key name in "not found" errors (see below for details).

Since the portable type (gocloud.dev/blob) knows the key, we should just make sure it's included in the error message for all errors that apply to a key. We already include a prefix, so it's shouldn't be hard to add it there.

GCS:

blob (code=NotFound): storage: object doesn't exist

S3:

blob (code=NotFound): NoSuchKey: The specified key does not exist.
	status code: 404, request id: ...

Azure:

Read after failed write: blob (code=NotFound): -> github.com/Azure/azure-storage-blob-go/azblob.newStorageError, /usr/local/google/home/rvangent/go/pkg/mod/github.com/!azure/azure-storage-blob-go@v0.6.0/azblob/zc_storage_error.go:42
===== RESPONSE ERROR (ServiceCode=BlobNotFound) =====
Description=The specified blob does not exist.
RequestId:d68d0b9f-e01e-0107-36b4-092564000000
Time:2019-05-13T17:52:46.5463275Z, Details: 
   Code: BlobNotFound
   GET https://gocloudblobtests.blob.core.windows.net/go-cloud-bucket/blob-for-reading
   Authorization: REDACTED
   Content-Type: []
   User-Agent: [go-cloud/blob/0.1.0 Azure-Storage/0.6 (go1.12.5; linux)]
   X-Cloud-Trace-Context: [e2790d62e0779aaa44a51111597b5f38/16106888398616378301;o=0]
   X-Ms-Date: [Tue, 16 Jul 2019 15:41:08 GMT]
   X-Ms-Version: [2018-11-09]
   --------------------------------------------------------------------------------
   RESPONSE Status: 404 Not Found
   Content-Length: [215]
   Content-Type: [application/xml]
   Date: [Mon, 13 May 2019 17:52:45 GMT]
   Server: [Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0]
   X-Ms-Error-Code: [BlobNotFound]
   X-Ms-Request-Id: [d68d0b9f-e01e-0107-36b4-092564000000]
   X-Ms-Version: [2018-11-09]

[Other errors looked similar]

File:

blob (code=NotFound): stat /tmp/go-cloud-fileblob/blob-for-reading: no such file or directory
@vangent vangent added enhancement New feature or request in progress This is being actively worked on labels Jul 16, 2019
@vangent vangent self-assigned this Jul 16, 2019
@go-cloud-bot go-cloud-bot bot removed the in progress This is being actively worked on label Jul 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant