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

[v2.2.0] output.harbor HTTP connection failure #3255

Closed
DigiBC opened this issue Jul 24, 2023 · 7 comments
Closed

[v2.2.0] output.harbor HTTP connection failure #3255

DigiBC opened this issue Jul 24, 2023 · 7 comments

Comments

@DigiBC
Copy link

DigiBC commented Jul 24, 2023

Describe the bug

Attempting to connect to output.harbor in version 2.2.0 results in an HTTP connection failure.
Liquidsoap logs the error as follows:

xxxx/xx/xx xx:xx:xx [harbor:4] New client on port 8110: 127.0.0.1
xxxx/xx/xx xx:xx:xx [harbor:4] Method: GET, uri: /feed_01, protocol: HTTP/1.1
xxxx/xx/xx xx:xx:xx [harbor:4] Header: Host, value: localhost:8110.
xxxx/xx/xx xx:xx:xx [harbor:4] Header: Accept, value: */*.
xxxx/xx/xx xx:xx:xx [harbor:4] Header: Accept-Language, value: de.
xxxx/xx/xx xx:xx:xx [harbor:4] Header: User-Agent, value: VLC/3.0.16 LibVLC/3.0.16.
xxxx/xx/xx xx:xx:xx [harbor:4] Header: Range, value: bytes=0-.
xxxx/xx/xx xx:xx:xx [harbor:4] http/unix GET request on /feed_01.
xxxx/xx/xx xx:xx:xx [harbor:4] Found handler 'GET ^/feed_01$' on port 8110.
xxxx/xx/xx xx:xx:xx [feed_01:4] Serving client 127.0.0.1:41194.
xxxx/xx/xx xx:xx:xx [feed_01:4] Client 127.0.0.1:41194 connected
xxxx/xx/xx xx:xx:xx [harbor:4] New client on port 8110: 127.0.0.1
xxxx/xx/xx xx:xx:xx [harbor:4] Method: GET, uri: /feed_01, protocol: HTTP/1.0
xxxx/xx/xx xx:xx:xx [harbor:4] Header: Host, value: localhost:8110.
xxxx/xx/xx xx:xx:xx [harbor:4] Header: User-Agent, value: VLC/3.0.16 LibVLC/3.0.16.
xxxx/xx/xx xx:xx:xx [harbor:4] Header: Icy-MetaData, value: 1.
xxxx/xx/xx xx:xx:xx [harbor:4] http/unix GET request on /feed_01.
xxxx/xx/xx xx:xx:xx [harbor:4] Found handler 'GET ^/feed_01$' on port 8110.
xxxx/xx/xx xx:xx:xx [feed_01:4] Serving client 127.0.0.1:41196.
xxxx/xx/xx xx:xx:xx [feed_01:4] Client 127.0.0.1:41196 connected
xxxx/xx/xx xx:xx:xx [feed_01:2] Unix error for 127.0.0.1:41196: Unix.Unix_error(Unix.ECONNRESET, "write", "")
xxxx/xx/xx xx:xx:xx [feed_01:4] Raised by primitive operation at Unix.write in file "unix.ml", line 262, characters 7-34
xxxx/xx/xx xx:xx:xx [feed_01:4] Called from Duppy.MakeIo.write.(fun).f in file "src/duppy.ml", line 670, characters 16-29
xxxx/xx/xx xx:xx:xx [feed_01:4] Client 127.0.0.1:41196 disconnected
xxxx/xx/xx xx:xx:xx [feed_01:2] Unix error for 127.0.0.1:41194: Unix.Unix_error(Unix.EPIPE, "write", "")
xxxx/xx/xx xx:xx:xx [feed_01:4] Raised by primitive operation at Unix.write in file "unix.ml", line 262, characters 7-34
xxxx/xx/xx xx:xx:xx [feed_01:4] Called from Duppy.MakeIo.write.(fun).f in file "src/duppy.ml", line 670, characters 16-29
xxxx/xx/xx xx:xx:xx [feed_01:4] Client 127.0.0.1:41194 disconnected

To Reproduce

I use the following code :

output.harbor(%ogg(%flac(samplerate=48000, channels=2, compression=0, bits_per_sample=16)), port=8110, mount="feed_01", source_01)

Audio clients report errors, for example VLC (cvlc):

[xxxxxxxxxxxxxxxx] access stream error: HTTP connection failure
[xxxxxxxxxxxxxxxx] http stream error: invalid HTTP reply '1.0 200 OK'
[xxxxxxxxxxxxxxxx] main input error: Your input can't be opened
[xxxxxxxxxxxxxxxx] main input error: VLC is unable to open the MRL 'http://localhost:8110/feed_01'. Check the log for details.

Or Audacious:

Error playing http://localhost:8110/feed_01:
Could not parse response status line

Everything points to an invalid HTTP reply.

Expected behavior

It worked flawlessly in version 2.1.4 and earlier.

Version details

  • OS: Linux Mint 21.2 (Ubuntu 22.04 'Jammy') amd64
  • Version: Liquidsoap 2.2.0

Install method

Official Debian package liquidsoap_2.2.0-ubuntu-jammy-1_amd64.deb

@vitoyucepi
Copy link
Collaborator

vitoyucepi commented Jul 24, 2023

output.harbor(
  %vorbis,
  sine(),
  mount="/vorbis"
)
# curl -v --http0.9 http://localhost:8000/vorbis
* processing: http://localhost:8000/vorbis
*   Trying 127.0.0.1:8000...
* Connected to localhost (127.0.0.1) port 8000
> GET /vorbis HTTP/1.1
> Host: localhost:8000
> User-Agent: curl/8.2.0
> Accept: */*
> 
1.1 200 OK
Content-type: application/ogg

