GioF71 / minidlna-docker

Easily run MiniDLNA with Docker
Apache License 2.0
45 stars 1 forks source link

container restarts everytime #19

Closed matthiasklabe closed 9 months ago

matthiasklabe commented 9 months ago

Hi,

If I use your image and deploy the stack in portainer I get this error message in the log files of the container

"minidlna.c:1028: fatal: Failed to open log file '/log/minidlna.log': Permission denied"

could you please check and advise ?

THX Matthias

matthiasklabe commented 9 months ago

I'm using Debian bookworm at an AMD64 Server with Docker 25.0.0

GioF71 commented 9 months ago

Hello, looks like a permission issue, can you post your compose file?

matthiasklabe commented 9 months ago

version: "3"

services: minidlna-desktop: image: giof71/minidlna container_name: minidlna network_mode: host user: "1000:1000" environment:

GioF71 commented 9 months ago

Ok, can you please post the output of

id

Assuming it will be 1000:1000, I believe you should do:

docker-compose down
sudo chown -R 1000:1000 ./config
docker-compose up -d

Let me know if this helps

matthiasklabe commented 9 months ago

THX for fast reply. I started this stack with portainer and I have some other stacks running as well.

docker-compose.yml will be used several times for the other stacks as well.

docker-compose down is not working in ssh console.

Sorry I'm a "newbee" in this topic.

GioF71 commented 9 months ago

Which error do you get when running docker-compose down? I think you might have not installed docker-compose. You can install it using

sudo apt-get install docker-compose

Ok if you are using Portainer, these "./config/..." paths won't work and/or are not the best idea. You need absolute paths. Anyway if you want to use portainer, I would start dropping the line that says:

user: "1000:1000"

and would instead add the two variables:

PUID=1000
PGID=1000

I would create two volumes, named e.g. minidlna_db and minidlna_log and I would map those to /db and /log respectively, using the GUI. But in order to make things simple, you can try first without any mounted directory for /db and /tmp

Let me know if this helps

GioF71 commented 9 months ago

Sorry also add variable:

USER_MODE=Y

so that you can eventually deny it easily

matthiasklabe commented 9 months ago

Hi, volume is working, but container is restarting... you can see console and portainer log in the background.

image

GioF71 commented 9 months ago

I don't see the final part of the log... and I cannot open the image, can you post the text? The part you highlighted is ok, the script is changing the permissions on the volumes (it can do that because it is not run in docker user mode)

matthiasklabe commented 9 months ago

This is the log which I copied out of portainer:

Current user id is [0] t=A Processing media_dir for ENV_NAME=[/music/library1] t=P Processing media_dir for ENV_NAME=[] t=V Processing media_dir for ENV_NAME=[] t=A Processing media_dir for ENV_NAME=[/music/library2] t=P Processing media_dir for ENV_NAME=[] t=V Processing media_dir for ENV_NAME=[] t=A Processing media_dir for ENV_NAME=[/music/library3] t=P Processing media_dir for ENV_NAME=[] t=V Processing media_dir for ENV_NAME=[] t=A Processing media_dir for ENV_NAME=[] t=P Processing media_dir for ENV_NAME=[] t=V Processing media_dir for ENV_NAME=[] t=A Processing media_dir for ENV_NAME=[] t=P Processing media_dir for ENV_NAME=[] t=V Processing media_dir for ENV_NAME=[] group minidlna-user already exists. user minidlna-user already exists. Setting user permissions on /log ... Setting user permissions on /db ... User permissions set.

MINIDLNA CONFIG

media_dir=A,/music/library1 media_dir=A,/music/library2 media_dir=A,/music/library3 db_dir=/db  log_dir=/log root_container=M  0 friendly_name=minidlna inotify=yes album_art_names=Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg album_art_names=AlbumArt.jpg/albumart.jpg/Album.jpg/album.jpg album_art_names=Folder.jpg/folder.jpg/Thumb.jpg/thumb.jpg force_sort_criteria=+upnp:class,-dc:date,+upnp:album,+upnp:originalTrackNumber,+dc:title CMD_LINE=/usr/sbin/minidlnad -S -f /tmp/minidlna.conf -P /tmp/minidlnad.pid USER_MODE=[Y] USER_MODE with uid[1000] gid[1000]

and then it restarts. In other cases the ports causes issues, but the host has no used ports

matthiasklabe commented 9 months ago

sorry for the copy paste issue... no idea where it came from. Really appreciated your effort to help me!

GioF71 commented 9 months ago

do the paths:

/mnt/disk1/library /mnt/disk2/library /mnt/disk3/library

actually exist? they look the same I provided as an example. You need to tune those values to your actual paths

GioF71 commented 9 months ago

Which directory/directories do you want to serve with minidlna?

matthiasklabe commented 9 months ago

minidlna-log from Volumê

image

matthiasklabe commented 9 months ago

you could be right to serve special dirctories, but I thought this is generic setup

GioF71 commented 9 months ago

Do you have any other instance of minidlna running? maybe as a package on the host system?

try:

ps aux | grep minidlna

GioF71 commented 9 months ago

