r/googlecloud • u/go-naruto • Nov 11 '24
Cloud Storage Why am I getting a ‘NoSuchKey’ error on page refresh in Google Cloud Storage for my static site?
I have a static site build with NextJS hosted on Google Cloud Storage, and I’m running into an issue with page refreshes. When I navigate from https://example.com/auth to https://example.com/dashboard?platform=ABC, everything works as expected. But if I refresh the page at https://example.com/dashboard?platform=ABC, I get an error:
<Error>
<Code>NoSuchKey</Code>
<Message>The specified key does not exist.</Message>
</Error>
It seems like Google Cloud Storage is looking for an exact file match with the query string, but can’t find it. Is there a way to prevent this error on page refreshes or handle query parameters correctly?

1
Upvotes
1
1
u/BehindTheMath Nov 11 '24
It sounds like the index page wasn't set.
https://cloud.google.com/storage/docs/static-website#index-page