Rewrite object receives 400 error when CMEK is enabled for a bucket #806
Labels
api: storage
Issues related to the googleapis/python-storage API.
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Tracking issue for a customer.
Unable to rewrite on top of an existing GCS blob in CMEK enabled bucket. Receives a 400 Bad Request with the following repro code. This looks very similar to #155
Environment details
Steps to reproduce
Code example
Expected behavior: Success, blob2 is overwritten
Actual behavior: google.api_core.exceptions.BadRequest: 400 POST <...> Bad Cloud KMS crypto key <...>
As long as blob1 and blob2 are not equal and both exist, this issue happens.
Workaround
Either delete blob2 first, then overwrite. OR call
blob2 = bucket.blob(blob_name2)
instead.Potential Fix:
blob.rewrite()
should only usekms_key_name
if it doesn't end with a version.The text was updated successfully, but these errors were encountered: