docker icon indicating copy to clipboard operation
docker copied to clipboard

Music not playing

Open vinushkah opened this issue 4 years ago • 13 comments

I have completed the setup and ran php artisan koel:init before running php artisan koel:sync and once the sync had completed, when I clicked on a song it would just hang when loading.

I have tested this in both Firefox and Chrome (vanilla Chrome) and get the same issue. See Console errors from Chrome below

image

In the Docker container logs I found "xsendfile: unable to find file"

vinushkah avatar Apr 21 '20 13:04 vinushkah

That sounds like a file permission problem. Did you put your music in /music ? What is the result of docker exec koel ls -la /music ? (assuming your container is named "koel")

Hyzual avatar Apr 21 '20 16:04 Hyzual

image.png

docker exec opt_koel_1 ls -la /music image.png

9zg avatar Apr 24 '20 03:04 9zg

Thanks for sharing, I'll see if I can reproduce it

Hyzual avatar Apr 24 '20 07:04 Hyzual

I reproduced it using chromium 80 and the filename you used. On Firefox it doesn't play either but it does not log anything in the console. It looks like it is related to the filename, if I change the filename to latin characters only (no katakana) I can successfully play FLAC files. It needs to be resolved in the koel repository directly. In this repository I'm afraid I can't fix it. I'll log an issue.

Hyzual avatar Apr 25 '20 12:04 Hyzual

Issue already exists: koel/koel#561

Hyzual avatar Apr 25 '20 12:04 Hyzual

Thank you! This could be a bug of koel.

9zg avatar Apr 25 '20 12:04 9zg

Installation behind Traeifk

To reproduce sample docker-compose.yml

version: '3.7'
services:
  koel:
    image: hyzual/koel
    container_name: koel
    networks:
      - koel-net
      - traefik
    depends_on:
      - koeldb
      - proxy
    restart: unless-stopped
    volumes:
      - /var/koel/Music:/music
      - /var/koel/Covers:/var/www/html/public/img/covers:rw
      - /home/docker/config/koel/.env:/var/www/html/.env:rw
    environment:
      - FORCE_HTTPS=true #Essential or we have an error mixed:content
      - DB_CONNECTION=mysql
      - DB_HOST=koeldb
      - DB_USERNAME=koel
      - DB_PASSWORD=XXXXX
      - DB_DATABASE=koel
    labels:
      - "traefik.http.routers.koel.rule=Host(`k.<DOMAIN>`)"
      - "traefik.http.routers.koel.tls=true"
      - "traefik.http.routers.koel.tls.certresolver=letsencrypt"
      - "traefik.http.routers.koel.entrypoints=websecure"
      - "traefik.http.services.koel.loadbalancer.server.port=80"
      - "traefik.http.routers.koel.service=koel"
      - "traefik.docker.network=traefik"
      - "traefik.http.routers.koel-http.rule=Host(`k.<DOMAIN>`)"
      - "traefik.http.routers.koel-http.middlewares=https-redirect@file"
      - "traefik.enable=true"

  koeldb:
    image: mysql/mysql-server:5.7
    container_name: koeldb
    restart: unless-stopped
    networks:
      - koel-net
    volumes:
      - /home/docker/vol/koeldb:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=XXXXX
      - MYSQL_DATABASE=koel
      - MYSQL_USER=koel
      - MYSQL_PASSWORD=XXXXX
    labels:
      - "traefik.enable=false"

networks:
  koel-net:
    name: koel-net
    driver: bridge
    ipam:
      driver: default
      config:
        - subnet: 172.XX.XX.XX/28

Feedback:

  • Need to force Https (Traefik with Https) (see environment) Bug: (The same)
  • Folders and File names can not contain special characters

'Benjamin Tissot\01 First Song.mp3' filename path /var/koel/Music/Benjamin\ Tissot/01\ First\ Song.mp3

  • Covers are not generated even with correct file names
  • Music doesn't play (error 404) same issue ?

diyfr avatar May 03 '20 07:05 diyfr

Hi @diyfr, your docker-compose configuration looks solid. As for the music not playing, I don't know why it would not play. Files and folders look ok. I use this image with an Nginx reverse-proxy and mp3 files play fine, covers are generated.

I'm not familiar enough with Traefik to help you. Maybe it's a configuration problem ? Could you try publishing koel to a port (like 8080) directly and see if it works that way ? Also, music files needs to be readable by the www-data user. Maybe it is a filesystem permission problem ?

Hyzual avatar May 05 '20 11:05 Hyzual

@Hyzual I had this issue when getting the docker-compose with Koel running.

I solved it by moving my music files into /media. The Apache permissions aren't properly set up to include the koel default of /music. Is this something that can be fixed in the source?

andrewDoing avatar May 08 '20 21:05 andrewDoing

Hi @andrewDoing, you're right, I forgot to update the Apache permissions. Thanks for posting it here, I'll push a fix !

Hyzual avatar May 09 '20 12:05 Hyzual

Fix is pushed. Let me know if it works better !

Hyzual avatar May 09 '20 13:05 Hyzual

I'm closing this since I got no response, I'll assume the fix did the trick :)

Hyzual avatar Jun 02 '20 16:06 Hyzual

I hadn't had the chance to test the changes on my machine. Perhaps it should be tested before closing the issue?

andrewDoing avatar Jun 02 '20 20:06 andrewDoing