libresh / compose-matomo

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

Cannot start service app: Cannot link to a non running container: /piwik_db_1 AS /piwik_app_1/db #16

Closed d33tah closed 7 years ago

d33tah commented 7 years ago
(virtualenv)[][16:24:43][/tmp/piwik][1] $[SUDO] sudo docker-compose down                                   
Removing piwik_app_1 ... done
Removing piwik_db_1 ... done
(virtualenv)[][16:25:05][/tmp/piwik]$[SUDO] sudo MYSQL_ROOT_PASSWORD=mystrongpassword docker-compose up
Creating piwik_db_1
Creating piwik_app_1

ERROR: for app  Cannot start service app: Cannot link to a non running container: /piwik_db_1 AS /piwik_app_1/db
ERROR: Encountered errors while bringing up the project.
pierreozoux commented 7 years ago

Do you run on linux/windows/mac? Do you use latest version of docker / docker-compose?

d33tah commented 7 years ago

Linux, Fedora 24, docker-compose installed via pip.

(virtualenv)[][16:54:21][/tmp/piwik]$[SUDO] sudo docker-compose --version
docker-compose version 1.8.0, build 94f7016
(virtualenv)[][16:54:22][/tmp/piwik]$[SUDO] docker --version
Docker version 1.10.3, build 1ecb834/1.10.3
pierreozoux commented 7 years ago

Can you update to latest first please?

Thanks!

Pierre

On 30-08-2016 15:54, Jacek Wielemborek wrote:

Linux, Fedora 24, docker-compose installed via pip.

|(virtualenv)[][16:54:21][/tmp/piwik]$[SUDO] sudo docker-compose --version docker-compose version 1.8.0, build 94f7016 (virtualenv)[][16:54:22][/tmp/piwik]$[SUDO] docker --version Docker version 1.10.3, build 1ecb834/1.10.3 |

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/indiehosters/piwik/issues/16#issuecomment-243467233, or mute the thread https://github.com/notifications/unsubscribe-auth/ABxvHbWXZahj9EaYMN9PY0Nj-18Bhet7ks5qlEQzgaJpZM4JwllF.

I use PGP to protect our privacy, if you want to know more, you can follow this https://emailselfdefense.fsf.org/en/

If you have further questions, please do not hesitate to ask. You can verify my public key here: https://keybase.io/pierreozoux

d33tah commented 7 years ago

What do you mean @pierreozoux? pip says it's already the latest:

$[SUDO] sudo pip install -U docker-compose
Requirement already up-to-date: docker-compose in /usr/lib/python2.7/site-packages
Requirement already up-to-date: cached-property<2,>=1.2.0 in /usr/lib/python2.7/site-packages (from docker-compose)
Requirement already up-to-date: docopt<0.7,>=0.6.1 in /usr/lib/python2.7/site-packages (from docker-compose)
Requirement already up-to-date: PyYAML<4,>=3.10 in /usr/lib64/python2.7/site-packages (from docker-compose)
Requirement already up-to-date: requests<2.8,>=2.6.1 in /usr/lib/python2.7/site-packages (from docker-compose)
Requirement already up-to-date: texttable<0.9,>=0.8.1 in /usr/lib/python2.7/site-packages (from docker-compose)
Requirement already up-to-date: websocket-client<1.0,>=0.32.0 in /usr/lib/python2.7/site-packages (from docker-compose)
Requirement already up-to-date: docker-py<2.0,>=1.9.0 in /usr/lib/python2.7/site-packages (from docker-compose)
Requirement already up-to-date: dockerpty<0.5,>=0.4.1 in /usr/lib/python2.7/site-packages (from docker-compose)
Requirement already up-to-date: six<2,>=1.3.0 in /usr/lib/python2.7/site-packages (from docker-compose)
Requirement already up-to-date: jsonschema<3,>=2.5.1 in /usr/lib/python2.7/site-packages (from docker-compose)
Requirement already up-to-date: enum34<2,>=1.0.4 in /usr/lib/python2.7/site-packages (from docker-compose)
Requirement already up-to-date: backports.ssl-match-hostname>=3.5 in /usr/lib/python2.7/site-packages (from docker-py<2.0,>=1.9.0->docker-compose)
Requirement already up-to-date: ipaddress>=1.0.16 in /usr/lib/python2.7/site-packages (from docker-py<2.0,>=1.9.0->docker-compose)
Requirement already up-to-date: functools32 in /usr/lib/python2.7/site-packages (from jsonschema<3,>=2.5.1->docker-compose)
You are using pip version 8.0.2, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
pierreozoux commented 7 years ago

