Internal server error in h when fetching public annotation
Visiting https://hypothes.is/a/2ZcSQKo7EfCeAUP1uxAeig while not logged in shows a "this annotation is not available" message, even though the annotation is public. Inspecting the browser console shows that a 500 error occurred while fetching https://hypothes.is/api/annotations/2ZcSQKo7EfCeAUP1uxAeig. When this URL is visited while logged in, the annotation loads successfully.
When viewing the annotation in context at https://www.seangoedecke.com/seeing-like-a-software-company/, the annotation loads successfully. In this context the annotation is fetched via the search API.
I tested with a few other annotations, and they all seem affected by this. I'll try to see what's going on.
~It seems to suddenly work 🤔~ And it's failing again
This seems to be the root cause: https://github.com/hypothesis/h/pull/8864
The only thing is that locally, it causes the response to be a 400 indicating the CSRF token is missing, but in staging and prod it produces a 500. Still, I think that's probably the reason.