epoupon / lms

Lightweight Music Server. Access your self-hosted music using a web interface.
http://lms-demo.poupon.dev
GNU General Public License v3.0
1.07k stars 59 forks source link

"Http::ResponseContinuation: WebWriteEvent::Error" on podman install #355

Closed eddyizm closed 10 months ago

eddyizm commented 10 months ago

I moved my install from an old linux vm to a windows WSL2 install using podman. Seems to be up and running decently in the browser - I even put a netsh proxy to access on my lan which also seems to work from the browser on other machines.

However I am not having any luck connecting any mobile apps (android) - Ultrasonic which was working previously and I tried Subtracks (cause it looked pretty simple and neat) loads up the thumbnails but fails to play anything. I suspect it is a networking issue but wanted to see if I could be pointed in the right place to verify/validate because I don't recall getting that write error in the logs previously.

[2023-Oct-31 21:51:53.829] 1 - [error] - 140394581060408 [API_SUBSONIC] Error while processing request '/getCoverArt', params = [{c=subtracks}, {id=-1}, {p=*REDACTED*}, {size=256}, {u=<MY USER>}, {v=1.13.0}, ], code = 0, msg = 'Parameter 'id': bad value'
10.0.2.100 - - [2023-Oct-31 21:51:54.174] "HEAD /rest/getCoverArt.view?<REMOVED_USER/PASS>1.13.0&c=subtracks&id=al-2638&size=256 HTTP/1.1" 200 5681
[mp3 @ 0x7fb028e2c980] Estimating duration from bitrate, this may be inaccurate
[mp3 @ 0x7fb028e2c980] Could not find codec parameters for stream 1 (Video: mjpeg, none): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[2023-Oct-31 21:51:54.550] 1 - [error] "Http::ResponseContinuation: WebWriteEvent::Error"
epoupon commented 10 months ago

Can you try with debug logs? Edit lms.conf and remove the -debug stuff in the log-config field.

eddyizm commented 10 months ago

I noticed that the docker command mounts the music directory as read only -> -v <path_to_music>:/music:ro \ yet the log has a line where it is trying to write the transcode to that directory which promptly seems to kill/crash the process.

hopefully this log is not too much info but I added it at the tail end of the request. Testing this with sub tracks lms_debug.log if you need more logs or details, please let me know.

epoupon commented 10 months ago

I suspect ffmpeg not having the requested codec to transcode. What if you isolate the ffmpeg command LMS generates and reproduce in a terminal? (Output to a file instead of in a pipe)

eddyizm commented 10 months ago

in the container I ran ffmpeg -i '/music/C/Chuck Berry/Chuck Berry - The Great Twenty-Eight/01 - Maybellene - Chuck Berry.flac' -vn -b:a 192000 -acodec libopus -f ogg home/testfile.ogg

which I believe includes all the relevant args

