owid / owid-grapher

A platform for creating interactive data visualizations
https://ourworldindata.org
MIT License
1.35k stars 227 forks source link

Intermittent and short `TypeError: Failed to fetch` appears on Grapher admin #3673

Open paarriagadap opened 1 month ago

paarriagadap commented 1 month ago

Description

From time to time, there is an error appearing at random on Grapher admin. The error message says TypeError: Failed to fetch and it is commonly solved after refreshing. It is not problematic except when we are doing some changes before saving or when we modify a chart for a data insight and we have not exported.

Expected behaviour

There should be no error message of this kind.

Steps to reproduce

It can't be reproduced because it happens randomly, but if it is helpful, this error appeared for the last time on 31 May 2024, ~10:30, 10:35 AM in the UK (in case it can be observed in the log).

Screenshots

From the last time it happened, while editing PNG and SVG exports for a DI. image

Environment

For desktop, provide:

Additional context

Original Slack post

danyx23 commented 3 weeks ago

@paarriagadap are you on a wifi when these errors occur? My hunch would be that this is caused by some intermittent network issues. We could add an automatic retry logic though

paarriagadap commented 3 weeks ago

@danyx23 Hi, yes, on wifi. I'm not sure if that would be the case, as I haven't seen intermittent connection in other situations. I understand that it also happens to @saloni-nd at least, according to her emoji in the Slack post

saloni-nd commented 3 weeks ago

Yeah it's hard for me to remember exactly when it happens, but I think it's usually been when I've had the tab open for a while and come back to it later on. I'll try to keep a look out for the next time it happens.

paarriagadap commented 3 weeks ago

It happened many times today while showing Grapher to @antea04

marcelgerber commented 1 week ago

We want to look into this, but don't currently have a good intuition as to what could be the problem.

It could be server restarts (because of OOM or other issues maybe?), but very much unsure about that.

It probably makes sense to look at this for, like, a day, and then see whether we could find a red herring somewhere.

paarriagadap commented 1 week ago

Thanks @marcelgerber, I will post whenever this happens again anyway, and the context around the error.

marcelgerber commented 1 week ago

We now have a hunch that this might be related to Cloudflare Auth tokens running out.

paarriagadap commented 1 week ago

Just happened once I returned to an admin tab to click "Datasets". It seems it's just like Saloni says, with tabs that are open for a while.

image