"Can not connect to the streaming server 401, Authentication Required (HTTP/1.0)"

I seem to be the first to post about this problem on the forum. It’s the dreaded “Can not connect to the streaming server 401, Authentication Required (HTTP/1.0)” error message in the Output Streams section of Settings. Been wracking my brain the last couple hours with what seems like should be a simple issue.

Just did a clean install by following LibreTime Tutorial: How to install LibreTime. This is on an internal test server with with no DNS, so the IP address is being used in lieu of a domain.

icecast.xml has all three custom passwords (for source, relay and analytics admin) in place. I have no experience with LiquidSoap, so I’m unsure if any manual tweaking needs to take place with that?

The Icecast2 server is up and running but I see no mount point listed.

So, first question: Is the error referring to the relay or the admin login? Or is it something else entirely?

It looks to not be able to connect to the initial icecast login. I’m guessing you’ve updated the admin-password via the icecast.xml file? Did you give the service a restart after that?

service icecast2 restart

Alright, slightly confused and dazed…

I knew of the service icecast2 start and service icecast2 stop commands (which both have worked in the past) but not service icecast2 restart. So I just tried the restart option and here’s what returned:

Job for icecast2.service failed because the control process exited with error code.
See "systemctl status icecast2.service" and "journalctl -xe" for details.

So I thought, ooh! This is a new message!

But just as a sanity check, I attempted stop then start again, and instead of working, the same error message returned. I swear it’s worked before. I swear it! Or maybe I’m confusing it with another service. I question my sanity still.

Anyways, I checked systemctl status icecast2.service and here’s what returned:

● icecast2.service - LSB: Icecast2 streaming media server
   Loaded: loaded (/etc/init.d/icecast2; generated)
   Active: failed (Result: exit-code) since Tue 2019-09-03 11:40:37 PDT; 12s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 9711 ExecStop=/etc/init.d/icecast2 stop (code=exited, status=2)
  Process: 51563 ExecReload=/etc/init.d/icecast2 reload (code=exited, status=0/SUCCESS)
  Process: 10392 ExecStart=/etc/init.d/icecast2 start (code=exited, status=1/FAILURE)

Sep 03 11:40:37 myhostname systemd[1]: Starting LSB: Icecast2 streaming media server...
Sep 03 11:40:37 myhostname icecast2[10392]:  * Starting streaming media server icecast2
Sep 03 11:40:37 myhostname systemd[1]: icecast2.service: Control process exited, code=exited status=1
Sep 03 11:40:37 myhostname systemd[1]: icecast2.service: Failed with result 'exit-code'.
Sep 03 11:40:37 myhostname systemd[1]: Failed to start LSB: Icecast2 streaming media server.

Next I tried journalctl -xe and got this on infinite repeat:

Sep 03 11:34:32 myhostname airtime-liquidsoap[757]: 2019/09/03 11:34:32 [_a:3] Connecting mount _a for source@localhost...
Sep 03 11:34:32 myhostname airtime-liquidsoap[757]: 2019/09/03 11:34:32 [_a:2] Connection failed: could not write data to host: Connection refused in write()
Sep 03 11:34:32 myhostname airtime-liquidsoap[757]: 2019/09/03 11:34:32 [lang:3] timeout --signal=KILL 45 pyponotify --error='could not write data to host: Connection refused in write()' --stream-id=1 --time=1567492688.66 &
Sep 03 11:34:32 myhostname airtime-liquidsoap[757]: 2019/09/03 11:34:32 [_a:3] Will try again in 5.00 sec.
Sep 03 11:34:32 myhostname airtime-liquidsoap[757]: 2019-09-03 11:34:32,507 [pyponotify] [INFO ]  #################################################
Sep 03 11:34:32 myhostname airtime-liquidsoap[757]: 2019-09-03 11:34:32,507 [pyponotify] [INFO ]  # Calling server to update liquidsoap status    #
Sep 03 11:34:32 myhostname airtime-liquidsoap[757]: 2019-09-03 11:34:32,508 [pyponotify] [INFO ]  #################################################
Sep 03 11:34:32 myhostname airtime-liquidsoap[757]: 2019-09-03 11:34:32,508 [pyponotify] [INFO ]  msg = could not write data to host: Connection refused in write()
Sep 03 11:34:32 myhostname airtime-liquidsoap[757]: 2019-09-03 11:34:32,556 [pyponotify] [INFO ]  Response: null
Sep 03 11:34:32 myhostname airtime-liquidsoap[757]: #########################################
Sep 03 11:34:32 myhostname airtime-liquidsoap[757]: #           *** pypo  ***               #
Sep 03 11:34:32 myhostname airtime-liquidsoap[757]: #     pypo notification gateway         #
Sep 03 11:34:32 myhostname airtime-liquidsoap[757]: #########################################

