You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 31, 2026. It is now read-only.
Call bucket.rename_blob() with if_generation_match specified, matching the generation of destination blob.
The copyTo half the of the rename succeeds, but the DELETE part fails with 412 Precondition Failed.
If you look at request that failed (see example below), you can see that the DELETE operation specifies the same ifGenerationMatch parameter that the copyTo operation used. But this will obviously fail--the rename source is not going to have the same generation as the rename destination.
Environment details
google-cloud-storageversion: 1.35.0Steps to reproduce
bucket.rename_blob()withif_generation_matchspecified, matching the generation of destination blob.The
copyTohalf the of the rename succeeds, but theDELETEpart fails with 412 Precondition Failed.If you look at request that failed (see example below), you can see that the
DELETEoperation specifies the sameifGenerationMatchparameter that thecopyTooperation used. But this will obviously fail--the rename source is not going to have the same generation as the rename destination.Code example
Output