Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

50% failed precondition rate when viewing metrics on storage bucket

Hello,

I see a metric in my bucket observability that says that Client Error Rate is sometimes up to 50%.

CleanShot 2024-10-30 at 12.34.05.png

 Looking at the details, I can see that a lot of them is FAILED_PRECONDITION.

CleanShot 2024-10-30 at 12.37.10.png

I was googling for this error but could not find anything related to cloud storage or how to solve this. I also don't understand how to further investigate this or if this is even a real problem. 

 

 

0 3 386
3 REPLIES 3

Hi @theluk,

Welcome to the Google Cloud Community!

The Client Error Rate metric in Google Cloud Storage Monitoring comes from requests that responded with either a 412 Precondition Failed or a 304 Not Modified status code with a FAILED_PRECONDITION error.

Since the graph shows a FAILED_PRECONDITION error, this means that the spike in Client Error Rates was caused by a 304 Not Modified status code. Based on this table, the reason for the status code depends on which API you are using.

For JSON APIs:

  • If the values match an ifGenerationNotMatch query parameter, the response is a 304 Not Modified
  • If the values match an ifMetagenerationNotMatch query parameter, the response is a 304 Not Modified

For XML APIs:

  • If the object does not meet an If-Modified-Since header condition, the response is a 304 Not Modified


For both JSON and XML APIs:

  • If the object matches the given hash in an If-None-Match header, the response is 304 Not Modified

Therefore, to reduce the Client Error Rate in Google Cloud Storage monitoring, make sure that your objects and values follow the respective request preconditions.

I hope this helped!

What does this mean? "Make sure that your objects and values follow the respective request preconditions."? 

I simply upload a file to firebase storage, then i create a download url (one with token). Then I use that download url. There is nothing else I am doing. 

Based on my usage I have still no idea what the error is or why it comes up in my particular case

@theluk Did you ever figure out what the issue was? Were these errors impacting your service or do you think they are background noise? We have been getting this for about a month without any significant change in our code, but I am having trouble identifying if it is actually impacting users or what the issue even is.