0

I have a node.js script, which works in daemon mode. The script reads IceCast ogg stream itself (on the fly) and sends audio tags to website. But sometimes (exactly once per 2 days) the script fails end exits. The error log of the script says:

Error: getaddrinfo ENOTFOUND stream_url stream_url:8000
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26)
Emitted 'error' event at:
    at Socket.socketErrorListener (_http_client.js:392:9)
    at Socket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
    at process._tickCallback (internal/process/next_tick.js:63:19)
events.js:174
      throw er; // Unhandled 'error’ event

Where “stream_url” is the real ogg stream URL.

Also I have noticed that if change stream_url on some another working ogg stream (not mine, just found via Google), no error occurs anymore. IceCast error log says nothing about it, just INFO and few WARN about web (favicon).

It seems IceCast crashes or disables domain or port/socket somehow, or maybe not itself, but causes that effect.

What might the problem be?

P.S. OS is CentOS.

1 Answers1

0

Look at the NodeJS documentation for dns.lookup() to get an idea what's going wrong.

This has nothing to do with Icecast. NodeJS fails to resolve the FQDN/hostname (in that sense stream_url is a misnomer) to an IP address. This can potentially have many reasons like:

  • NodeJS ran out of resources or stalled
  • The system ran out of resources
  • The resolver DNS that was queried didn't answer (properly)
  • The Internet connection to the resolver was down
  • The authoritative DNS server for that FQDN didn't answer

Your actual use case is best addressed in other ways like querying the Icecast JSON API endpoint, parsing its playlist.log or getting the data from the source client.

TBR
  • 313