IrosTheBeggar / mStream

The easiest music streaming server available

Home Page:http://mstream.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Errors when using remote file system (fuse)

pandiloko opened this issue · comments

Thanks for this fantastic project. I have a just a couple of minor issues that I could live with, but I decided to raise a ticket in case someone has any suggestions to fix them.

Mstream v5.11.4 running on docker with a remote file system:

services:
  mstream:
    image: lscr.io/linuxserver/mstream:latest
    container_name: mstream
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
    volumes:
      - $PWD/data/config:/config
      - $PWD/data/music/:/music
    restart: unless-stopped
    networks:
      - default
      - traefik
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.${PROJECT}.rule=Host(`${DOMAIN}`)"
      - "traefik.http.routers.${PROJECT}.tls=true"
      - "traefik.http.services.${PROJECT}.loadbalancer.server.port=${PORT}"
      - "traefik.http.middlewares.${PROJECT}.headers.customrequestheaders.X-Forwarded-Proto=https"

networks:
  default:
    internal: true
  traefik:
    external: true

The music directory is a pcloud.com storage mounted with rclone. So a fuse file system.

The problem I see is that some files throw an error while scanning:

mstream  | 2024-04-07T18:24:00.236Z info: Successfully cleared shared playlists
mstream  | 2024-04-07T18:25:00.379Z info: File scan started on /music
mstream  | 2024-04-07T18:58:22.136Z error: File scan error: Warning: failed to add file /music/folder/artist_name/album/tracknumber-title.mp3 to database: socket hang up 
mstream  | 2024-04-07T19:08:09.802Z info: Metadata DB Saved
mstream  | 2024-04-07T19:08:09.809Z info: File scan completed with code 0

Sometimes it's just one file, sometimes more. No changes on the file system whatsoever: no new files or modifications of any kind.

Also, sometimes the "play now" list just jumps to the next song in the middle of the previous one and the "failed" song turns red on the list. When I click on the failed song it seems to work perfectly from start to finish, but it stays red until I reload the page.

Is there some kind of timeout or setting that I can modify to avoid these problems?

I looked into rclone cache but I really do not have much storage available since this is a VPS server.

Thanks again for this and for any tips you or someone may have.

I've watched the access logs and apparently there is an HTTP-499 error every time the song is skipped and marked red. This is a "client side timeout". AFAIK this means mstream web UI is closing the connection, giving up on it because it took too long. Indeed, all the 499 errors are requests which took more than 2000ms.

Is there a setting to increase the web UI timeout?

I enabled temporarily the rclone cache:

rclone mount --cache-dir /var/pcloud-cache --vfs-cache-mode full --vfs-cache-max-age 30d --vfs-cache-max-size 5G --log-file /var/log/rclone.log --log-level INFO --daemon --read-only --allow-other pcloud:/music/ /opt/docker-mstream/data/music/

But that didn't help at all. Finally, I remembered I had installed a geoblock plugin in Traefik recently. Upon closer inspection of access logs for other subdomains, I observed many slow requests (more than 2-3 seconds). I commented out the plugin from the config file and everything went back to normal.

Sorry for the noise.