Apparently it has been retrying all night and all day every few seconds. I suspected this due to the 401 error message refreshing as I tried to copy/paste it earlier.

So, I’m still looking into this, but it does look like the service itself.

But now… I just attempted to go to the Icecast Server in my browser, and I am no longer able to reach the status page. So, between last night and now, something has changed. If I’m the one who changed it I cannot remember what I did; I was so tired last night.

So now I have this new problem on top of the other problem I was having with the 401 authentication error.

Maybe I should find a way to completely uninstall icecast2 and start from scratch?

Sorry, quick follow-up post:

I rebooted the machine, reinstalled icecast2 and the status page is back up. So now I’m back at square one with my original 401, authentication required error problem. Tried restarting the Icecast service and still nothing changed. Still gives a 401 error.

So, I re-ran systemctl status icecast2.service and it returned with:

● icecast2.service - LSB: Icecast2 streaming media server
   Loaded: loaded (/etc/init.d/icecast2; generated)
   Active: active (running) since Tue 2019-09-03 12:38:28 PDT; 15min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 3824 ExecStop=/etc/init.d/icecast2 stop (code=exited, status=0/SUCCESS)
  Process: 5648 ExecReload=/etc/init.d/icecast2 reload (code=exited, status=0/SUCCESS)
  Process: 3829 ExecStart=/etc/init.d/icecast2 start (code=exited, status=0/SUCCESS)
    Tasks: 4 (limit: 9479)
   CGroup: /system.slice/icecast2.service
           └─3848 /usr/bin/icecast2 -b -c /etc/icecast2/icecast.xml

Sep 03 12:38:28 myhostname icecast2[3829]:  * Starting streaming media server icecast2
Sep 03 12:38:28 myhostname icecast2[3829]:    ...done.
Sep 03 12:38:28 myhostname icecast2[3829]: [2019-09-03  12:38:28] WARN CONFIG/_parse_root Warning, <hostname> not configured, using default value "localhost". This will cause problems, e.g. with YP directory listings.
Sep 03 12:38:28 myhostname icecast2[3829]: [2019-09-03  12:38:28] WARN CONFIG/_parse_root Warning, <location> not configured, using default value "Earth".
Sep 03 12:38:28 myhostname icecast2[3829]: [2019-09-03  12:38:28] WARN CONFIG/_parse_root Warning, <admin> contact not configured, using default value "icemaster@localhost".
Sep 03 12:38:28 myhostname systemd[1]: Started LSB: Icecast2 streaming media server.
Sep 03 12:53:57 myhostname systemd[1]: Reloading LSB: Icecast2 streaming media server.
Sep 03 12:53:57 myhostname icecast2[5648]:  * Reloading streaming media server configuration icecast2
Sep 03 12:53:57 myhostname icecast2[5648]:    ...done.
Sep 03 12:53:57 myhostname systemd[1]: Reloaded LSB: Icecast2 streaming media server.

and I retried journalctl -xe which returned:

Sep 03 12:55:38 myhostname airtime-liquidsoap[4016]: 2019/09/03 12:55:38 [_a:3] Connecting mount _a for source@localhost...
Sep 03 12:55:38 myhostname airtime-liquidsoap[4016]: 2019/09/03 12:55:38 [_a:2] Connection failed: 401, Authentication Required (HTTP/1.0)
Sep 03 12:55:38 myhostname airtime-liquidsoap[4016]: 2019/09/03 12:55:38 [lang:3] timeout --signal=KILL 45 pyponotify --error='401, Authentication Required (HTTP/1.0)' --stream-id=1 --time=1567539543.07 &
Sep 03 12:55:38 myhostname airtime-liquidsoap[4016]: 2019/09/03 12:55:38 [_a:3] Will try again in 5.00 sec.
Sep 03 12:55:38 myhostname airtime-liquidsoap[4016]: 2019-09-03 12:55:38,482 [pyponotify] [INFO ]  #################################################
Sep 03 12:55:38 myhostname airtime-liquidsoap[4016]: 2019-09-03 12:55:38,482 [pyponotify] [INFO ]  # Calling server to update liquidsoap status    #
Sep 03 12:55:38 myhostname airtime-liquidsoap[4016]: 2019-09-03 12:55:38,482 [pyponotify] [INFO ]  #################################################
Sep 03 12:55:38 myhostname airtime-liquidsoap[4016]: 2019-09-03 12:55:38,483 [pyponotify] [INFO ]  msg = 401, Authentication Required (HTTP/1.0)
Sep 03 12:55:38 myhostname airtime-liquidsoap[4016]: 2019-09-03 12:55:38,535 [pyponotify] [INFO ]  Response: null
Sep 03 12:55:38 myhostname airtime-liquidsoap[4016]: #########################################
Sep 03 12:55:38 myhostname airtime-liquidsoap[4016]: #           *** pypo  ***               #
Sep 03 12:55:38 myhostname airtime-liquidsoap[4016]: #     pypo notification gateway         #
Sep 03 12:55:38 myhostname airtime-liquidsoap[4016]: #########################################

