getaddrnfo EAI_AGAIN error on file served over CloudFront

0

Hello,

I have a 10GB file hosted on S3, served via Cloudfront. The file (over CF) is publicly accessible and no WAF has been set up. The file is normally accessed infrequently by a team of less than 100 users. The CF uses a custom domain that is registered with R53 using AWS nameservers and route tables.

I have a simple nodejs program, currently running locally, that checks the file's header for its last modified date every minute. For the most part, it works, and will return a 304 not modified code.

However, if I let it run for a period of time, I will start getting a chain of getaddrinfo EAI_AGAIN errors non stop. It will persist, with maybe 2x 304 success codes every now and then.

I am still able to access the target via my browser despite getting the EAI_AGAIN error.

304 into EAI_AGAIN

I am wondering why I am getting the EAI_AGAIN error. Would it be that, for some reason, either my ISP or CloudFront has been throttling the connection. 1 request every minute seem to be a perfectly reasonable rate of access.

Below is the program I have been using

const https = require('https');
let i = 0;
const checkHeader = () => {
    let date = new Date();
    let url = `${CLOUDFRONT_FILE_URL}`;
    i++;
    https.request(url, {
        method: 'HEAD',
        headers: {
            'If-Modified-Since': date.toString()
        }
    }, (res) => {
        console.log(i, " ", res.statusCode);
    }).on('error', (err) => {
        console.error(i, " ", err);
    }).end();
}
checkHeader();
setInterval(checkHeader, 60 * 1000);
Henry
gefragt vor 4 Monaten129 Aufrufe
Keine Antworten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen