sipcapture / homer5-docker

HOMER 5 Docker Containers (OBSOLETE)
http://sipcapture.org
40 stars 61 forks source link

bootstrap-mysql permission denied when creating /homer-semaphore/.bootstrapped) #41

Closed 00Asgaroth00 closed 7 years ago

00Asgaroth00 commented 7 years ago

Hi,

I've just tried to run the multiple container version of homer on a fresh install of centos-7 and docker.

When running the "docker-compose up" mysql appears to startup fine, the bootstrap.sh script then attempts to created the .bootstrapped file but this step fails with a permission denied error, which in turn causes the other containers to be in a waiting state.

bootstrap-mysql | Mysql is now running.
bootstrap-mysql | Beginning initial data load....
bootstrap-mysql | Creating Databases...
bootstrap-mysql | Creating Tables...
bootstrap-mysql | /bootstrap.sh: line 76: /homer-semaphore/.bootstrapped: Permission denied
bootstrap-mysql | Data bootstrapped semaphore written to /homer-semaphore/.bootstrapped
bootstrap-mysql exited with code 0

The containers then sit in a waiting state before they start up:

homer-webapp | Homer web app, waiting for MySQL
homer-cron   | Homer cron container, waiting for MySQL
homer-kamailio | Kamailio, waiting for MySQL
homer-webapp | Homer web app, waiting for MySQL
homer-cron   | Homer cron container, waiting for MySQL
homer-kamailio | Kamailio, waiting for MySQL
homer-webapp | Homer web app, waiting for MySQL
homer-cron   | Homer cron container, waiting for MySQL
homer-kamailio | Kamailio, waiting for MySQL
homer-webapp | Homer web app, waiting for MySQL
homer-cron   | Homer cron container, waiting for MySQL
homer-kamailio | Kamailio, waiting for MySQL

Any thoughts on this particular issue? I'm fairly new to docker so any tips on how to proceed are much appreciated.

dougbtv commented 7 years ago

What o/s are you running? My instinct guesses selinix enabled and it's having trouble with permissions to write to a volume...

On Tue, Mar 21, 2017, 9:54 AM 00Asgaroth00 notifications@github.com wrote:

Hi,

I've just tried to run the multiple container version of homer on a fresh install of centos-7 and docker.

When running the "docker-compose up" mysql appears to startup fine, the bootstrap.sh script then attempts to created the .bootstrapped file but this step fails with a permission denied error, which in turn causes the other containers to be in a waiting state.

bootstrap-mysql | Mysql is now running. bootstrap-mysql | Beginning initial data load.... bootstrap-mysql | Creating Databases... bootstrap-mysql | Creating Tables... bootstrap-mysql | /bootstrap.sh: line 76: /homer-semaphore/.bootstrapped: Permission denied bootstrap-mysql | Data bootstrapped semaphore written to /homer-semaphore/.bootstrapped bootstrap-mysql exited with code 0

The containers then sit in a waiting state before they start up:

homer-webapp | Homer web app, waiting for MySQL homer-cron | Homer cron container, waiting for MySQL homer-kamailio | Kamailio, waiting for MySQL homer-webapp | Homer web app, waiting for MySQL homer-cron | Homer cron container, waiting for MySQL homer-kamailio | Kamailio, waiting for MySQL homer-webapp | Homer web app, waiting for MySQL homer-cron | Homer cron container, waiting for MySQL homer-kamailio | Kamailio, waiting for MySQL homer-webapp | Homer web app, waiting for MySQL homer-cron | Homer cron container, waiting for MySQL homer-kamailio | Kamailio, waiting for MySQL

Any thoughts on this particular issue? I'm fairly new to docker so any tips on how to procedd are much appreciated.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sipcapture/homer-docker/issues/41, or mute the thread https://github.com/notifications/unsubscribe-auth/AFN_vQt-7i_VBcxz9uXs8f_uUxMEgvmfks5rn9aIgaJpZM4Mj1nx .

00Asgaroth00 commented 7 years ago

It's running CentOS 7 x64, I see selinux is in enforcing mode, let me disable it quick and give it another shot

00Asgaroth00 commented 7 years ago

hmm, now get a different error when trying to start up the containers after disabling selinux.

[root@docker homer-docker]# sestatus
SELinux status:                 disabled

trying to start the containers yields:

[root@docker homer-docker]# docker-compose up
Starting mysql

ERROR: for mysql  Cannot start service mysql: devmapper: Error mounting '/dev/mapper/docker-253:2-923-ecc38a86bbc8b8a7b759929cdd81d0c92daeddc546431fdc1f1e99347f0ff620' on '/var/lib/docker/devicemapper/mnt/ecc38a86bbc8b8a7b759929cdd81d0c92daeddc546431fdc1f1e99347f0ff620': invalid argument
ERROR: Encountered errors while bringing up the project.

If I then re-enable selinux then I'm presented with the permission denied issue while bootstrapping again.

00Asgaroth00 commented 7 years ago

That error seems to be a known race condition which is apparently fixed. I've just switched from loopback device storage mode to device mapper (thin pools) and I'm trying a build now with selinux disabled. I'll let you know how I get on.

dougbtv commented 7 years ago

Nice sleuthing!!! Curious to see how it goes. I might create an issue related to selinux as it bothers me to disable it, intellectually speaking. Always wind up disabling it on Fedora/CentOS when using Docker but only because I haven't taken the time to set it up properly.

On Tue, Mar 21, 2017, 10:51 AM 00Asgaroth00 notifications@github.com wrote:

That error seems to be a known race condition which is apparently fixed. I've just switched from loopback device storage mode to device mapper (thin pools) and I'm trying a build now with selinux disabled. I'll let you know how I get on.

— You are receiving this because you were assigned.

Reply to this email directly, view it on GitHub https://github.com/sipcapture/homer-docker/issues/41#issuecomment-288103228, or mute the thread https://github.com/notifications/unsubscribe-auth/AFN_vWCf_hTIzUfR3IvNn1EuDBfP8iUmks5rn-QNgaJpZM4Mj1nx .

00Asgaroth00 commented 7 years ago

okay, the "docker-compose up" now seems to complete, but I've noticed the following error's for "homer-cron" image:

homer-cron   | Can't open /opt/rotation.ini: No such file or directory.
homer-cron   | Can't open /opt/rotation.ini: No such file or directory.
homer-cron   | Can't open /opt/rotation.ini: No such file or directory.

Is this normal for the initial startup?

dougbtv commented 7 years ago

Hey @00Asgaroth00 sorry for a slow reply here, but, there's a PR incoming #43 which has a number of fixes and should fix up the issues you're seeing with the cron container.

Some more detail in #42. Expect that PR to land... shortly.