ReinerNippes / nextcloud_on_docker

Run Nextcloud in Docker Container on various Linux Hosts
MIT License
203 stars 48 forks source link

cannot start traefik container #57

Closed konradwalsh closed 3 years ago

konradwalsh commented 4 years ago

Hey Having run the playbook... which I thank you for! A lot of work done there!

At the end, I get this error

TASK [docker_container : Create the traefik container] ******************************************************************************************************
Thursday 28 May 2020  07:52:22 +0000 (0:00:04.250)       0:01:50.347 **********
fatal: [localhost]: FAILED! => changed=false
  msg: 'Error starting container 2693b444d151a93b08409f5983ce1e0dd1e1ca2abc64941c6d45f05f89dd6757: 400 Client Error: Bad Request ("OCI runtime create failed:49: starting container process caused "process_linux.go:449: container init caused \"rootfs_linux.go:58: mounting \\\"/media/storage/nextcloud/traefik/acme.j"/var/lib/docker/overlay2/737b1fce39f9d534ace825cb4f066549f53594c3d816c08add6b241b09f00365/merged\\\" at \\\"/var/lib/docker/overlay2/737b1fce39f9d534ace825cc08add6b241b09f00365/merged/acme.json\\\" caused \\\"not a directory\\\"\"": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check  path exists and is the expected type")'

PLAY RECAP **************************************************************************************************************************************************
localhost                  : ok=38   changed=3    unreachable=0    failed=1    skipped=3    rescued=0    ignored=0

Thursday 28 May 2020  07:52:25 +0000 (0:00:03.351)       0:01:53.699 **********
===============================================================================
Gathering Facts ---------------------------------------------------------------------------------------------------------------------------------------------
prep_ufw : Configuring port/protocol/network rules ----------------------------------------------------------------------------------------------------------
prep_ufw : Installing ufw package ---------------------------------------------------------------------------------------------------------------------------
prep_docker : add docker key --------------------------------------------------------------------------------------------------------------------------------
prep_os : apt dist-upgrade ----------------------------------------------------------------------------------------------------------------------------------
prep_docker : install needed packages -----------------------------------------------------------------------------------------------------------------------
prep_os : install additional packages -----------------------------------------------------------------------------------------------------------------------
prep_docker : install docker --------------------------------------------------------------------------------------------------------------------------------
docker_container : adding traefik.toml file -----------------------------------------------------------------------------------------------------------------
prep_ufw : Configuring service ------------------------------------------------------------------------------------------------------------------------------
docker_container : Create watchtower container for auto update ----------------------------------------------------------------------------------------------
prep_ufw : Configuring firewall -----------------------------------------------------------------------------------------------------------------------------
prep_docker : add additional docker repo --------------------------------------------------------------------------------------------------------------------
prep_docker : remove ubuntu repo docker ---------------------------------------------------------------------------------------------------------------------
prep_ufw : start ufw ----------------------------------------------------------------------------------------------------------------------------------------
docker_container : Create the traefik container -------------------------------------------------------------------------------------------------------------
prep_os : make sure nextcloud directoies are present --------------------------------------------------------------------------------------------------------
prep_ufw : Enabling firewall --------------------------------------------------------------------------------------------------------------------------------
docker_container : Create frontend network ------------------------------------------------------------------------------------------------------------------
prep_docker : enable docker --

Anyone know how I fix this.. there is a folder in that location with that name but I cannot see whats inside it

This may be of use:

TASK [docker_container : docker watchtower] *****************************************************************************************************************
Thursday 28 May 2020  07:52:11 +0000 (0:00:02.129)       0:01:39.297 **********
included: /home/konradwalsh/nextcloud_on_docker/roles/docker_container/tasks/watchtower.yml for localhost

TASK [docker_container : Create watchtower container for auto update] ***************************************************************************************
Thursday 28 May 2020  07:52:11 +0000 (0:00:00.459)       0:01:39.757 **********
ok: [localhost]

TASK [docker_container : docker traefik] ********************************************************************************************************************
Thursday 28 May 2020  07:52:15 +0000 (0:00:03.502)       0:01:43.260 **********
included: /home/konradwalsh/nextcloud_on_docker/roles/docker_container/tasks/traefik.yml for localhost

TASK [docker_container : ensures traefik dir exists] ********************************************************************************************************
Thursday 28 May 2020  07:52:15 +0000 (0:00:00.505)       0:01:43.766 **********
ok: [localhost]

TASK [docker_container : ensures acme.json file exists] *****************************************************************************************************
Thursday 28 May 2020  07:52:16 +0000 (0:00:01.162)       0:01:44.929 **********
changed: [localhost]