[2023-Nov-01 04:33:10.484] 1 - [info] - 140652033907512 [TRANSCODE] [4] - Transcoding file '/music/C/Chuck Berry/Chuck Berry - The Great Twenty-Eight/01 - Maybellene - Chuck Berry.flac'
[2023-Nov-01 04:33:10.484] 1 - [debug] - 140652033907512 [TRANSCODE] [4] - Dumping args (16)
[2023-Nov-01 04:33:10.484] 1 - [debug] - 140652033907512 [TRANSCODE] [4] - Arg = '/usr/bin/ffmpeg'
[2023-Nov-01 04:33:10.484] 1 - [debug] - 140652033907512 [TRANSCODE] [4] - Arg = '-loglevel'
[2023-Nov-01 04:33:10.484] 1 - [debug] - 140652033907512 [TRANSCODE] [4] - Arg = 'quiet'
[2023-Nov-01 04:33:10.484] 1 - [debug] - 140652033907512 [TRANSCODE] [4] - Arg = '-nostdin'
[2023-Nov-01 04:33:10.484] 1 - [debug] - 140652033907512 [TRANSCODE] [4] - Arg = '-ss'
[2023-Nov-01 04:33:10.484] 1 - [debug] - 140652033907512 [TRANSCODE] [4] - Arg = '0.000'
[2023-Nov-01 04:33:10.484] 1 - [debug] - 140652033907512 [TRANSCODE] [4] - Arg = '-i'
[2023-Nov-01 04:33:10.484] 1 - [debug] - 140652033907512 [TRANSCODE] [4] - Arg = '/music/C/Chuck Berry/Chuck Berry - The Great Twenty-Eight/01 - Maybellene - Chuck Berry.flac'
[2023-Nov-01 04:33:10.484] 1 - [debug] - 140652033907512 [TRANSCODE] [4] - Arg = '-vn'
[2023-Nov-01 04:33:10.484] 1 - [debug] - 140652033907512 [TRANSCODE] [4] - Arg = '-b:a'
[2023-Nov-01 04:33:10.484] 1 - [debug] - 140652033907512 [TRANSCODE] [4] - Arg = '192000'
[2023-Nov-01 04:33:10.484] 1 - [debug] - 140652033907512 [TRANSCODE] [4] - Arg = '-acodec'
[2023-Nov-01 04:33:10.484] 1 - [debug] - 140652033907512 [TRANSCODE] [4] - Arg = 'libopus'
[2023-Nov-01 04:33:10.484] 1 - [debug] - 140652033907512 [TRANSCODE] [4] - Arg = '-f'
[2023-Nov-01 04:33:10.484] 1 - [debug] - 140652033907512 [TRANSCODE] [4] - Arg = 'ogg'
[2023-Nov-01 04:33:10.484] 1 - [debug] - 140652033907512 [TRANSCODE] [4] - Arg = 'pipe:1'

output the file as expected to the home directory

/ # ls -ahl home/
total 3M
drwxr-xr-x    1 root     root        4.0K Nov  1 22:34 .
dr-xr-xr-x    1 root     root        4.0K Oct 29 23:06 ..
-rw-r--r--    1 root     root        3.4M Nov  1 22:34 testfile.ogg  

EDIT I realized I ran this command when i logged in as root. When logging in as the user assigned, 1000 I ended up getting a permission denied output. I am starting to recall having permission issues when setting up this container a couple years ago.

eddyizm commented 10 months ago

I set debug and wrote the access and app logs out separately - I am curious as to why both mobile apps (was using ultrasonic successfully up until my recent move) fail and the app still works nicely through the browser. I attached both, I don't see any explicit errors and the responses are mostly 200 but ultrasonic especially throws a ton of errors, subtracks just kinda wants to work, throws one error and doesn't do much in return. Might be an issue with those apps possibly? access.log lms.log Still suspect is permissions but not sure what else to change?

epoupon commented 10 months ago

Tried to reproduce but subtracks 2.0.0-alpha3 does not take into account the "force plaintext password" field, It keeps trying to auth using salt method... Maybe @austinried can tell about this.

From v3.42.0, I changed the way the default transcode format is handled. It is unfortunately not possible to disable transcoding. What if you try to transcode in MP3 instead of opus? Likely the web interface works well because you use the raw files and not the transcoding (you can force transcoding on the UI and check this)

Can you run the ffmpeg command again? Something as close as possible to the LMS's generated command: /usr/bin/ffmpeg -nostdin -ss 0.000 -i "/music/H/The.HelioCentrics/Telemetric.Sounds/01 Telemetric Sounds-The Heliocentrics.mp3" -vn -b:a 320000 -acodec libopus -f ogg pipe:1> /tmp/output.opus

eddyizm commented 10 months ago

It seems like the login is ok, eg I get a list of artists/albums/tracks and artwork in subtracks, ultrasonic is another story though. Here's the output from the command you mentioned"