Warning: Binary output can mess up your terminal. Use "--output -" to tell 
Warning: curl to output it to your terminal anyway, or consider "--output 
Warning: <FILE>" to save to a file.

Probably caused by these lines.

| Handled (meth, groups, handler) ->
let protocol =
match hprotocol with
| `Http_10 -> "1.0"
| `Http_11 -> "1.1"
| _ -> assert false

@DigiBC
Copy link
Author

DigiBC commented Jul 24, 2023

As expected, I get the same results with your simple example:

xxxx/xx/xx xx:xx:xx [harbor:4] New client on port 8000: 127.0.0.1
xxxx/xx/xx xx:xx:xx [harbor:4] Method: GET, uri: /vorbis, protocol: HTTP/1.1
xxxx/xx/xx xx:xx:xx [harbor:4] Header: Host, value: localhost:8000.
xxxx/xx/xx xx:xx:xx [harbor:4] Header: Accept, value: */*.
xxxx/xx/xx xx:xx:xx [harbor:4] Header: Accept-Language, value: de.
xxxx/xx/xx xx:xx:xx [harbor:4] Header: User-Agent, value: VLC/3.0.16 LibVLC/3.0.16.
xxxx/xx/xx xx:xx:xx [harbor:4] Header: Range, value: bytes=0-.
xxxx/xx/xx xx:xx:xx [harbor:4] http/unix GET request on /vorbis.
xxxx/xx/xx xx:xx:xx [harbor:4] Found handler 'GET ^/vorbis$' on port 8000.
xxxx/xx/xx xx:xx:xx [/vorbis:4] Serving client 127.0.0.1:39222.
xxxx/xx/xx xx:xx:xx [/vorbis:4] Client 127.0.0.1:39222 connected
xxxx/xx/xx xx:xx:xx [harbor:4] New client on port 8000: 127.0.0.1
xxxx/xx/xx xx:xx:xx [harbor:4] Method: GET, uri: /vorbis, protocol: HTTP/1.0
xxxx/xx/xx xx:xx:xx [harbor:4] Header: Host, value: localhost:8000.
xxxx/xx/xx xx:xx:xx [harbor:4] Header: User-Agent, value: VLC/3.0.16 LibVLC/3.0.16.
xxxx/xx/xx xx:xx:xx [harbor:4] Header: Icy-MetaData, value: 1.
xxxx/xx/xx xx:xx:xx [harbor:4] http/unix GET request on /vorbis.
xxxx/xx/xx xx:xx:xx [harbor:4] Found handler 'GET ^/vorbis$' on port 8000.
xxxx/xx/xx xx:xx:xx [/vorbis:4] Serving client 127.0.0.1:39230.
xxxx/xx/xx xx:xx:xx [/vorbis:4] Client 127.0.0.1:39230 connected
xxxx/xx/xx xx:xx:xx [/vorbis:2] Unix error for 127.0.0.1:39230: Unix.Unix_error(Unix.ECONNRESET, "write", "")
xxxx/xx/xx xx:xx:xx [/vorbis:4] Raised by primitive operation at Unix.write in file "unix.ml", line 262, characters 7-34
xxxx/xx/xx xx:xx:xx [/vorbis:4] Called from Duppy.MakeIo.write.(fun).f in file "src/duppy.ml", line 670, characters 16-29
xxxx/xx/xx xx:xx:xx [/vorbis:4] Client 127.0.0.1:39230 disconnected
xxxx/xx/xx xx:xx:xx [/vorbis:2] Unix error for 127.0.0.1:39222: Unix.Unix_error(Unix.EPIPE, "write", "")
xxxx/xx/xx xx:xx:xx [/vorbis:4] Raised by primitive operation at Unix.write in file "unix.ml", line 262, characters 7-34
xxxx/xx/xx xx:xx:xx [/vorbis:4] Called from Duppy.MakeIo.write.(fun).f in file "src/duppy.ml", line 670, characters 16-29
xxxx/xx/xx xx:xx:xx [/vorbis:4] Client 127.0.0.1:39222 disconnected

CURL instead of VLC:

xxxx/xx/xx xx:xx:xx [harbor:4] New client on port 8000: 127.0.0.1
xxxx/xx/xx xx:xx:xx [harbor:4] Method: GET, uri: /vorbis, protocol: HTTP/1.1
xxxx/xx/xx xx:xx:xx [harbor:4] Header: Host, value: localhost:8000.
xxxx/xx/xx xx:xx:xx [harbor:4] Header: User-Agent, value: curl/7.81.0.
xxxx/xx/xx xx:xx:xx [harbor:4] Header: Accept, value: */*.
xxxx/xx/xx xx:xx:xx [harbor:4] http/unix GET request on /vorbis.
xxxx/xx/xx xx:xx:xx [harbor:4] Found handler 'GET ^/vorbis$' on port 8000.
xxxx/xx/xx xx:xx:xx [/vorbis:4] Serving client 127.0.0.1:53300.
xxxx/xx/xx xx:xx:xx [/vorbis:4] Client 127.0.0.1:53300 connected
xxxx/xx/xx xx:xx:xx [/vorbis:2] Unix error for 127.0.0.1:53300: Unix.Unix_error(Unix.EPIPE, "write", "")
xxxx/xx/xx xx:xx:xx [/vorbis:4] Raised by primitive operation at Unix.write in file "unix.ml", line 262, characters 7-34
xxxx/xx/xx xx:xx:xx [/vorbis:4] Called from Duppy.MakeIo.write.(fun).f in file "src/duppy.ml", line 670, characters 16-29
xxxx/xx/xx xx:xx:xx [/vorbis:4] Client 127.0.0.1:53300 disconnected