Look at that… [_a:3] Connecting mount _a for source@localhost..., did a quick web search, and it returned a single link which points to a LibreTime GitHub thread from 2017

I’m reading through that thread now. Not sure what might be relevant or what has been solved. Did I find a new bug? What exactly is it trying to connect to that needs authentication? And why would it have trouble connecting to it right out of the box?

Another thought occurred to me:

In the video LibreTime Tutorial : How to administer the stream settings page at 7:02 minutes in, the instructor says the following:

For the purpose of this tutorial we’re going to assume that your LibreTime instance is using the built-in LibreTime Icecast.

Does LibreTime install its own instance of Icecast2, separate from the normal installation which can be gotten through apt-get? And if there is, where can it be located? Or was that just a bad choice of words on the instructor’s part?

Edit/note: I ran find / -type f -name "icecast.xml" to see if any additional instances of the config file were lingering around and could find nothing, so I’m going to assume there is only one instance of Icecast installed on my machine.

Okay… I figured out what was wrong. LibreTime is connecting to the server. This might make you all laugh. … okay, more like it will make you all laugh.

I was putting the relay password into the source password area. :scream:

The way I figured it out is by noticing the wording…

sources

From there, I deduced that there are two sources available, and I had a hunch that maybe Show Source was asking for, what in Icecast is simply called, “source.” I clicked Save, and voila, it worked.

If this was in the documentation, I was not able to locate it. :slight_smile:

addl-options

Perhaps we may want to make the wording more clear? Something like…

Source Username : __________________________

Source Password : __________________________

That could alleviate any confusion for newbies in the future. Like I said! It’s laughable, but still, it was an honest mistake!

1 Like

Glad you found the answer. Might sound simple to some, but possible better wording on the labels might be a good idea.

1 Like

Yeah, we need to improve the whole custom password setup for Icecast - there has been an open issue for a long time - https://github.com/LibreTime/libretime/issues/86 - basically the install script should ask for a icecast password and then reconfigure the default stream to use that. What currently happens with requiring a custom stream is confusing. Feel free to open an issue or PR on github to make any specific changes you think would improve it as you noted above.

Hello, good day to everyone …
Mr. @robbt I appreciate the enormous effort for the improvements in this open source software and your titanic journey to respond to every request that mortal or limited knowledge users are.

I attach to this topic Unable to connect to streaming server 401 … "in vdd I don’t know if it’s from icecast2 server or libretime, he can get enough information but not see the light of day, even the monitoring by github.

I would not want to add one more line to the tiger, but if it were kind and possible to know the secret recipe to reactivate my live transmissions, since we are a community radio and that by COVID-19 issues we provide warnings to several communities that are already following us as an informative medium (for local sales, COVID reports, etc.).

The description of my current position is:
Virtual Machine
Server 2CPU
RAM 4GB
DD: 1TB
S.O. Ubuntu 18.04.03 server 64bits
Icecast2 2.4.3
LibreTime 3 alpha 8

He modified passwords in ices.xml and does not give me access to my clients for live ones (I use SAM Broadcaster and RadioBoss in 128mb mp3 format).

Without further ado for the moment, I look forward to your valuable comments.

Best regards.
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

(spanish)
Hola buen día a todos…
Sr. @robbt agradezco el enorme esfuerzo por las mejoras a este software opensource y su titanica travesia para responder ante cada petición que los usuarios mortales o de limitados conocimientos somos.

Me anexo a este tema No se puede conectar servidor de transmisión 401…" en vdd no se si sea de icecast2 server o de libretime, he leído bastante información pero no lo ver la luz del día, incluso el seguimiento por github.

no quisiera sumar una raya mas al tigre, pero si fuera amable y posible concoer la receta secreta para poder reactivar mis transmisiones en vivo, ya que somos una radio comunitaria y que por temas de COVID-19 brindamos avisos a varias comunidades que ya nos siguen como medio informativo (para ventas en las localidades, reportes de COVID, etc).

La descripción de mi actual posicion es:
Equipo Servidor 2CPU
RAM 4GB
DD: 1TB
S.O. Ubuntu 18.04.03 server 64bits
Icecast2 2.4.3
LibreTime 3 alpha 8

