Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

script crash if icecast returns 401 unauthorized #3635

Closed
Russsgithub opened this issue Jan 14, 2024 · 1 comment
Closed

script crash if icecast returns 401 unauthorized #3635

Russsgithub opened this issue Jan 14, 2024 · 1 comment

Comments

@Russsgithub
Copy link

Describe the bug
I have a script that dynamically creates simple streams and sends them to icecast.

The icecast parts have on_error with points to a function that logs there has been an error and returns -1. .

If icecasts returns 401 unauthorized I get the error log from the on_error function and

arpstreaming-liquidsoap-1  | 2024/01/14 13:30:18 [91782726_3:3] Connecting mount 91782726 for source@icecast...
arpstreaming-liquidsoap-1  | 2024/01/14 13:30:18 [91782726_3:2] Connection failed: 401, Authentication Required (HTTP/1.0)
arpstreaming-liquidsoap-1  | 2024/01/14 13:30:18 [lang:3] 401, Authentication Required (HTTP/1.0)
arpstreaming-liquidsoap-1  | 2024/01/14 13:30:18 [lang:3] Error
arpstreaming-liquidsoap-1  | 2024/01/14 13:30:18 [clock.main:2] Source 91782726_3 failed while streaming: 401, Authentication Required (HTTP/1.0)!
arpstreaming-liquidsoap-1  | 2024/01/14 13:30:18 [clock.main:2] Raised at Cry.connect_http in file "src/cry.ml", line 607, characters 60-69
arpstreaming-liquidsoap-1  | 2024/01/14 13:30:18 [clock.main:2] Re-raised at Cry.connect_http in file "src/cry.ml", line 618, characters 4-38
arpstreaming-liquidsoap-1  | 2024/01/14 13:30:18 [clock.main:2] Re-raised at Cry.connect in file "src/cry.ml", line 691, characters 4-38
arpstreaming-liquidsoap-1  | 2024/01/14 13:30:18 [clock.main:2] Called from Icecast2.output#icecast_start in file "src/core/outputs/icecast2.ml", line 594, characters 8-37
arpstreaming-liquidsoap-1  | 2024/01/14 13:30:18 [clock.main:2] Re-raised at Icecast2.output#icecast_start in file "src/core/outputs/icecast2.ml", line 612, characters 13-47
arpstreaming-liquidsoap-1  | 2024/01/14 13:30:18 [clock.main:2] Called from Icecast2.output#send in file "src/core/outputs/icecast2.ml", line 544, characters 12-30
arpstreaming-liquidsoap-1  | 2024/01/14 13:30:18 [clock.main:2] Called from Output.encoded#send_frame.output_chunks.f in file "src/core/outputs/output.ml", line 256, characters 10-24
arpstreaming-liquidsoap-1  | 2024/01/14 13:30:18 [clock.main:2] Called from Output.output#output in file "src/core/outputs/output.ml", line 192, characters 45-70
arpstreaming-liquidsoap-1  | 2024/01/14 13:30:18 [clock.main:2] Called from Clock.MkClock.clock#end_tick.(fun) in file "src/core/clock.ml", line 318, characters 16-24

and the script shutdown gracefully

To Reproduce
A minimal script to reproduce the issue is the most efficient way to have your bug addressed and fixed very quickly!

s = sine(440.)

def error(err)
    log("There has been an error #{err}")
    -1.0
end

output.icecast(
  on_error=error,
  %mp3(bitrate=32, samplerate=22050, stereo=true),
  mount="/test",
  host="localhost", port=8000, password="wrongPassword",
  s)

Expected behavior
All good apart from the script crashing when this happens.

Version details

  • OS: [e.g. Debian, OSX] Ubuntu
  • Version [e.g. 1.3.4] 2.2.x (docker)

Install method
Docker

Common issues
Can't decode or encode in some audio format? Check if you have installed the correct dependencies

@toots
Copy link
Member

toots commented Jan 16, 2024

Thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants