0

When processing the command:

gsutil -m -q setmeta -h "Cache-Control:public, max-age=10"

I get these errors frequently:

ERROR 1028 16:10:46.257674 retry_decorator.py] Retrying in 0.94 seconds ...
Traceback (most recent call last):
  File "/usr/local/share/google/google-cloud-sdk/platform/gsutil/third_party/retry-decorator/retry_decorator/retry_decorator.py", line 20, in f_retry
    return f(*args, **kwargs)
  File "/usr/local/share/google/google-cloud-sdk/platform/gsutil/gslib/commands/setmeta.py", line 248, in SetMetadataFunc
    provider=exp_src_url.scheme)
  File "/usr/local/share/google/google-cloud-sdk/platform/gsutil/gslib/cloud_api_delegator.py", line 212, in PatchObjectMetadata
    generation=generation, preconditions=preconditions, fields=fields)
  File "/usr/local/share/google/google-cloud-sdk/platform/gsutil/gslib/gcs_json_api.py", line 819, in PatchObjectMetadata
    generation=generation)
  File "/usr/local/share/google/google-cloud-sdk/platform/gsutil/gslib/gcs_json_api.py", line 1308, in _TranslateExceptionAndRaise
    raise translated_exception
PreconditionException: PreconditionException: 412 Precondition Failed

The server is on Google Compute engine and is updated frequently with:

gcloud components update

It seems the process actually completes but these errors keep occurring. Any idea what causes them and if there is a solution?

Thanks.

1 Answer 1

1

This can occur for two reasons:

  1. Another client updated the object (or its metadata) concurrently.
  2. There was a transient service or network error that needed to be retried (thus the "Retrying" message), but the original request actually succeeded. The retry gets preconditioned against the original object's metageneration, so it fails, even though the original operation succeeded.

If the cause is #1, you can solve it by avoiding concurrent updates to the objects. If the cause is #2, unfortunately, there is not much you can do.

2
  • So in essence, the message can be ignored, correct? It might be possible the #1 condition is happening, but it seems unlikely. Thanks!
    – CoryatJohn
    Oct 30, 2015 at 23:12
  • Yes, if you know for certain there are no concurrent writes, it should be safe to assume success for this particular command on a 412. Nov 2, 2015 at 18:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.