libresh / compose-matomo

Matomo docker-compose application for libre.sh-v1
GNU Affero General Public License v3.0
179 stars 67 forks source link

docker-compose up failed (System error: not a directory) #5

Closed Treverix closed 7 years ago

Treverix commented 8 years ago

Hi,

I've started with the minimal setup and exported the mysql root password (nothing else). docker-compose up fails with an error message. The db container is running, the app container is just 'created':

docker create_container <- (name=u'piwik_app_1', image='piwik', labels={u'com.docker.compose.service': u'app', 'com.docker.compose.config-hash': '21df068f9a5ec3387938e5253de82993e624298346a19daca3a734c2eb04b20a', u'com.docker.compose.project': u'piwik', 'com.docker.compose.version': u'1.3.3', u'com.docker.compose.oneoff': u'False', 'com.docker.compose.container-number': '1'}, host_config={'Links': ['piwik_db_1:db', 'piwik_db_1:db_1', 'piwik_db_1:piwik_db_1'], 'PortBindings': {}, 'Binds': [u'/home/user/piwik/revaliases:/etc/ssmtp/revaliases:rw', u'/home/user/piwik/config:/var/www/html/config:rw', u'/home/user/piwik/ssmtp.conf:/etc/ssmtp/ssmtp.conf:rw', u'/var/lib/docker/volumes/54d4a1e73025e4efbdb7ad7662a602fec2c2d647ae88695481a9736f92f5b0c2/_data:/var/www/html:rw'], 'ExtraHosts': [], 'LogConfig': {'Type': u'json-file', 'Config': {}}, 'VolumesFrom': []}, environment={u'affinity:container': u'=05a82032a59fcea55b77390901cbb9a60eae60edfa5fa493e4a41a58349f9b8c'}, volumes={u'/etc/ssmtp/revaliases': {}, u'/var/www/html/config': {}, u'/etc/ssmtp/ssmtp.conf': {}}, detach=True)
docker create_container -> {u'Id': u'18cdc44c64f0cb79c5c8202a325dc95e382baedbf3cf2c975ca5bd84ba9c7cec',
 u'Warnings': None}
