[Solved] Fetch request failing: getaddrinfo EAI_AGAIN


#1

Hi guys,

I’ve been toying with a botkit starter kit and got it to work quite well until today: do you know why my fetch request are failing today with this getaddringo error?
Looks like a DNS issue on Glitch servers, but I may have missed something.
My code is nothing fancy:
fetch(‘https://opentdb.com/api.php?amount=1&difficulty=medium&type=multiple’)
.then(function (res) {return res.json()})
.then(function(json) {trivia = json.results[0]})

And it worked well all past week, I don’t understand why it started failing today…
Any idea or advice on how to fix this issue would be really appreciated!


#2

Hi @abencheikh,

can you please tell us the project name, so that I can give a closer look?

Thanks!


#3

It looks like the problem has something to do with DNS for opentdb.com. If you go to the Glitch console and ping another server, it works, but for some reason opentdb.com comes back with an unknown host error.


#4

The problem seems to have resolved itself.


#5

Thanks a lot guys! I guess I’ll never now what happened exactly, but yes the issue has solved itself: thanks for your assistance!