Edit history

[Self-hosted] GIF picker intermittently returns shard_unavailable on first GetFeatured request has not been edited, so there are no earlier versions.

Current version | Original by Rex
Show

[Self-hosted] GIF picker intermittently returns shard_unavailable on first GetFeatured request

Observed behaviour

On my self-hosted instance, opening the GIF picker sometimes fails on the first attempt with "GIFs could not load". image The API returns 503 Service Unavailable with shard_unavailable for GET /v1/gifs/featured. This has happened during normal use for multiple users on the instance. Retrying shortly afterwards succeeds immediately. image Observed examples:
  • 503 after 5005 ms
  • 503 after 5159 ms
  • 503 after 5134 ms
Successful retries typically complete in only a few milliseconds (e.g. 12–20 ms). I have not been able to reproduce the same issue on the official web.canary.fluxer.app instance. A normal Docker Compose restart does not reliably reproduce the issue. The first GIF request after a restart can also succeed normally. Expected behaviour: The GIF picker should load successfully on the first attempt.

Reproduction steps

  1. Open the self-hosted Fluxer web client and sign in.
  2. Open browser DevTools → Network.
  3. Open the GIF picker and locate the request to /v1/gifs/featured?locale=en-US.
  4. Edit and resend the request using a previously unused locale that is accepted by the endpoint, for example sv-SE or pt-BR.
  5. Observe that the first request can return 503 shard_unavailable after almost exactly 5 seconds.
  6. Send the exact same request with the same locale again.
  7. Observe that it now returns 200 almost immediately.
Examples from my instance:
sv-SE:
first request  -> 503 shard_unavailable - 5019 ms
retry          -> 200                   - 20 ms

pt-BR:
first request  -> 503 shard_unavailable - 5009 ms
later request  -> 200                   - 13 ms
Cached en-US requests return immediately. The same issue also occurs naturally when users open the GIF picker, without modifying requests in DevTools.

Build information

Stable Web 2026.1001.233209, Linux (x64), Firefox 157.0, Locale en-US

Platform

Self-hosting

Details

Reproducible sv-SE case

GET /v1/gifs/featured
status: 503
durationMs: 5019
error: ServiceUnavailableError
message: shard_unavailable
op: GetFeatured
Immediate retry:
GET /v1/gifs/featured
status: 200
durationMs: 20

Reproducible pt-BR case

GET /v1/gifs/featured
status: 503
durationMs: 5009
error: ServiceUnavailableError
message: shard_unavailable
op: GetFeatured
Same locale afterwards:
GET /v1/gifs/featured
status: 200
durationMs: 13

Example from normal use

GET /v1/gifs/featured
status: 503
durationMs: 5134
error: ServiceUnavailableError
message: shard_unavailable
op: GetFeatured
A retry approximately four seconds later:
GET /v1/gifs/featured
status: 200
durationMs: 18
The failures consistently occurring at approximately 5 seconds seem notable. The service router currently appears to use a 5-second shard request timeout. I have not confirmed what causes gifs-shard to take longer than that on the initial request. FLUXER_GIF_SERVICE_TIMEOUT_MS is not explicitly configured on this instance; the stock self-hosting Compose configuration is used.