Token is malformed when attempting to start router

Hello, similar to Ziti-Router Deployment Error - #2 by TheLumberjack I’m having an issue trying to spin up an edge router with the error token is malformed: could not base64 decode header: illegal base64 data at input byte 0

I’ve been following the docs at Deploy the Router with Docker | NetFoundry Documentation and have used docker compose for the controller with a FQDN.

The only difference is that I’ve set the environment variables in a .env instead of setting them in the commandline before docker compose up (trying inline didn’t work either).

On the controller side, I’ve entered the docker instance and created an edge router token like so:

docker exec -it ziti-controller-ziti-controller-1 bash
ziti edge login FQDN_REDACTED:1280 -u admin -p PASS_REDACTED
ziti edge create edge-router "router1" --jwt-output-file=./router1.jwt
exit
docker cp ziti-controller-ziti-controller-1:/home/ziggy/router1.jwt .
docker compose up

My .env file for the router is like so:

ZITI_ENROLL_TOKEN="$(<./router1.jwt)"
ZITI_ROUTER_ADVERTISED_ADDRESS=ROUTER_FQDN_REDACTED
ZITI_ROUTER_PORT=3022

Checking the jwt file in https://jwt.io results in a properly decoded header and payload:

{
  "iss": "https://FQDN_REDACTED:1280",
  "sub": "REDACTED",
  "aud": [
    ""
  ],
  "exp": 1766512399,
  "jti": "REDACTED",
  "em": "erott",
  "ctrls": [
    "tls:FQDN_REDACTED:1280"
  ]
}

Just curious what I might be doing wrong?

  • Ubuntu 24.04.3 LTS
  • Docker version 29.1.3, build f52814d (apt install)
  • openziti/ziti-controller@sha256:babc5eb45df6e98fdc503ae2467c83de72e990bfd660ee76e6f1006e5213ef33
  • openziti/ziti-router@sha256:d6127862307314f3390cf73083feaf26291ceaa1432fea55ea38988d54fc6862