Docker Compose: Cannot start service ziti-controller-init-container:

Not sure what is causing this error when I run the docker compose command.

Its using /openziti/scripts/access-control.sh

instead of /image/access-control.sh file from what I observe.

sudo docker-compose -f /home/opc/demo/ziti/quickstart/docker/docker-compose.yml up

Creating network “docker_zitiblue” with driver “bridge”
Creating network “docker_zitired” with driver “bridge”
Creating volume “docker_ziti-fs” with default driver
Creating docker_ziti-controller_1 … done
Creating docker_web-test-blue_1 … done
Creating docker_ziti-console_1 … done
Creating docker_postgres-db_1 … done
Creating docker_ziti-controller-init-container_1 … error
Creating docker_ziti-edge-router-wss_1 … done
Creating docker_ziti-fabric-router-br_1 … done
Creating docker_ziti-edge-router_1 … done
Creating docker_ziti-private-red_1 … done
Creating docker_ziti-private-blue_1 … done

ERROR: for docker_ziti-controller-init-container_1 Cannot start service ziti-controller-init-container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: “/openziti/scripts/access-control.sh”: stat /openziti/scripts/access-control.sh: no such file or directory: unknown

ERROR: for ziti-controller-init-container Cannot start service ziti-controller-init-container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: “/openziti/scripts/access-control.sh”: stat /openziti/scripts/access-control.sh: no such file or directory: unknown
ERROR: Encountered errors while bringing up the project.

ahh… I noticed that those are specified in the yaml file… will update and try again.

I just cloned the repository… so I was not expecting this to be required

hmm. just realised that this directory is listed in the Docker file… maybe something is going wrong there

Did not change anything… still have the same error…

Any tips to resolve?

I have not had this problem, and I started with a clean slate yesterday. Running docker-compose up, I get this…

ziti-console_1                    | ZAC will present this pem for TLS: /openziti/pki/ziti-controller-intermediate/certs/ziti-controller-server.cert
ziti-controller-init-container_1  |  
ziti-controller-init-container_1  | *****************************************************
ziti-controller-init-container_1  |  docker-compose init file has been detected
ziti-controller-init-container_1  |  the initialization of the docker-compose environment has already happened
ziti-controller-init-container_1  |  if you wish to allow this volume to be re-initialized, delete the file
ziti-controller-init-container_1  |  located at /openziti/access-control.init
ziti-controller-init-container_1  | *****************************************************
ziti-controller-init-container_1  |  

I grabbed the docker compose file as per curl link on Local - Docker Compose | Ziti

This is my docker-compose section

  ziti-controller-init-container:
    image: "${ZITI_IMAGE}:${ZITI_VERSION}"
    depends_on:
      - ziti-controller
    environment:
      - ZITI_CONTROLLER_RAWNAME="${ZITI_CONTROLLER_RAWNAME}"
      - ZITI_EDGE_CONTROLLER_RAWNAME="${ZITI_EDGE_CONTROLLER_RAWNAME}"
    env_file:
      - ./.env
    networks:
      zitiblue:
        aliases:
          - ziti-edge-controller-init-container
      zitired:
        aliases:
          - ziti-edge-controller-init-container
    volumes:
      - ziti-fs:/openziti
    entrypoint:
      - "/openziti/scripts/access-control.sh"

Try a docker-compose pull to ensure you are running the latest versions of the containers. By default, the version is latest which wont update when new releases are done. When you are in the zac, run a ziti version and it should be 0.25.10.

If it is not, then update to the later containers. The containers were updated only in the last few days.

hmm.. I think it was something related to the extra entries I added in re replication the postgres example..

I had a problem with the ziticontrol reference and commented it out
not sure what this should be for it to work

postgres-db:
image: postgres
#ports:

- 5432:5432

networks:
#- ziticontrol
- zitiblue
volumes:
- ./data/db:/var/lib/postgresql/data
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres

all up an running now… I realised that maybe… #- ziticontrol was the problem…

As soon as I deleted it… all working as expected :slight_smile:

One thing that I have noticed is the need to manually override the settings for ZITI_BIN_DIR

as shown below.. it doubles up on a folder directory

[opc@instance-20220518-1244 docker]$ source /dev/stdin <<< "$(wget -qO- https://raw.githubusercontent.com/openziti/ziti/release-next/quickstart/docker/image/ziti-cli-functions.sh)"; getZiti

ZITI_BINARIES_VERSION: v0.25.10

Using ZITI_BIN_DIR: /home/opc/.ziti/quickstart//ziti-bin/ziti-v0.25.10/ziti-bin/ziti-v0.25.10

Ps… there is also a double // in the file path .

Marking executables at /home/opc/.ziti/quickstart//ziti-bin/ziti-v0.25.10 executable