Your docker engine is not, But I don't think it is the issue.

Do you use the exact same docker-compose?

it looks like the issue is coming from your db container.

Can you:

MYSQL_ROOT_PASSWORD=mystrongpassword docker-compose up -d db
docker-compose logs
ghost commented 7 years ago

mystrongpassword is not a strong password

d33tah commented 7 years ago

How about mystrongpassword2?

TheNotary commented 7 years ago

This repo seems to be broken for me too. I'm using a recent version of docker and linux. I'm getting slightly different outputs.

$ uname -a && docker -v
Linux linux-mint-laptop 3.16.0-38-generic #52~14.04.1-Ubuntu SMP Fri May 8 09:43:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Docker version 1.12.1, build 23cf638

$ MYSQL_ROOT_PASSWORD=mystrongpassword docker-compose up
Removing piwikcompose_app_1
piwikcompose_db_1 is up-to-date
Starting b453a62758eb_b453a62758eb_b453a62758eb_b453a62758eb_b453a62758eb_piwikcompose_app_1

ERROR: for app  Cannot link to a non running container: /46349960290d_piwikcompose_db_1 AS /piwikcompose_app_1/db
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

And here are some logs:

$ docker-compose logs
Attaching to piwikcompose_app_1, piwikcompose_db_1, b453a62758eb_b453a62758eb_b453a62758eb_b453a62758eb_b453a62758eb_b453a62758eb_piwikcompose_app_1
db_1    | 2016-09-27T20:38:54.239481Z 0 [Note] mysqld (mysqld 5.7.10) starting as process 1 ...
db_1    | 2016-09-27T20:38:54.243552Z 0 [Note] InnoDB: PUNCH HOLE support available
db_1    | 2016-09-27T20:38:54.243578Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
db_1    | 2016-09-27T20:38:54.243583Z 0 [Note] InnoDB: Uses event mutexes
db_1    | 2016-09-27T20:38:54.243587Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
db_1    | 2016-09-27T20:38:54.243595Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
db_1    | 2016-09-27T20:38:54.243603Z 0 [Note] InnoDB: Using Linux native AIO
db_1    | 2016-09-27T20:38:54.243849Z 0 [Note] InnoDB: Number of pools: 1
db_1    | 2016-09-27T20:38:54.243946Z 0 [Note] InnoDB: Using CPU crc32 instructions
db_1    | 2016-09-27T20:38:54.250898Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
db_1    | 2016-09-27T20:38:54.258261Z 0 [Note] InnoDB: Completed initialization of buffer pool
db_1    | 2016-09-27T20:38:54.259767Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
db_1    | 2016-09-27T20:38:54.272053Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
db_1    | 2016-09-27T20:38:54.282717Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
db_1    | 2016-09-27T20:38:54.282866Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
db_1    | 2016-09-27T20:38:54.381752Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
db_1    | 2016-09-27T20:38:54.383491Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
db_1    | 2016-09-27T20:38:54.383516Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
db_1    | 2016-09-27T20:38:54.384059Z 0 [Note] InnoDB: Waiting for purge to start
db_1    | 2016-09-27T20:38:54.434211Z 0 [Note] InnoDB: 5.7.10 started; log sequence number 11990298
db_1    | 2016-09-27T20:38:54.434413Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
db_1    | 2016-09-27T20:38:54.434554Z 0 [Note] InnoDB: not started
db_1    | 2016-09-27T20:38:54.434831Z 0 [Note] Plugin 'FEDERATED' is disabled.
db_1    | 2016-09-27T20:38:54.437952Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
db_1    | 2016-09-27T20:38:54.437997Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
db_1    | 2016-09-27T20:38:54.438049Z 0 [Note] IPv6 is available.
db_1    | 2016-09-27T20:38:54.438070Z 0 [Note]   - '::' resolves to '::';
db_1    | 2016-09-27T20:38:54.438076Z 0 [Note] Server socket created on IP: '::'.
db_1    | 2016-09-27T20:38:54.438347Z 0 [Note] InnoDB: Buffer pool(s) load completed at 160927 20:38:54
db_1    | 2016-09-27T20:38:54.440235Z 0 [Warning] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode.
db_1    | 2016-09-27T20:38:54.440260Z 0 [Warning] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode.
db_1    | 2016-09-27T20:38:54.443909Z 0 [Warning] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode.
db_1    | 2016-09-27T20:38:54.450780Z 0 [Note] Event Scheduler: Loaded 0 events
db_1    | 2016-09-27T20:38:54.450970Z 0 [Note] mysqld: ready for connections.
db_1    | Version: '5.7.10'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server (GPL)