docker inspect_container <- (u'18cdc44c64f0cb79c5c8202a325dc95e382baedbf3cf2c975ca5bd84ba9c7cec')
docker inspect_container -> {u'AppArmorProfile': u'',
 u'Args': [u'php-fpm'],
 u'Config': {u'AttachStderr': False,
             u'AttachStdin': False,
             u'AttachStdout': False,
             u'Cmd': [u'php-fpm'],
             u'CpuShares': 0,
             u'Cpuset': u'',
             u'Domainname': u'',
             u'Entrypoint': [u'/entrypoint.sh'],
...
docker start <- (u'18cdc44c64f0cb79c5c8202a325dc95e382baedbf3cf2c975ca5bd84ba9c7cec')
Cannot start container 18cdc44c64f0cb79c5c8202a325dc95e382baedbf3cf2c975ca5bd84ba9c7cec: [8] System error: not a directory

I can't identify if the error is related to this setup or to the piwik container. I can enter the app container and execute 'php-fpm' with no error, btw. - no idea, WHAT is not a directory.

Docker version: 1.8.2 docker-compose version: 1.3.3

keltik85 commented 8 years ago

See this issue https://github.com/indiehosters/piwik/issues/4 , I also solved your exact same problem by creating the files manually. This should be in the wiki or How to use this image section.

Treverix commented 8 years ago

Thanks! #4 was closed so I didn't recognise it :)

For a quick start, create three empty files:

touch config
touch ssmtp.conf
touch revaliases

This eliminates the error. If the files don't exist, docker-compose up will create three empty folder with the very same name. So if you already have them, delete them.

pierreozoux commented 8 years ago

Hi! Is your issue solved?

motin commented 8 years ago

Same issue, but it is not solved by the above advice. Correction: config should be a directory.

Proper README contents could read:

git clone https://github.com/indiehosters/piwik.git
cd piwik
mkdir config
touch ssmtp.conf
touch revaliases
MYSQL_ROOT_PASSWORD=fooroot docker-compose --verbose up

However, this merely solves this particular issue and allows docker-compose up to finish, but does not result in a working piwik installation, since the config directory needs to be filled with the piwik default config files.

danielgratzl commented 7 years ago

Same problem here. Creating the files and directories manually does not solve the issue. Host System is OSX

dagbook:piwik dag$ docker-compose up
Creating piwik_db_1
Creating piwik_app_1

ERROR: for app  rpc error: code = 2 desc = "oci runtime error: could not synchronise with container process: not a directory"
Traceback (most recent call last):
  File "<string>", line 3, in <module>
  File "compose/cli/main.py", line 63, in main
AttributeError: 'ProjectError' object has no attribute 'msg'
docker-compose returned -1
dagbook:piwik dag$ docker-compose --verbose up
compose.config.config.find: Using configuration files: ./docker-compose.yml
docker.auth.auth.load_config: File doesn't exist
compose.cli.command.get_client: docker-compose version 1.7.1, build 0a9ab35
docker-py version: 1.8.1
CPython version: 2.7.9
OpenSSL version: OpenSSL 1.0.1j 15 Oct 2014
compose.cli.command.get_client: Docker base_url: https://192.168.99.101:2376
compose.cli.command.get_client: Docker version: KernelVersion=4.4.12-boot2docker, Os=linux, BuildTime=2016-06-01T21:20:08.558909126+00:00, ApiVersion=1.23, Version=1.11.2, GitCommit=b9f10c9, Arch=amd64, GoVersion=go1.5.4
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=False, filters={u'label': [u'com.docker.compose.project=piwik', u'com.docker.compose.oneoff=False']})
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 1 items)
compose.cli.verbose_proxy.proxy_callable: docker inspect_container <- (u'9a31ad6dbb441f76496d7d8fb979dd67aabee4e0b2ae962b0a791d0bc40d7470')
compose.cli.verbose_proxy.proxy_callable: docker inspect_container -> {u'AppArmorProfile': u'',
 u'Args': [u'mysqld'],
 u'Config': {u'AttachStderr': False,
             u'AttachStdin': False,
             u'AttachStdout': False,
             u'Cmd': [u'mysqld'],
             u'Domainname': u'',
             u'Entrypoint': [u'docker-entrypoint.sh'],
             u'Env': [u'MYSQL_ROOT_PASSWORD=secret',
                      u'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
...
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=True, filters={u'label': [u'com.docker.compose.project=piwik', u'com.docker.compose.service=db', u'com.docker.compose.oneoff=False']})
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 1 items)
compose.cli.verbose_proxy.proxy_callable: docker inspect_container <- (u'9a31ad6dbb441f76496d7d8fb979dd67aabee4e0b2ae962b0a791d0bc40d7470')
compose.cli.verbose_proxy.proxy_callable: docker inspect_container -> {u'AppArmorProfile': u'',
 u'Args': [u'mysqld'],
 u'Config': {u'AttachStderr': False,
             u'AttachStdin': False,
             u'AttachStdout': False,
             u'Cmd': [u'mysqld'],
             u'Domainname': u'',
             u'Entrypoint': [u'docker-entrypoint.sh'],
             u'Env': [u'MYSQL_ROOT_PASSWORD=secret',
                      u'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
...
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=True, filters={u'label': [u'com.docker.compose.project=piwik', u'com.docker.compose.service=app', u'com.docker.compose.oneoff=False']})
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 1 items)
compose.cli.verbose_proxy.proxy_callable: docker inspect_container <- (u'2edb43b25caf2b03d907f48d035c4e500602540722ad135ba32d079122f19e1c')
compose.cli.verbose_proxy.proxy_callable: docker inspect_container -> {u'AppArmorProfile': u'',
 u'Args': [u'php-fpm'],
 u'Config': {u'AttachStderr': False,
             u'AttachStdin': False,
             u'AttachStdout': False,
             u'Cmd': [u'php-fpm'],
             u'Domainname': u'',
             u'Entrypoint': [u'/entrypoint.sh'],
             u'Env': [u'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
                      u'PHPIZE_DEPS=autoconf \t\tfile \t\tg++ \t\tgcc \t\tlibc-dev \t\tmake \t\tpkg-config \t\tre2c',
...
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=True, filters={u'label': [u'com.docker.compose.project=piwik', u'com.docker.compose.service=web', u'com.docker.compose.oneoff=False']})
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 0 items)
compose.cli.verbose_proxy.proxy_callable: docker inspect_image <- ('mysql')
compose.cli.verbose_proxy.proxy_callable: docker inspect_image -> {u'Architecture': u'amd64',
 u'Author': u'',
 u'Comment': u'',
 u'Config': {u'ArgsEscaped': True,
             u'AttachStderr': False,
             u'AttachStdin': False,
             u'AttachStdout': False,
             u'Cmd': [u'mysqld'],
             u'Domainname': u'',
             u'Entrypoint': [u'docker-entrypoint.sh'],
...
compose.cli.verbose_proxy.proxy_callable: docker inspect_image <- ('piwik')
compose.cli.verbose_proxy.proxy_callable: docker inspect_image -> {u'Architecture': u'amd64',
 u'Author': u'pierre@piwik.org',
 u'Comment': u'',
 u'Config': {u'ArgsEscaped': True,
             u'AttachStderr': False,
             u'AttachStdin': False,
             u'AttachStdout': False,
             u'Cmd': [u'php-fpm'],
             u'Domainname': u'',
             u'Entrypoint': [u'/entrypoint.sh'],
...
compose.cli.verbose_proxy.proxy_callable: docker inspect_image <- ('nginx')
compose.cli.verbose_proxy.proxy_callable: docker inspect_image -> {u'Architecture': u'amd64',
 u'Author': u'NGINX Docker Maintainers "docker-maint@nginx.com"',
 u'Comment': u'',
 u'Config': {u'AttachStderr': False,
             u'AttachStdin': False,
             u'AttachStdout': False,
             u'Cmd': [u'nginx', u'-g', u'daemon off;'],
             u'Domainname': u'',
             u'Entrypoint': None,
             u'Env': [u'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
...
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=True, filters={u'label': [u'com.docker.compose.project=piwik', u'com.docker.compose.service=db', u'com.docker.compose.oneoff=False']})
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 1 items)
compose.cli.verbose_proxy.proxy_callable: docker inspect_image <- ('mysql')
compose.cli.verbose_proxy.proxy_callable: docker inspect_image -> {u'Architecture': u'amd64',
 u'Author': u'',
 u'Comment': u'',
 u'Config': {u'ArgsEscaped': True,
             u'AttachStderr': False,
             u'AttachStdin': False,
             u'AttachStdout': False,
             u'Cmd': [u'mysqld'],
             u'Domainname': u'',
             u'Entrypoint': [u'docker-entrypoint.sh'],
...
compose.cli.verbose_proxy.proxy_callable: docker inspect_container <- (u'9a31ad6dbb441f76496d7d8fb979dd67aabee4e0b2ae962b0a791d0bc40d7470')
compose.cli.verbose_proxy.proxy_callable: docker inspect_container -> {u'AppArmorProfile': u'',
 u'Args': [u'mysqld'],
 u'Config': {u'AttachStderr': False,
             u'AttachStdin': False,
             u'AttachStdout': False,
             u'Cmd': [u'mysqld'],
             u'Domainname': u'',
             u'Entrypoint': [u'docker-entrypoint.sh'],
             u'Env': [u'MYSQL_ROOT_PASSWORD=secret',
                      u'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
...
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=True, filters={u'label': [u'com.docker.compose.project=piwik', u'com.docker.compose.service=app', u'com.docker.compose.oneoff=False']})
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 1 items)
compose.cli.verbose_proxy.proxy_callable: docker inspect_image <- ('piwik')
compose.cli.verbose_proxy.proxy_callable: docker inspect_image -> {u'Architecture': u'amd64',
 u'Author': u'pierre@piwik.org',
 u'Comment': u'',
 u'Config': {u'ArgsEscaped': True,
             u'AttachStderr': False,
             u'AttachStdin': False,
             u'AttachStdout': False,
             u'Cmd': [u'php-fpm'],
             u'Domainname': u'',
             u'Entrypoint': [u'/entrypoint.sh'],
...
compose.cli.verbose_proxy.proxy_callable: docker inspect_container <- (u'2edb43b25caf2b03d907f48d035c4e500602540722ad135ba32d079122f19e1c')
compose.cli.verbose_proxy.proxy_callable: docker inspect_container -> {u'AppArmorProfile': u'',
 u'Args': [u'php-fpm'],
 u'Config': {u'AttachStderr': False,
             u'AttachStdin': False,
             u'AttachStdout': False,
             u'Cmd': [u'php-fpm'],
             u'Domainname': u'',
             u'Entrypoint': [u'/entrypoint.sh'],
             u'Env': [u'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
                      u'PHPIZE_DEPS=autoconf \t\tfile \t\tg++ \t\tgcc \t\tlibc-dev \t\tmake \t\tpkg-config \t\tre2c',
...
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=True, filters={u'label': [u'com.docker.compose.project=piwik', u'com.docker.compose.service=web', u'com.docker.compose.oneoff=False']})
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 0 items)
compose.parallel.feed_queue: Pending: set([<Service: db>, <Service: web>, <Service: app>])
compose.parallel.feed_queue: Starting producer thread for <Service: db>
compose.service.execute_convergence_plan: piwik_db_1 is up-to-date
compose.parallel.parallel_execute_iter: Finished processing: <Service: db>
compose.parallel.feed_queue: Pending: set([<Service: app>, <Service: web>])
compose.parallel.feed_queue: Starting producer thread for <Service: app>
compose.service.start_container_if_stopped: Starting piwik_app_1
compose.cli.verbose_proxy.proxy_callable: docker attach <- (u'2edb43b25caf2b03d907f48d035c4e500602540722ad135ba32d079122f19e1c', stderr=True, stream=True, stdout=True)
compose.cli.verbose_proxy.proxy_callable: docker attach -> <generator object _multiplexed_response_stream_helper at 0x1044fa140>
compose.cli.verbose_proxy.proxy_callable: docker start <- (u'2edb43b25caf2b03d907f48d035c4e500602540722ad135ba32d079122f19e1c')
compose.parallel.feed_queue: Pending: set([<Service: web>])
compose.parallel.parallel_execute_iter: Failed: <Service: app>
compose.parallel.feed_queue: Pending: set([<Service: web>])
compose.parallel.feed_queue: <Service: web> has upstream errors - not processing
compose.parallel.parallel_execute_iter: Failed: <Service: web>
compose.parallel.feed_queue: Pending: set([])

ERROR: for app  rpc error: code = 2 desc = "oci runtime error: could not synchronise with container process: not a directory"
Traceback (most recent call last):
  File "<string>", line 3, in <module>
  File "compose/cli/main.py", line 63, in main
AttributeError: 'ProjectError' object has no attribute 'msg'
docker-compose returned -1
JulianCataldo commented 7 years ago

Cannot use it here neither on Ubuntu and latest Engine/Compose.

I get :

Creating piwik_db_1
Creating piwik_app_1

ERROR: for app  Cannot start service app: oci runtime error: rootfs_linux.go:53: mounting "/var/lib/docker/aufs/mnt/xxxxx/etc/ssmtp/revaliases" to rootfs "/var/lib/docker/aufs/mnt/xxxxx" caused "not a directory"

Pre-creating files/folders doesn't address it.

trickortweak commented 7 years ago

Before running docker compose, make sure that the 'config' directory is created, the 'revaliases' file is created with appropriate configuration, and the 'ssmtp.conf' file is created with appropriate configuration. When I did this, it worked for me.

Docker Compose will create these volume references as directories. Since it's mounting them as files, the above referenced failure will occur since it's mounting a directory as a file in the container.

pierreozoux commented 7 years ago

Ok, I did some work to make it easier.

Can you pull the latest version of here and confirm this is working for you? If not, please fell free to reopen :)

Thanks!