you could be right to serve special dirctories, but I thought this is generic setup

yes but I cannot know which will be the path(s) you want to share... only you know that, which names you gave to your media directories, etc. You need to provide that/those paths

Maybe I need to clarify this in the readme file.

GioF71 commented 9 months ago

Those paths have been create now in your filesystem although they are probably empty, you can clean those by:

sudo rmdir /mnt/disk1/library /mnt/disk2/library /mnt/disk3/library

matthiasklabe commented 9 months ago

image

GioF71 commented 9 months ago

those look like errors when network_mode is not host. Are you still using the compose file or manipulating the container using portainer?

matthiasklabe commented 9 months ago

I'm using compose file which is still in my private gitlab. In portainer I'm using "pull and re-deploy"

GioF71 commented 9 months ago

do you see other minidlna containers active in portainer?

GioF71 commented 9 months ago

Let's get these path correct first then we see if the errors persist. Can you tell me the full path of the media files you want to share?

matthiasklabe commented 9 months ago

There is nothing to share right now, but I will put something into /var/lib/docker/volumes/music1/_data....this is clear so far. It should only work for the little kid. Around 20 songs ;-) Later I want to use it by myself a bit more.

To answer your question, there is no minidlna container running

image

matthiasklabe commented 9 months ago

image

GioF71 commented 9 months ago

try removing that restart: unless-stopped, and re-create the container

matthiasklabe commented 9 months ago

it starts and it stopped after some time

GioF71 commented 9 months ago

ok so can you post the last log?

GioF71 commented 9 months ago

is any container possibly using port 8200?

matthiasklabe commented 9 months ago

I don't know where you from, but I don't want you to spend your "night" for my problem. I'm from Germany and it is around 7 p.m.

image

matthiasklabe commented 9 months ago

maybe the port need to be add into the docker-compose.yml?

I didn't even make it configurable... yet. But as long as there is no conflict, I think that is not the issue. Seeing the log I noticed this:

No such file or directory

Have you corrected the mount points?

GioF71 commented 9 months ago

No worries, we're on the same TZ, I'm from Italy I don't see 8200 in that list, am I wrong? Plot tickens

matthiasklabe commented 9 months ago

yes there is no 3200, maybe it need to add in YML

GioF71 commented 9 months ago

Seeing the log I noticed this:

No such file or directory

Have you corrected the mount points for the libraries?

matthiasklabe commented 9 months ago

If you mean /run/minssdpd - NO. I dont know why this need to be there... I started from scratch with headless DEBIAN bookworm. Then installed some additionals like "net-tools" and "mc". Then Installes Docker.io 25.0.0 and went forward with partainer and adding stacks out of my private gitlab.

image

matthiasklabe commented 9 months ago

I found out, right away, that this is needed in the host to provide DLNA from Host

matthiasklabe commented 9 months ago

I istalled it at my docker host an will let you know

GioF71 commented 9 months ago

No I mean the paths for your files. Let's try starting simple. I assume you want to share music but if not, replace "A" with "V". Simpler docker-compose file:

---
version: "3"

services:
  minidlna-desktop:
  image: giof71/minidlna
  container_name: minidlna
  network_mode: host
  environment:
   - USER_MODE=Y
   - PUID=1000
   - PGID=1000
   - MINIDLNA_ROOT_CONTAINER=M
   - MINIDLNA_DIR_A_1=/music/library1
   - MINIDLNA_ENABLE_INOTIFY=YES
   - MINIDLNA_FRIENDLY_NAME=minidlna
   - MINIDLNA_FORCE_SORT_CRITERIA=+upnp:class,-dc:date,+upnp:album,+upnp:originalTrackNumber,+dc:title
  volumes:
   - /path/to/music:/music/library1
GioF71 commented 9 months ago

I istalled it at my docker host an will let you know

So did you solve it?

matthiasklabe commented 9 months ago

unfortunately not. I used "sudo apt get install minissdpd" an rebooted the system. Service is now running at the host and missing file is also there image

image

matthiasklabe commented 9 months ago

after a second restart, minissdpd does not come up proper and .sock file is also disapeared. As mentioned I'm expecting this "minissdpd" in the container. Anyways - take your time to investigate - no stress ;-)

GioF71 commented 9 months ago

I never experienced this... I am currently clueless. Can you try this other minidlna docker container and see if this one works?

matthiasklabe commented 9 months ago

image

matthiasklabe commented 9 months ago

to be honest I tried it before as well, with same result

GioF71 commented 9 months ago

uhm ok, that's encouraging at least :-)

matthiasklabe commented 9 months ago

Could be that it is related to bookworm 64 bit, but I don't want to downgrade.

GioF71 commented 9 months ago

I can't exclude it... the server I am running it on is bullseye, but with that I am not encouraging to downgrade of course (I wouldn't)

matthiasklabe commented 9 months ago

IF you find the solution and send me you paypal, I will spend some money ;-)

GioF71 commented 9 months ago

Thank you, no it won't be necessary, but thank you anyway

GioF71 commented 9 months ago

Hello, if you install minidlna on the host machine, does it work properly? Thank you