Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[storage] fix: use unique blob name #3568

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

Merged
merged 3 commits into from
Apr 29, 2020

Conversation

tmatsuo
Copy link
Contributor

@tmatsuo tmatsuo commented Apr 28, 2020

fixes #3567

@tmatsuo tmatsuo requested a review from frankyn April 28, 2020 16:04
@tmatsuo tmatsuo requested review from crwilcox and a team as code owners April 28, 2020 16:04
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Apr 28, 2020
blob = Blob(
blob_name,
bucket,
encryption_key=TEST_ENCRYPTION_KEY_2_DECODED
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised you need to pass in the encryption key to delete the object. Could you provide context on how you arrived to this solution?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that is something that already exists in the sample

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still confused, because the encryption_key isn't required to delete in the second call and only needed in the instantiation. At least If I'm understanding correctly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@frankyn

I added some comments. I just got NotFound and realized you need the key to delete the blob.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without the try-except, it is always fail with the following error:

google.api_core.exceptions.NotFound: 404 DELETE https://storage.googleapis.com/storage/v1/b/tmatsuo-test-bucket/o/test_blob_7188d5dc44764ef7a6bc19a815385daf?generation=1588127655320921: No such object: tmatsuo-test-bucket/test_blob_7188d5dc44764ef7a6bc19a815385daf

@tmatsuo
Copy link
Contributor Author

tmatsuo commented Apr 28, 2020

I filed the following issues:
#3574
#3575

Restarting the build.

@tmatsuo tmatsuo added the automerge Merge the pull request once unit tests and other checks pass. label Apr 28, 2020
blob = Blob(
blob_name,
bucket,
encryption_key=TEST_ENCRYPTION_KEY_2_DECODED
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still confused, because the encryption_key isn't required to delete in the second call and only needed in the instantiation. At least If I'm understanding correctly.

@tmatsuo tmatsuo merged commit 06a40e8 into GoogleCloudPlatform:master Apr 29, 2020
@tmatsuo tmatsuo deleted the fix-storage branch April 29, 2020 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Merge the pull request once unit tests and other checks pass. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

storage.cloud-client.encryption_test: test_rotate_encryption_key failed
4 participants