Is this exactly query your run? Do you have minimal PHP script I can run to reproduce the issue? This particular query contains syntax error: bucket is reserved word and have to be escaped.
Sorry, I changed my actual bucket name to bucket for the purposes of this post. The real query has a different bucket name.
This is the exact query I run. The string is concatenated with some variables, but nothing in-depth.
The problem is, I cannot reproduce it. If I re-run the code (unchanged), the error does not occur. So I am wondering what happened for that particular query to fail with such an exception?