DEV Community

Cover image for Fetch Failed?
Mr X
Mr X

Posted on

Fetch Failed?

This is more of a question than a thread.

This is the scenario. I am working with nodes in node-RED. Basically I am requesting a list of files from One Drive and then sending this list (about 1000 files) through to a split node. A download of said files is then requested.

This request is made with Fetch and via the M365 javascript SDK.

The SDK has a get stream method that firstly gets the download URL and then requests the file as a binary stream.

What happens ocassionally with this request is that I get a fetch failed error for multiple downloads. Sometimes fetch fails when a relatively small number of downloads are requested for example 500.

I have monitored node-RED with Prometheus and have found that there is no noticable increase in event loop lag or excessive CPU usage.

Part of my question is can a node in node-RED spawn a worker thread for the download operation, in theory reducing main thread work https://nodejs.org/api/worker_threads.html

As far as I understand fetch failed means no response received. A failed request. So another question is, does the problem relate to the number of fetch requests being made.

Is the node being swamped with that many requests that it is just getting some kind of throw back from Fetch. If this is the case what is the best diagnostic tool to get some qualitative data?

Part of me thinks that this is a network error. However I am new to software such as shark wire so do not know how to identify possible issues.

💡 One last tip before you go

Tired of spending so much on your side projects? 😒

We have created a membership program that helps cap your costs so you can build and experiment for less. And we currently have early-bird pricing which makes it an even better value! 🐥

Just one of many great perks of being part of the network ❤️

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay