State: Offline State: Authentication State: Error

Hi All, I got a message to upgrade the connector. I’m running 2 connectors on 2 different ubuntu VMs. I removed the old container and ran the command to create a new on (based on the documentation). The new image was downloaded but I got this error: State: Offline State: Authentication State: Error.

I deleted the container again, refreshed the tokens and tried again but i got the same result.

Any ideas?

I’m using the following docker-compose.yml

services:
twingate_connector:
container_name: twingate-amorphous-caribou
restart: always
image: “twingate/connector:latest”
environment:
- SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
- TWINGATE_API_ENDPOINT=/connector.stock
- TWINGATE_NETWORK=“MY NETWOK HERE”
- TWINGATE_ACCESS_TOKEN=“MY ACCESS TOKEN HERE”
- TWINGATE_REFRESH_TOKEN=“MY REFRESH TOKEN HERE”
- TWINGATE_LOG_LEVEL=7
sysctls:
net.ipv4.ping_group_range: “0 2147483647”

Here are the logs:

$ docker-compose up
Starting twingate-amorphous-caribou … done
Attaching to twingate-amorphous-caribou
twingate-amorphous-caribou | [INFO] [connector] starting crash reporting service
twingate-amorphous-caribou | [INFO] [connector] initializing sdwan
twingate-amorphous-caribou | [DEBUG] [libsdwan] sdwan_new() config: {“controller”:{“mode”:“access”,“url”:“https://"mine705".twingate.com”,“type”:“enterprise”,“app_version”:“1.56.0”},“modules”:{“viper”:{“nat”:{“log-level”:“DEBUG”},“dns-proxy”:{“enable-netbios”:1,“proxy-rules”:[{“type”:“bypass”,“route_id”:0,“default”:1}]},“generic-proxy”:{“session-table-size”:“1024”,“proxy-rules”:[{“type”:“bypass”,“route_id”:0,“default”:1}],“plugin-chain”:[{“name”:“gnrprx”}]}},“tranceport”:{“ssl”:{“ciphers”:“ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384”,“curves”:“P-256:P-384:P-521”,“sigalgs”:“ECDSA+SHA256:ECDSA+SHA384:ECDSA+SHA512:RSA+SHA256:RSA+SHA384:RSA+SHA512:RSA-PSS+SHA256:RSA-PSS+SHA384:RSA-PSS+SHA512”,“server_auth”:0,“client_auth”:0},“dequeue”:1,“dequeue_r”:0,“enqueue”:3,“enqueue_r”:0,“reorder_stats”:100,“vlink_idle_time”:10,“frontend”:{“flush”:1,“flush_type”:1,“max_queue”:65536,“pools”:[{“impl”:“local”,“id”:3,“link”:“bev_http”,“connect_str”:1},{“impl”:“local”,“id”:5,“link”:“bev_tcp”},{“impl”:“local”,“id”:6,“link”:“bev_udp”}]},“backend”:{“flush”:1,“flush_type”:1,“max_queue”:65536,“pools”:[{“impl”:“local”,“id”:6,“link”:“udp_proxy”},{“id”:10,“impl”:“local”,“link”:“tcp_proxy”,“https_skipencrypt”:1},{“impl”:“local”,“id”:8,“link”:“packet”}]}}},“sdwan”:{“loglevel”:7,“loglevel_console”:-1,“ca_path”:null,“timestamp_fmt”:0,“log_analytics”:“”},“afvpn”:{“dns”:null}}
twingate-amorphous-caribou | [DEBUG] [libsdwan] crypto_module_load_ca: loaded 2 trusted certificates from “default”
twingate-amorphous-caribou | [DEBUG] [libsdwan] crypto_module_new: available cipher suites:“ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384”, curves: “P-256:P-384:P-521”
twingate-amorphous-caribou | [WARNING] [libsdwan] [controller] set_external_tokens: failed to get access token: token invalid Invalid input: not within alphabet
twingate-amorphous-caribou | [WARNING] [libsdwan] [controller] controller_t: failed to set access, refresh and device tokens: token invalid Invalid input: not within alphabet
twingate-amorphous-caribou | [DEBUG] [libsdwan] [quic] init: new instance
twingate-amorphous-caribou | [DEBUG] [libsdwan] [quic] on_accept: enabling server
twingate-amorphous-caribou | [DEBUG] [libsdwan] reconfigure_direct_connect_socket: set the size of UDP socket buffers to 4194304 bytes
twingate-amorphous-caribou | [DEBUG] [libsdwan] reconfigure_direct_connect_socket: reconfigured direct connect socket
twingate-amorphous-caribou | [INFO] [libsdwan] sdwan_new: libsdwan_version=0.146.0, app_version=1.56.0, platform=Linux-x86_64
twingate-amorphous-caribou | [INFO] [connector] started server on /connector.stock
twingate-amorphous-caribou | [INFO] [libsdwan] sdwan_state: Offline
twingate-amorphous-caribou | [DEBUG] [libsdwan] [controller] run_state_machine: Offline
twingate-amorphous-caribou | [DEBUG] [libsdwan] [controller] set_state: switching from “Offline” to “Getting public keys”
twingate-amorphous-caribou | [State: Offline
twingate-amorphous-caribou | INFO] [libsdwan] sdwan_state: Authenticating
twingate-amorphous-caribou | State: Authentication
twingate-amorphous-caribou | [DEBUG] [libsdwan] [controller] get_controller_keys: fetching controller public keys…
twingate-amorphous-caribou | [DEBUG] [libsdwan] send: sending HTTP request 13643700535190068608
twingate-amorphous-caribou | [DEBUG] [libsdwan] http::request::send_request: malformed url
twingate-amorphous-caribou | [WARNING] [libsdwan] operator(): failed HTTP request 13643700535190068608 -1 malformed url
twingate-amorphous-caribou | [WARNING] [libsdwan] [controller] operator(): failed to get public keys: malformed url
twingate-amorphous-caribou | [DEBUG] [libsdwan] [controller] set_state: switching from “Getting public keys” to “Error”
twingate-amorphous-caribou | [INFO] [libsdwan] sdwan_state: Error
twingate-amorphous-caribou | State: Error
twingate-amorphous-caribou | [DEBUG] [libsdwan] [controller] run_state_machine: Error
twingate-amorphous-caribou | [DEBUG] [libsdwan] [controller] set_state: switching from “Error” to “Offline”
twingate-amorphous-caribou | [INFO] [libsdwan] sdwan_state: Offline
twingate-amorphous-caribou | State: Offline
twingate-amorphous-caribou | [DEBUG] [libsdwan] [controller] run_state_machine: Offline
twingate-amorphous-caribou | [DEBUG] [libsdwan] [controller] set_state: switching from “Offline” to “Getting public keys”
twingate-amorphous-caribou | [INFO] [libsdwan] sdwan_state: Authenticating
twingate-amorphous-caribou | State: Authentication
twingate-amorphous-caribou | [DEBUG] [libsdwan] [controller] get_controller_keys: fetching controller public keys…
twingate-amorphous-caribou | [DEBUG] [libsdwan] send: sending HTTP request 13643700535190068608
twingate-amorphous-caribou | [DEBUG] [libsdwan] http::request::send_request: malformed url
twingate-amorphous-caribou | [WARNING] [libsdwan] operator(): failed HTTP request 13643700535190068608 -1 malformed url
twingate-amorphous-caribou | [WARNING] [libsdwan] [controller] operator(): failed to get public keys: malformed url
twingate-amorphous-caribou | [DEBUG] [libsdwan] [controller] set_state: switching from “Getting public keys” to “Error”
twingate-amorphous-caribou | [INFO] [libsdwan] sdwan_state: Error
twingate-amorphous-caribou | State: Error
twingate-amorphous-caribou | [DEBUG] [libsdwan] [controller] run_state_machine: Error
twingate-amorphous-caribou | [DEBUG] [libsdwan] [controller] set_state: switching from “Error” to “Offline”
twingate-amorphous-caribou | [INFO] [libsdwan] sdwan_state: Offline
twingate-amorphous-caribou | State: Offline
twingate-amorphous-caribou | [DEBUGState: Authentication
twingate-amorphous-caribou | ] [libsdwan] [controller] run_state_machine: Offline
twingate-amorphous-caribou | [DEBUG] [libsdwan] [controller] set_state: switching from “Offline” to “Getting public keys”
twingate-amorphous-caribou | [INFO] [libsdwan] sdwan_state: Authenticating
twingate-amorphous-caribou | [DEBUG] [libsdwan] [controller] get_controller_keys: fetching controller public keys…
twingate-amorphous-caribou | [DEBUG] [libsdwan] send: sending HTTP request 13643700535190068608
twingate-amorphous-caribou | [DEBUG] [libsdwan] http::request::send_request: malformed url
twingate-amorphous-caribou | [WARNING] [libsdwan] operator(): failed HTTP request 13643700535190068608 -1 malformed url
twingate-amorphous-caribou | [WARNING] [libsdwan] [controller] operator(): failed to get public keys: malformed url
twingate-amorphous-caribou | [DEBUG] [libsdwan] [controller] set_state: switching from “Getting public keys” to “Error”
twingate-amorphous-caribou | [INFO] [libsdwan] sdwan_state: Error
twingate-amorphous-caribou | [DEBUG] [libsdwan] [controller] run_state_machine: Error
twingate-amorphous-caribou | State: Error
^CGracefully stopping… (press Ctrl+C again to force)

Hi, I am getting the same user error and also using docker compose yaml in Portainer. Seems an issue with the compose file.
To test, I tried several variations of TWINGATE_NETWORK. just network name, the full url with https:// and fqdn (no https://).

Everything is identical to your compose yaml.

Awaiting a response from the community.

Looking at the log I can see this:

{“mode”:“access”,“url”:“https://“mine705”.twingate.com”,“type”:“enterprise”,“app_version”:“1.56.0”},“modules”:{“viper”:{“nat”:{“log-level”:“DEBUG”},“dns-proxy”:{“enable-netbios”:1,“proxy-rules”:[{“type”:“bypass”,“route_id”:0,“default”:1}]}

Your network name seems to be wrapped in additional double quotes which is likely causing the issue, see if using single quotes in your Docker Compose file helps, ie

-TWINGATE_NETWORK=‘mine705’

Also double check the values for your token, there’s another error that it seems to be throwing not within alphabet which makes me think the same thing is happening with those two variables as well.

TWINGATE_NETWORK is specific to what we call your “slug”, or just the unique name that’s used when you login to Twingate either through the website or the Client on your machine. Check your output and if same as above it looks like it’s including the double-quotes try replacing them with single-quotes in your Docker Compose screen in Portainer, definitely make sure to not include https:// or .twingate.com for this variable though, just your unique network name.

SOLVED
Hi Ben, yes the problem is with quotes, cannot use any quotes single or double. Applies to the tokens also.

Thank you

Thank you all, no quotes for the name and tokens did it.

I’m so pleased I came accross this thread. I also had the same issue, I was tearing my hair out. Removed quotes (single or double) from my name and tokens and all now working :slight_smile:

I think it would be helpful to mention ‘no quotes required’ on the official instruction page.