docker
docker copied to clipboard
Music not playing
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
In the Docker container logs I found "xsendfile: unable to find file"
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")
docker exec opt_koel_1 ls -la /music
Thanks for sharing, I'll see if I can reproduce it
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.
Issue already exists: koel/koel#561
Thank you! This could be a bug of koel.
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 ?
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 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?
Hi @andrewDoing, you're right, I forgot to update the Apache permissions. Thanks for posting it here, I'll push a fix !
Fix is pushed. Let me know if it works better !
I'm closing this since I got no response, I'll assume the fix did the trick :)
I hadn't had the chance to test the changes on my machine. Perhaps it should be tested before closing the issue?