I have 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 exit. Error log of the script says: Error: getaddrinfo ENOTFOUND stream_url stream_url:8182 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 somehow, or maybe not itself, but causes that effect. What is the problem can it be? Where to go? Can you help?
Hi Lev, On 9/7/19 5:04 AM, Lev Zhbakov wrote:> I have node.js script, which works in daemon mode. The script reads IceCast ogg stream itself (on the fly) and sends audio tags to website.My suggestion would be to look at the JSON metadata functionality: http://icecast.org/docs/icecast-2.4.1/server-stats.html If you aren't running Icecast >= 2.4.1 (latest is 2.4.4), then you *really* should consider upgrading as there have been important security fixes and general improvements. You can query /status-json.xsl directly from within a web page.> But sometimes (exactly once per 2 days) the script fails end exit. Error log of the script says: > > Error: getaddrinfo ENOTFOUND stream_url stream_url:8182 > at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26)[…]> 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).The reported error is in name resolution. So this is not really Icecast related - something, somewhere fails to resolve the FQDN that is part of $stream_url. You'll have to investigate this yourself.> It seems IceCast crashes or disables domain or port somehow, or maybe not itself, but causes that effect.Icecast (no CamelCase, please!) is not involved in the problem that you are seeing. "It was DNS, It's always DNS!"> What is the problem can it be? Where to go? Can you help?You need to investigate your DNS resolution problem - Anywhere between that nodejs and the authoritative nameserver for the FQDN. My recommendation remains to just use the JSON API and forget nodejs. You will probably still have to address your DNS reliability. Cheers, TBR
On 2019-09-07 09:34, Thomas B. Rücker wrote:> On 9/7/19 5:04 AM, Lev Zhbakov wrote: >> I have node.js script, which works in daemon mode. The script reads IceCast ogg stream itself (on the fly) and sends audio tags to website.That will "eat" a listener slot and you are wasting bandwidth, you'll also be paying royalties for a "listener" tuned 24/7 (you are paying royalties for the music right?) If the streaming server is Icecast follow Thomas' advice below, if not and/or it is Centovacast or Everestcast there are APIs (JSON based) that return metadata info from the stream (and from the autodj if any). Just look at the widgets available and how they do it ten piggyback on that API, be aware that larger updates could break the API though (it shouldn't but you never know).> You can query /status-json.xsl directly from within a web page.It doesn't provide year and album name and artwork though does it?> My recommendation remains to just use the JSON API and forget nodejs. > You will probably still have to address your DNS reliability.Or if in control of the source then pack up the metadata (on the source machine) into a nice JSON and send that to the webserver (where a PHP script take the JSON data and present it on the webpage). -- Unless specified otherwise, anything I write publicly is considered Public Domain (CC0). My opinions are my own unless specified otherwise. Roger Hågensen, Freelancer, Norway.