Troubleshooting
Organised the way chapter 8 taught: by the stage where the run stops. Find the last good line in cloudflared's output; the trouble is in the stage that follows it. Every entry drawn from the lab is marked with its transcript; the rest are the documented failures of the later stages the lab could not reach.
Stage one: provisioning and login
"quick tunnel provisioning failed with status 403" (transcript t03). The provisioning service refused your network. Not a typo, not a setting: Cloudflare's abuse defences block whole networks at times, and sandboxes, datacentres and some VPN exits are usual suspects. Try from a plain home connection; if it follows you there, it is still a "their side" problem — wait, or move to a named tunnel, whose provisioning is your account's standing rather than a stranger's free sample.
The same step times out instead
(transcript t02). A timeout means the
request went somewhere and was never
answered — in the lab, into an HTTP
proxy cloudflared had inherited from
environment variables. If your machine
sets http_proxy/https_proxy (schools,
offices, sandboxes), that call goes via
the proxy too; test with the variables
removed for cloudflared alone — the
answer changing from silence to a clean
403 (as the lab's did) tells you the
proxy was the fog, whatever the
underlying weather.
"Cannot determine default origin
certificate path" (transcript t06).
You have not completed cloudflared
tunnel login on this machine or as this
user, or cert.pem was moved. The
message lists the five places it looked;
the fix is login (chapter 5), not
copying someone else's file.
Stage two: the config file
"The last ingress rule must match all
URLs" (transcript t04). Your rules end
without a catch-all. Add
- service: http_status:404 — or
whatever your deliberate default is —
as the final rule.
"is an invalid address" (transcript
t04). A service is missing its scheme:
localhost:8080 is a word to the
validator; http://localhost:8080 is an
address.
A YAML parse error naming a line (transcript t04). Indentation, almost always — YAML counts spaces, and a rule knocked one level sideways fails exactly like the lab's. Fix the spacing; the parser's line number is honest.
ingress validate appears to hang
(transcript t10). It is reading rules as
JSON from standard input because no
config was given to it. Pass --config,
or Ctrl-C; nothing is broken.
The rules check out but requests land
wrong. Stop reading the file and ask
it: ingress rule <the-full-url>
(transcript t05) prints the rule that
would answer, which is usually not the
rule you were staring at — an earlier,
broader rule is winning, per
first-match-wins.
Stage three: connecting
Connection errors that name QUIC, or
timeouts registering connections. The
edge's UDP 7844 is not getting through —
a router, an ISP, or a firewall that
handles UDP poorly (chapter 8's probe
three is the extreme case: the operating
system itself refusing). Run with
--protocol http2 and see if the tunnel
stands up on TCP. If forcing HTTP/2
changes nothing at all — same error,
same place — suspect an earlier stage:
chapter 4's lesson is that provisioning
refusals are indifferent to --protocol.
Intermittent disconnects on a running tunnel. Usually plumbing, not malice: a router with a short UDP timeout shedding QUIC state (another vote for HTTP/2), a machine sleeping (a tunnel is a process; a sleeping laptop hosts nothing), or the broadband itself. cloudflared retries on its own; a pattern in the log's times of day is the clue worth chasing.
Stage four: serving
Visitors get error 1033. The
hostname is routed but no connector is
running: cloudflared is stopped, the
machine is off, or the service was never
installed (chapter 7). Check
cloudflared tunnel list for the
tunnel's connections and the machine for
the process.
Visitors get 502. The corridor is
open and the room is shut: cloudflared
reached out to the origin and the origin
refused or did not answer. Check the
origin from the machine cloudflared
runs on, at the exact address in the
ingress rule — localhost in the rule
means cloudflared's machine, not the
visitor's and not yours-from-the-sofa.
The wrong service answers. Two origins, one tunnel, and a rule matching more than its author intended — ask the file (stage two, last entry) with the exact URL that went wrong.
A hostname answers with someone else's
Cloudflare error or the wrong site.
DNS, not the tunnel: a stale record for
the name predating route dns (which
refuses to overwrite without
--overwrite-dns), or the name pointed
at a different tunnel. The zone's records
say what is true.