It seems that the mysql container booted fine

docker ps
CONTAINER ID        IMAGE                         COMMAND                  CREATED             STATUS              PORTS                     NAMES
3d2d1aa4c43e        mysql                         "/entrypoint.sh mysql"   4 minutes ago       Up 4 minutes        3306/tcp                  piwikcompose_db_1

Also, a fresh re-attempt:

$         echo "PikWi says: docker-compose pull" && \
>     docker-compose pull && \
>         echo "PikWi says: docker-compose build ..." && \
>     docker-compose build --no-cache && \
>         echo "PikWi says: docker-compose up ..." && \
>     docker-compose up -d --force-recreate --remove-orphans
PikWi says: docker-compose pull
Pulling db (mysql:latest)...
latest: Pulling from library/mysql
6a5a5368e0c2: Already exists
0689904e86f0: Pull complete
486087a8071d: Pull complete
3eff318f6785: Pull complete
3df41d8a4cfb: Pull complete
1b4a00485931: Pull complete
0bab0b2c2630: Pull complete
264fc9ce512d: Pull complete
e0181dcdbbe8: Pull complete
53b082fa47c7: Pull complete
e5cf4fe00c4c: Pull complete
Digest: sha256:966490bda4576655dc940923c4883db68cca0b3607920be5efff7514e0379aa7
Status: Downloaded newer image for mysql:latest
Pulling app (piwik:latest)...
latest: Pulling from library/piwik
Digest: sha256:497fef57a8db841accbdf1381166f4ac1f8e5114d5ba39bd119f07eeb84c4e1a
Status: Image is up to date for piwik:latest
Pulling web (nginx:latest)...
latest: Pulling from library/nginx
Digest: sha256:1ebfe348d131e9657872de9881fe736612b2e8e1630e0508c354acb0350a4566
Status: Image is up to date for nginx:latest
Pulling cron (piwik:latest)...
latest: Pulling from library/piwik
Digest: sha256:497fef57a8db841accbdf1381166f4ac1f8e5114d5ba39bd119f07eeb84c4e1a
Status: Image is up to date for piwik:latest
PikWi says: docker-compose build ...
db uses an image, skipping
app uses an image, skipping
web uses an image, skipping
cron uses an image, skipping
PikWi says: docker-compose up ...
Creating piwikcompose_db_1
Creating piwikcompose_app_1

ERROR: for app  oci runtime error: rootfs_linux.go:53: mounting "/var/lib/docker/aufs/mnt/c8d24b9e93147d7588fb7dd10ef34d2c9a954a1a0b854cee91f703f160eef32c/etc/ssmtp/revaliases" to rootfs "/var/lib/docker/aufs/mnt/c8d24b9e93147d7588fb7dd10ef34d2c9a954a1a0b854cee91f703f160eef32c" caused "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
stephenjbarr commented 7 years ago

I am having the same issue with docker-compose 1.8.1 on OSX

wwfalcon commented 7 years ago

the same issue on macOS (10.12.1)

Docker version 1.12.1, build 23cf638 docker-compose version 1.8.0, build f3628c7

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!