Cloudflare Tunnel giving Unauthorized: Failed to get Tunnel

Hi, We are trying to use Cloudflare tunnel to tunnel out server from local machines.


This is the error that we get randomly
Even though there are correct credentials and I can confirm through Cloudflare API Endpoints that the tunnel is in fact created. What could be the issue?

I would try reauthenticating to see if that helps.

Wonder if it’s related to the recent incident from Cloudflare Status page:

1 Like

Negative, that status page refers to a 10min period today (18.25 → 18.35 UTC).

About the original issue in this thread: what is the Tunnel ID?

2 Likes

12214d3d-01b7-46e6-8526-f645fd109e3d

So I am not using the cloudflared tunnel CLI Auth. Instead I am creating the Tunnel through Cloudflare API Endpoints and then making DNS Changes. I use credentials data from the tunnel creation Endpoint and store it as a JSON File and then reference that for credentials in my config.yml

Gotcha. I’m going to defer to @nuno.diegues who works on the tunnel team.

1 Like

Your tunnel was deleted at “2022-10-18T17:13:48.994724Z”, which is why you are getting that error.
You can go to the dash.cloudflare.com Audit Logs to search for the “Cloudflare Tunnel Delete” event at that time to see the user in your account who did it.

2 Likes


The API Response at the time of incident from the Cloudflare Tunnel Endpoint shows that the Tunnel was in fact there.

The Tunnel is always available in the API. But it has “deleted_at” with a non-null date, which means the Tunnel is no longer connectable with cloudflared tunnel.

You can use the following query params to make sure you only get non-deleted Tunnels from the API: Cloudflare API v4 Documentation

2 Likes