But you seem to have an idea... 😉

@toots
Copy link
Member

toots commented Jul 24, 2023

Hi @DigiBC and thanks for the report. output.harbor has been unattended for a while and is in need of some love. I'll have a pass a this issue shortly. Meanwhile, I'd suggest using a icecast server instead for the moment.

@DigiBC
Copy link
Author

DigiBC commented Jul 24, 2023

Hi @toots,
I'm looking forward to a fix. 👍
For now, I'll stick with version 2.1.4, since an Icecast server is not the best option for my use case.

toots added a commit that referenced this issue Jul 25, 2023
@toots toots closed this as completed in 2d78ebf Jul 25, 2023
@toots
Copy link
Member

toots commented Jul 25, 2023

The HTTP error part should be fixed in main and rolling-release-v2.2.1. Rolling release builds are here: https://github.com/savonet/liquidsoap/actions/runs/5657135124

There might still be more issues with %vorbis but let's treat them as separate issue.

@DigiBC let us know if that fixes your issue!

@DigiBC
Copy link
Author

DigiBC commented Jul 26, 2023

The good news first: The HTTP connection error is indeed fixed! 😃
The log now shows the same results as version 2.1.4 (including that non-relevant Unix disconnect error):

xxxx/xx/xx xx:xx:xx [harbor:4] New client on port 8000: 127.0.0.1
xxxx/xx/xx xx:xx:xx [harbor:4] Method: GET, uri: /stream, protocol: HTTP/1.1
xxxx/xx/xx xx:xx:xx [harbor:4] Header: Host, value: localhost:8000.
xxxx/xx/xx xx:xx:xx [harbor:4] Header: Accept, value: */*.
xxxx/xx/xx xx:xx:xx [harbor:4] Header: Accept-Language, value: de.
xxxx/xx/xx xx:xx:xx [harbor:4] Header: User-Agent, value: VLC/3.0.16 LibVLC/3.0.16.
xxxx/xx/xx xx:xx:xx [harbor:4] Header: Range, value: bytes=0-.
xxxx/xx/xx xx:xx:xx [harbor:4] http/unix GET request on /stream.
xxxx/xx/xx xx:xx:xx [harbor:4] Found handler 'GET ^/stream$' on port 8000.
xxxx/xx/xx xx:xx:xx [/mp3:4] Serving client 127.0.0.1:41494.
xxxx/xx/xx xx:xx:xx [/mp3:4] Client 127.0.0.1:41494 connected
xxxx/xx/xx xx:xx:xx [/mp3:2] Unix error for 127.0.0.1:41494: Unix.Unix_error(Unix.EPIPE, "write", "")
xxxx/xx/xx xx:xx:xx [/mp3:4] Raised by primitive operation at Unix.write in file "unix.ml", line 262, characters 7-34
xxxx/xx/xx xx:xx:xx [/mp3:4] Called from Duppy.MakeIo.write.(fun).f in file "src/duppy.ml", line 670, characters 16-29
xxxx/xx/xx xx:xx:xx [/mp3:4] Client 127.0.0.1:41494 disconnected

While MP3 streaming now works, there seems to be another problem with output.harbor: Using the OGG container results in a garbled stream, which is not visible in the log.
I'll open a new issue for that...

@toots
Copy link
Member

toots commented Jul 26, 2023

The good news first: The HTTP connection error is indeed fixed! 😃 The log now shows the same results as version 2.1.4 (including that non-relevant Unix disconnect error):

xxxx/xx/xx xx:xx:xx [harbor:4] New client on port 8000: 127.0.0.1
xxxx/xx/xx xx:xx:xx [harbor:4] Method: GET, uri: /stream, protocol: HTTP/1.1
xxxx/xx/xx xx:xx:xx [harbor:4] Header: Host, value: localhost:8000.
xxxx/xx/xx xx:xx:xx [harbor:4] Header: Accept, value: */*.
xxxx/xx/xx xx:xx:xx [harbor:4] Header: Accept-Language, value: de.
xxxx/xx/xx xx:xx:xx [harbor:4] Header: User-Agent, value: VLC/3.0.16 LibVLC/3.0.16.
xxxx/xx/xx xx:xx:xx [harbor:4] Header: Range, value: bytes=0-.
xxxx/xx/xx xx:xx:xx [harbor:4] http/unix GET request on /stream.
xxxx/xx/xx xx:xx:xx [harbor:4] Found handler 'GET ^/stream$' on port 8000.
xxxx/xx/xx xx:xx:xx [/mp3:4] Serving client 127.0.0.1:41494.
xxxx/xx/xx xx:xx:xx [/mp3:4] Client 127.0.0.1:41494 connected
xxxx/xx/xx xx:xx:xx [/mp3:2] Unix error for 127.0.0.1:41494: Unix.Unix_error(Unix.EPIPE, "write", "")
xxxx/xx/xx xx:xx:xx [/mp3:4] Raised by primitive operation at Unix.write in file "unix.ml", line 262, characters 7-34
xxxx/xx/xx xx:xx:xx [/mp3:4] Called from Duppy.MakeIo.write.(fun).f in file "src/duppy.ml", line 670, characters 16-29
xxxx/xx/xx xx:xx:xx [/mp3:4] Client 127.0.0.1:41494 disconnected

While MP3 streaming now works, there seems to be another problem with output.harbor: Using the OGG container results in a garbled stream, which is not visible in the log. I'll open a new issue for that...

Thanks. Yeah ogg/vorbis appears broken indeed.

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

3 participants