He modificado contraseñas en ices.xml y no me da acceso a mis clientes para los en vivo (utilizo SAM Broadcaster y RadioBoss en formato mp3 de 128mb).

Sin mas pro el momento, quedo pendiente de sus valiosos comentarios.

Saludos Cordiales.

Hola,
I am not 100% where the problem is based upon the description.
If the problem is that LibreTime can not connect to Icecast then you need to put the passwords from icecast2.xml into Settings -> Stream so that LibreTime can connect to it. Verify you have the right passwords at the http://hostname:8000 and see if you can login to Administration.

If that is working and the problem is that your DJs can’t broadcast live then you need to verify the master login under settings is configured. DJs do not need your icecast2.xml password to broadcast live. There is the master login & the show login. The show login users the DJ login from LibreTime and requires that the show be checked User LibreTime Authentication under “Live Stream Input” and that the username of the DJ is checked under the Who tab below.

I hope that helps you get online. Was your broadcast working and then it quit or is this something that you haven’t been able to get working at all. If you changed icecast2.xml then see if icecast is working.

Later,
Robb

Hello good morning @robbt thanks for your reply and I apologize for the delay in my reply.

I acknowledge that I have analyzed my problem more, so I share it here.
1) in effect since version 2.4.0 of icecast the security issue has changed and even if I put the mount points in the icescast.xml file (/etc/icecast2/icecast.xml) I will not be able to take to make the connection of my streaming software (winamp, SAM, RadioBoss, etc), that is, the icescast service after version 2.4.2 (specifically) and ano will stream by connecting us to the mount points we customize. (this without the intervention of LibreTime).
2) incorporating the LibreTime software, the same will happen as in the previous point, however when installing from scratch or specifically liquidsoap (/etc/airtime/liquidsoap.cfg) it generates the mount points of the same LbreTime and makes the generated password compatible with icecas.xml with the latter (it only generates two mount points / _a and / _b).
2.1) now yes, when connecting from my live streaming console I do it first to LibreTime, at its Master and Show mount points (these can be customized), and this in turn connects to the icecast server. This is phenomenal (I don’t know for sure if it is the right thing), since it allows me to change or switch the content of LIbreTime vs the live ones.
3) What I have to conclude and highlight is the importance of identifying the password shared by both files (icecast.xml and liquidsoap.cfg), as he described in his extensive career in search of their solution; also know how to identify who and what the “admin”, “source” and “relay” do.

Personally, my way of working or the implementation of this tool changed a lot, since it had independent icecast and LibreTime services … but adapting to any conflict or change, we can get used to.

Without further ado for the moment, I appreciate your commitment.

Best regards.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
(Spañol)
Hola buen día @robbt gracias por su respuesta y ofrezco disculpas por la demora de mi respuesta.

Hago de su conocimiento que he analizado mas mi problema por lo que comparto aquí.
1) en efecto desde la versión 2.4.0 de icecast el tema de seguridad ha cambiado y aun que coloque los puntos de montaje en el archivo de icescast.xml (/etc/icecast2/icecast.xml) no podre tomar para hacer la conexión de mi software de transmisión (winamp, SAM, RadioBoss, etc), es decir, el servicio de icescast después de la versión 2.4.2 (específicamente) y ano transmitirá conectándonos a los puntos de montaje que personalicemos. (esto sin la intervención de LibreTime).
2) incorporando el software de LibreTime, sucedera lo mismo que en el punto anterior, sin embargo al instalar desde cero o específicamente liquidsoap (/etc/airtime/liquidsoap.cfg) genera los puntos de montaje del mismo LbreTime y hace compatible la contraseña generada con icecas.xml con estos ultimos (solo genera dos puntos de montaje /_a y /_b).
2.1) ahora si, al conectarme desde mi consola de transmision en vivo lo hago primero hacia LibreTime, en sus puntos de montaje de Master y Show (estos si se pueden personalizar), y este a su vez se conecta al servidor icecast. Esto es fenomenal (no se a ciencia cierta si es lo correcto), ya que me permite el cambio o switcheo del contenido de LIbreTime vs los en vivo.
3) Lo que tengo que concluir y resaltar es la importancia de identificar la contraseña que comparten ambos archivos (icecast.xml y liquidsoap.cfg), como bien describio en su amplia trayectoria en busca de su solución; ademas saber identificar quien y que hace el “admin”, el “source” y el “relay”.

.En lo personal, cambio mucho mi manera de trabajar o la implementación de esta herramienta, ya que tenia servicios independientes de icecast y de LibreTime… pero la adaptación a cualquier conflicto o cambio, nos podemos acostumbrar.

Sin mas por el momento, agradezco su compromiso.

Saludos Cordiales.