Cloudflare Tunnel CLI error

I receive the following error message when trying to create a cloudflare tunnel in a docker on unraid CLI.

This is the command I am running:

docker run -it --rm -v /mnt/user/appdata/cloudflared:/home/nonroot/.cloudflared/ cloudflare/cloudflared:2021.6.0 tunnel create TUNNELNAME

Error message:

failed to create tunnel: Create Tunnel API call failed: REST request failed: Post "https://api.cloudflare.com/client/v4/accounts/cde0088a4ff4c932cd94e1162a4d3fb2/tunnels": dial tcp: lookup api.cloudflare.com on [::1]:53: dial udp [::1]:53: connect: cannot assign requested address

When clicking the link in the error message it reads:

{"success":false,"errors":[{"code":9106,"message":"Missing X-Auth-Key, X-Auth-Email or Authorization headers"}]}

Thanks for any help.

You need to include the authentication in headers sent with the request, it can be your global API key using these headers…

X-Auth-Email: [email protected]
X-Auth-Key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

…or a token configured with the correct permissions…
Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxx

See here in your dashboard…
https://dash.cloudflare.com/profile/api-tokens

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.