operations icon indicating copy to clipboard operation
operations copied to clipboard

Gateway time-out when opening a long relation history

Open gy-mate opened this issue 1 year ago • 4 comments

URL

https://www.openstreetmap.org/relation/7795942/history

How to reproduce the issue?

  1. Open the URL
  2. See the following error: Screenshot 2024-10-23 at 23 47 36

Screenshot(s) or anything else?

This relation is enormous: it has 275 members and 94 versions. But the website could handle these cases somehow (error handling / longer timeout / splitting versions to several pages), I think, considering that the relation of the Hungarian railway line 1 has more members and might also reach this version size in the near future: https://www.openstreetmap.org/relation/11965670

gy-mate avatar Oct 23 '24 22:10 gy-mate

We do have a timeout but it looks like it's actually too long because cloudflare times out first. As far as I know we have no control over the cloudflare timeout but in any case that's an operational issue relating to the production deployment and not an issue with the web site code.

tomhughes avatar Oct 23 '24 23:10 tomhughes

Cloudflare timeout is 100 seconds and we are unable to change it in the edition we are using.

Firefishy avatar Oct 24 '24 04:10 Firefishy

@Firefishy For me it times out in just 30 seconds, not 100.

gy-mate avatar Oct 24 '24 05:10 gy-mate

Maybe Cloudflare decides to display their timeout page when it receives a timeout status code from osm-website?

AntonKhorev avatar Oct 24 '24 12:10 AntonKhorev

Cloudflare timeout is 100 seconds and we are unable to change it in the edition we are using.

@Firefishy For me it still times out in just 30 seconds, not 100.

gy-mate avatar Mar 09 '25 14:03 gy-mate

Which is the duration of the upstream timeout so I guess that is firing but cloudflare is replacing the rails error with it's own.

tomhughes avatar Mar 09 '25 14:03 tomhughes

I see. Would dividing the versions loaded on the relation history page into pages of, for instance, 20, resolve this issue? (So that the PostgreSQL query would be sped up with LIMIT and OFFSET.)

https://www.openstreetmap.org/relation/11965670/history is also getting close to the timeout: currently it loads in ~25 seconds.

gy-mate avatar Mar 09 '25 15:03 gy-mate

This was already suggested at https://github.com/openstreetmap/openstreetmap-website/issues/3524. I guess that would fix this issue.

If you don't mind, I'll close this one as a duplicate.

gy-mate avatar Mar 30 '25 10:03 gy-mate

https://github.com/openstreetmap/openstreetmap-website/issues/3524 solved the issue for the relations below:

  • https://www.openstreetmap.org/relation/7795942/history
  • https://www.openstreetmap.org/relation/11965670/history
  • https://www.openstreetmap.org/relation/544260/history
  • https://www.openstreetmap.org/relation/197845/history
  • https://www.openstreetmap.org/relation/2769137/history

But unfortunately https://www.openstreetmap.org/relation/9818928/history still shows a 504 Gateway Timeout Cloudflare error page after 30 seconds. :(

gy-mate avatar Aug 20 '25 15:08 gy-mate

Yes if people created stupid relations you're probably not going to be able to view them on the web site because we have timeouts in place to protect the service.

tomhughes avatar Aug 20 '25 15:08 tomhughes

Good point—I've deleted that relation (and two other related ones) because they are disused according to FlixBus: https://www.openstreetmap.org/changeset/170764169

gy-mate avatar Aug 21 '25 08:08 gy-mate