Hi, I have seen this in docker containers having no internet connectivity. It looks potential errors are not handled correctly. To simulate the situation, I used an invalid hostname in config.js producing this output:
{ [Error: getaddrinfo ENOTFOUND geolite.maxmind.com1 geolite.maxmind.com1:80]
code: 'ENOTFOUND',
errno: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'geolite.maxmind.com1',
host: 'geolite.maxmind.com1',
port: 80 }
fs.js:53
throw backtrace;
^
Error: ENOENT: no such file or directory, unlink '/tmp/GeoIP.dat'
at rethrow (fs.js:48:21)
at makeCallback (fs.js:74:12)
at Object.fs.unlink (fs.js:923:14)
at ClientRequest.<anonymous> (/Users/stefan/sematext/logagent-js/node_modules/maxmind-geolite-mirror/bin/maxmind-geolite-mirror:88:12)
at emitOne (events.js:77:13)
at ClientRequest.emit (events.js:169:7)
at Socket.socketErrorListener (_http_client.js:256:9)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at connectErrorNT (net.js:997:8)
Please add better error handling.
Check if file exists before removal
Add callback function to fs.unlink() to catch the error. bin/maxmind-geolite-mirror:88:12
Hi, I have seen this in docker containers having no internet connectivity. It looks potential errors are not handled correctly. To simulate the situation, I used an invalid hostname in config.js producing this output:
Please add better error handling.