What if you try to transcode in MP3 instead of opus? Want me to test this in the web gui or in the command directly? That seemed to produce the same results.

I turned off the force plaintext password in ultrasonic and this tidbit came out

code = 41, msg = 'Token authentication not supported for LDAP users.'

could this be a windows problem?

/ # /usr/bin/ffmpeg -nostdin -ss 0.000 -i "/music/H/The.HelioCentrics/Telemetric.Sounds/01 Telemetric
Sounds-The Heliocentrics.mp3" -vn -b:a 320000 -acodec libopus -f ogg pipe:1> /tmp/output.opus
ffmpeg version 4.3.5 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 12.2.1 (Alpine 12.2.1_git20220924-r10) 20220924
  configuration: --prefix=/tmp/install --disable-autodetect --disable-debug --disable-doc --disable-ffplay --disable-ffprobe --disable-openssl --disable-postproc --disable-pixelutils --disable-network --enable-shared --disable-static --enable-gpl --enable-small --enable-version3 --enable-nonfree --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libvorbis --disable-everything --enable-decoder='aac*,ac3*,alac,als,flac,mp3*,libopus,pcm*,libvorbis,wavpack,wma*,libopenjpg,png' --enable-encoder='libmp3lame,libopus,libvorbis' --enable-demuxer='aac,aiff,asf,flac,ipod,ogg,matroska,mov,mp3,mp4,wav,wv,webm' --enable-muxer='ogg,matroska,mp3,webm' --enable-protocol='file,pipe' --enable-filter=aresample --extra-libs=-ldl
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
[mp3 @ 0x7fa265d0c0c0] Could not find codec parameters for stream 1 (Video: mjpeg, none): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mp3, from '/music/H/The.HelioCentrics/Telemetric.Sounds/01 Telemetric Sounds-The Heliocentrics.mp3':
  Metadata:
    title           : Telemetric Sounds
    artist          : The Heliocentrics
    track           : 1/7
    album           : Telemetric Sounds
    disc            : 1/1
    MusicBrainz Release Track Id: 5d315ca1-eec4-4d6f-98fa-6afaee59f1a1
    TORY            : 2020
    purl            : https://theheliocentrics.bandcamp.com/track/telemetric-sounds
    SCRIPT          : Latn
    TMED            : Digital Media
    encoder         : Lavf58.29.100
    publisher       : Madlib Invazion
    album_artist    : The Heliocentrics
    TSO2            : Heliocentrics, The
    artist-sort     : Heliocentrics, The
    originalyear    : 2020
    ARTISTS         : The Heliocentrics
    MusicBrainz Album Type: album
    MusicBrainz Album Status: official
    MusicBrainz Album Release Country: XW
    MusicBrainz Album Id: 516f8a90-385b-405e-a7a3-c6556df2f42a
    MusicBrainz Artist Id: f221328f-bc6b-40f1-a750-ce11a1321489
    MusicBrainz Album Artist Id: f221328f-bc6b-40f1-a750-ce11a1321489
    MusicBrainz Release Group Id: 28696fd5-601e-40e0-8e4b-ed3257cc7bae
    date            : 2020-08-07
  Duration: 00:13:30.97, start: 0.025056, bitrate: 130 kb/s
    Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 128 kb/s
    Metadata:
      encoder         : LAME3.99r
    Side data:
      replaygain: track gain - -3.700000, track peak - unknown, album gain - unknown, album peak - unknown,
    Stream #0:1: Video: mjpeg, none, 90k tbr, 90k tbn, 90k tbc (attached pic)
    Metadata:
      comment         : Cover (front)
Stream mapping:
  Stream #0:0 -> #0:0 (mp3 (mp3float) -> opus (libopus))
