jjethwa / icinga2

GNU General Public License v3.0
223 stars 189 forks source link

Error when uncommenting msmtp in docker file: Are you trying to mount a directory onto a file (or vice-versa)? #248

Open levasc opened 3 years ago

levasc commented 3 years ago

ERROR: for icinga2 Cannot start service icinga2: OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused \"rootfs_linux.go:58: mounting \\"/home/mariuzz/Docker/icinga2/msmtp/aliases\\" to rootfs \\"/var/lib/docker/overlay2/4c48409cde020d21e3d5b1f7bc19dd617b05698c715538dc25825cd816857f62/merged\\" at \\"/var/lib/docker/overlay2/4c48409cde020d21e3d5b1f7bc19dd617b05698c715538dc25825cd816857f62/merged/etc/aliases\\" caused \\"not a directory\\"\"": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type

jjethwa commented 3 years ago

Hi @levasc

Can you provide the docker run command? Just to make sure, the mount information is supplied here: https://github.com/jjethwa/icinga2#sending-notification-mails

levasc commented 3 years ago

I am using docker-compose. I think it tries to mount the files as directories. :)

2020-11-11, tr, 21:14 Jordan Jethwa notifications@github.com rašė:

Hi @levasc https://github.com/levasc

Can you provide the docker run command? Just to make sure, the mount information is supplied here: https://github.com/jjethwa/icinga2#sending-notification-mails

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jjethwa/icinga2/issues/248#issuecomment-725608977, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACZSVQYISN7M2JGPANLFPQTSPLPABANCNFSM4TSKTL4Q .

jjethwa commented 3 years ago

Thanks @levasc

There is an issue with some versions of docker and docker-compose for volumes that are files. Try putting the exact path to the files on the host system: https://github.com/jjethwa/icinga2/blob/master/docker-compose.yml#L47-L48

For example:

/apps/docker-volumes/icinga2/msmtp/aliases:/etc/aliases:ro

Hopefully that works 😄