Running into ERROR: for ziti-edge-router-wss Docker-Compose

u22@laptop:~/oziti$ sudo docker version
[sudo] password for u22:
Client: Docker Engine - Community
 Version:           25.0.3
 API version:       1.44
 Go version:        go1.21.6
 Git commit:        4debf41
 Built:             Tue Feb  6 21:13:09 2024
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          25.0.3
  API version:      1.44 (minimum version 1.24)
  Go version:       go1.21.6
  Git commit:       f417435
  Built:            Tue Feb  6 21:13:09 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.28
  GitCommit:        ae07eda36dd25f8a1b98dfbf587313b99c0190bb
 runc:
  Version:          1.1.12
  GitCommit:        v1.1.12-0-g51d5e94
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
u22@laptop:~/oziti$ sudo docker compose version
Docker Compose version v2.24.6

Man I have a way with finding issues haha. Luck is never on my side. Sometimes an obsecure (to me) human issue but funny nonetheless

You're diagnosing this error from the controller startup, right?

I found that error in this post above.

I don't think I'm understanding the question correctly. Are you asking if I'm encountering this error upon a fresh run of docker compose? If so, yes. I'm using the .env in the Docker Compose quick start and using the simplified-docker-compose yaml. Right after the response you quoted, I made sure to stop all containers, prune all containers, run sudo docker compose down -v and then sudo docker compose up. Experiencing the same issue in Vbox and Proxmox on Ubuntu Server 22.04.1 live server and I selected minimized install upon configuration. Also I'm using a fresh new vm in Vbox and attempted a fresh new vm on proxmox as well.

You can retain ZITI_INTERFACE=0.0.0.0 (the default for that particular Compose file). That controls which network interfaces will listen for port forwarding to the container, and 0.0.0.0 means to listen on all interfaces. It will still work the way you want if you set it to the VBox guest's main IP address, as long as that IP address is reachable from the parent host.

I followed your script on my Ubuntu box and did not encounter the same problem.

That error message is what I'd expect if this part of the controller container's entrypoint script is running at an unexpected time, i.e., after the default admin user has already been created by initializing the database.

if [ ! -f "${ZITI_HOME}/access-control.init" ]; then
: ...
  # initialize the database with the admin user:
  "${ZITI_BIN_DIR}/ziti" controller edge init "${ZITI_HOME}/${ZITI_CTRL_NAME}.yaml" -u "${ZITI_USER}" -p "${ZITI_PWD}"

The only thing you might try adding to that is --remove-orphans, but that wouldn't make a difference unless you used docker compose run or had modified the Compose file.

Thanks for clarifying that the problem is recurring after a fresh start on Ubuntu Jammy. That may give me enough direction to reproduce the issue. I'll give it a go.

I retained ZITI_INTERFACE=0.0.0.0. I changed that when I was testing on the very first vm I was using. When I used the new vm's, I retained the original .env and yaml. I'm not sure how I may have initialized the database. I created a brand new vm and the very first commands I ran were the two curls for the yaml and .env and the next was sudo docker compose up. I understand I may be doing something wrong but I don't know what that may be.

EDIT: Just saw your second response about the clarification. No worries! Also, correct. I did not use docker compose run or modified any files (.env or yaml after most recent tests).

You're also welcome to play with this new toy: https://get.openziti.io/dock/all-in-one/compose.yml

It's a simplified quickstart with a single container after bootstrapping.

Here's the doc: ziti/quickstart/docker/all-in-one at release-next · openziti/ziti · GitHub

Oooo awesome! I'll use the same vm and if I still encounter an issue, I'll go ahead and create another fresh vm on 22.04.1 and report back.

Suppose your VBox guest's main IP address is 10.11.12.13 and you want to run the Ziti quickstart over there on the guest and use Ziti from the VBox host.

You need to set the advertised address so that your VBox host will know where to look for the Ziti controller and router.

For example,

EXTERNAL_DNS=ziti.10.11.12.13.sslip.io docker compose up --detach (or create an .env file with your variable[s]).

I used the sslip.io domain name (magic wildcard DNS) for this example to avoid hacking the hosts db, running a DNS server, or using a plain IP address, which would require some extra steps.

Ah okay. Just to clarify, is this for the all in one or is this the issue I was running into previously?

All-in-one. I should've started a separate thread for that idea to work them in parallel. Still happy to do that. Just let me know which way you're going.

Ah okay okay! Yea so far the all in one has been great! Running just fine but trying to currently find out why docker isn't mounting ./quickstart to my local filesystem. I can exec into the container and I'm assuming ./persistent in the container is what ./quickstart is supposed to be? But yea, I'd love to continue on the all-in-one path since this is working for me currently haha.

Seems like the one you linked isn't up to date with the one in the repo. Had to uncomment the line under the "store the quickstart..." comment in two places to get the mount to work properly with the config files, pki, etc etc

volumes:
    # store the quickstart state in a named volume; this mount must align with the "quickstart" service's mount
    - persistent:/persistent
    # store the quickstart state on the Docker host in the same directory as this compose.yml file
    # - ./persistent:/persistent

Seems like the one in the repo fixes this issue. Well, from the looks of it. I'll pull that one too and check it

Refer to comment below

This line and this line need to change to - ./${ZITI_HOME:-ziti_home}:/home/ziggy to properly mount on local fs. With the change being adding './' before '${ZITI_HOME:-ziti_home}'.

Apologies, covered in the doc linked. This command covers that: ZITI_HOME=./quickstart docker compose up

1 Like

That's correct! Nice find about qualifying the relative (or absolute) path inside the ZITI_HOME var when overriding the container's internal storage with a Docker host path.

Another eagle eye observation that https://get.openziti.io/dock/all-in-one/compose.yml is stale, so I'm glad you found the much improved compose.yml from the repo: https://raw.githubusercontent.com/openziti/ziti/release-next/quickstart/docker/all-in-one/compose.yml