Output #0, ogg, to 'pipe:1':
  Metadata:
    title           : Telemetric Sounds
    artist          : The Heliocentrics
    track           : 1/7
    album           : Telemetric Sounds
    disc            : 1/1
    MusicBrainz Release Track Id: 5d315ca1-eec4-4d6f-98fa-6afaee59f1a1
    TORY            : 2020
    purl            : https://theheliocentrics.bandcamp.com/track/telemetric-sounds
    SCRIPT          : Latn
    TMED            : Digital Media
    date            : 2020-08-07
    publisher       : Madlib Invazion
    album_artist    : The Heliocentrics
    TSO2            : Heliocentrics, The
    artist-sort     : Heliocentrics, The
    originalyear    : 2020
    ARTISTS         : The Heliocentrics
    MusicBrainz Album Type: album
    MusicBrainz Album Status: official
    MusicBrainz Album Release Country: XW
    MusicBrainz Album Id: 516f8a90-385b-405e-a7a3-c6556df2f42a
    MusicBrainz Artist Id: f221328f-bc6b-40f1-a750-ce11a1321489
    MusicBrainz Album Artist Id: f221328f-bc6b-40f1-a750-ce11a1321489
    MusicBrainz Release Group Id: 28696fd5-601e-40e0-8e4b-ed3257cc7bae
    encoder         : Lavf58.45.100
    Stream #0:0: Audio: opus (libopus), 48000 Hz, stereo, flt, 320 kb/s
    Metadata:
      encoder         : Lavc58.91.100 libopus
      title           : Telemetric Sounds
      artist          : The Heliocentrics
      TRACKNUMBER     : 1/7
      album           : Telemetric Sounds
      DISCNUMBER      : 1/1
      MusicBrainz Release Track Id: 5d315ca1-eec4-4d6f-98fa-6afaee59f1a1
      TORY            : 2020
      purl            : https://theheliocentrics.bandcamp.com/track/telemetric-sounds
      SCRIPT          : Latn
      TMED            : Digital Media
      date            : 2020-08-07
      publisher       : Madlib Invazion
      ALBUMARTIST     : The Heliocentrics
      TSO2            : Heliocentrics, The
      artist-sort     : Heliocentrics, The
      originalyear    : 2020
      ARTISTS         : The Heliocentrics
      MusicBrainz Album Type: album
      MusicBrainz Album Status: official
      MusicBrainz Album Release Country: XW
      MusicBrainz Album Id: 516f8a90-385b-405e-a7a3-c6556df2f42a
      MusicBrainz Artist Id: f221328f-bc6b-40f1-a750-ce11a1321489
      MusicBrainz Album Artist Id: f221328f-bc6b-40f1-a750-ce11a1321489
      MusicBrainz Release Group Id: 28696fd5-601e-40e0-8e4b-ed3257cc7bae
    Side data:
      replaygain: track gain - -3.700000, track peak - unknown, album gain - unknown, album peak - unknown,
size=   31973kB time=00:13:30.93 bitrate= 323.0kbits/s speed=68.2x
video:0kB audio:31805kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.530144%
eddyizm commented 10 months ago

ok switching the server to mp3 fixed a portion of it, I am able to play music through the app, specifically subtracks and subsonic. ultrasonic is still a bust. Subtracks gets the furthest, eg artwork/albums/artist info however that is the one of the three that does not allow offline/download feature which is the point of these apps, otherwise I kinda like the web ui lol

epoupon commented 10 months ago

I turned off the force plaintext password in ultrasonic and this tidbit came out

code = 41, msg = 'Token authentication not supported for LDAP users.'

could this be a windows problem?

Well it is an error to tell the client the salt/hash authentication method is not supported. In the original Subsonic API, it is legit error as the authentication request may be forwarded. So not windows related :)

There is definitively something weird in the logs, will try to add some debug logs in the next release

eddyizm commented 10 months ago

sounds good. I will close this issue as I got it working remotely now even if the apps have their own bugs. On the bright side, I was able to update and install it on a WSL2 instance and podman without even having docker desktop installed on Windows. And it has been really stable. Thanks of your help and patience.