TASK [docker_container : adding traefik.toml file] **********************************************************************************************************
Thursday 28 May 2020  07:52:18 +0000 (0:00:01.168)       0:01:46.097 **********
/usr/lib/python3/dist-packages/passlib/handlers/bcrypt.py:237: PasslibHashWarning: encountered a bcrypt salt with incorrectly set padding bits; you may want h() to fix this; this will be an error under Passlib 2.0
  PasslibHashWarning)
changed: [localhost]

Out put of docker -ps and ps -a


`konradwalsh@nextcloud-server:/media/storage/nextcloud/traefik$ docker ps
CONTAINER ID        IMAGE                                    COMMAND                  CREATED             STATUS                              PORTS               NAMES
5adea4b396e3        collabora/code:latest                    "/bin/sh -c 'bash st…"   8 hours ago         Up 29 minutes                       9980/tcp            collabora_online
19f150790691        adminer:latest                           "entrypoint.sh docke…"   8 hours ago         Up 29 minutes                       8080/tcp            adminer
c35f70bc89a4        redis:4-alpine                           "docker-entrypoint.s…"   8 hours ago         Up 29 minutes                       6379/tcp            redis
9b634a85333c        postgres:10-alpine                       "docker-entrypoint.s…"   8 hours ago         Up 29 minutes                       5432/tcp            nextcloud-db
056c990a40fd        portainer/portainer:latest               "/portainer --host u…"   8 hours ago         Up 29 minutes                       9000/tcp            portainer
40b7c98a5986        svendowideit/traefik-certdumper:latest   "/run.sh"                8 hours ago         Restarting (2) About a minute ago                       certdumper
54ec3efdde90        containrrr/watchtower:latest             "/watchtower --clean…"   8 hours ago         Up 29 minutes                       8080/tcp            watchtower
konradwalsh@nextcloud-server:/media/storage/nextcloud/traefik$ docker ps -a
CONTAINER ID        IMAGE                                    COMMAND                  CREATED             STATUS                           PORTS                                      NAMES
5adea4b396e3        collabora/code:latest                    "/bin/sh -c 'bash st…"   8 hours ago         Up 30 minutes                    9980/tcp                                   collabora_online
db65380d898d        nginx:alpine                             "nginx -g 'daemon of…"   8 hours ago         Exited (127) About an hour ago   80/tcp                                     nginx
979866488fe4        nextcloud:fpm-alpine                     "/entrypoint.sh php-…"   8 hours ago         Exited (127) About an hour ago   9000/tcp                                   nextcloud
19f150790691        adminer:latest                           "entrypoint.sh docke…"   8 hours ago         Up 30 minutes                    8080/tcp                                   adminer
c35f70bc89a4        redis:4-alpine                           "docker-entrypoint.s…"   8 hours ago         Up 30 minutes                    6379/tcp                                   redis
9b634a85333c        postgres:10-alpine                       "docker-entrypoint.s…"   8 hours ago         Up 30 minutes                    5432/tcp                                   nextcloud-db
056c990a40fd        portainer/portainer:latest               "/portainer --host u…"   8 hours ago         Up 30 minutes                    9000/tcp                                   portainer
40b7c98a5986        svendowideit/traefik-certdumper:latest   "/run.sh"                8 hours ago         Restarting (2) 42 seconds ago                                               certdumper
2693b444d151        traefik:1.7-alpine                       "/entrypoint.sh trae…"   8 hours ago         Exited (127) About an hour ago   0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp   traefik
54ec3efdde90        containrrr/watchtower:latest             "/watchtower --clean…"   8 hours ago         Up 30 minutes                    8080/tcp                                   watchtower
`
ReinerNippes commented 4 years ago

By the task that includes line 13 of roles/docker_container/tasks/traefik.yml

https://github.com/ReinerNippes/nextcloud_on_docker/blob/bab3d3b24a83ec87fcfed9ad230e3eb186ee10df/roles/docker_container/tasks/traefik.yml#L13

in the folder /media/storage/nextcloud/traefik a file acme.json is created. (touch)

The reason is that traefik needs a file to store the certificates of your side but can't create that file.

In line 40 this file is bind as a volume to the traefik container.

https://github.com/ReinerNippes/nextcloud_on_docker/blob/bab3d3b24a83ec87fcfed9ad230e3eb186ee10df/roles/docker_container/tasks/traefik.yml#L40

In line 50 of the traefik.toml file the name of the certificate storage file is defined as acme.json.

https://github.com/ReinerNippes/nextcloud_on_docker/blob/bab3d3b24a83ec87fcfed9ad230e3eb186ee10df/roles/docker_container/templates/traefik.toml.j2#L57

May you please check the content of the traefik folder?

sudo ls -la /media/storage/nextcloud/traefik/