# My site was down for 4 days while every health check said it was fine

> After a reboot, cloudflared showed Running and localhost was fine, yet the site was unreachable for 4 days. The timeline and the fix.

- Date: 2026-11-09
- Topics: DevOps
- Chinese original: https://kbs0830.com/blog/tunnel-down-four-days

This site runs on a desktop PC at home. Windows Task Scheduler starts Node.js at boot, a Cloudflare Tunnel brings outside traffic in, and a watchdog script checks the site every 5 minutes and restarts it if it is down.

It sounds complete. Then on November 2, while digging through `server.log` for an unrelated problem, I found that the site had been unreachable from the outside for almost 4 days.

## Start with the timeline

Lining up the logs (Taiwan time):

- **Oct 29, 02:10** UptimeRobot's last `HEAD /`. After that it never shows up again
- **Oct 29, 02:15 and 02:17** The Next.js server restarts twice. Windows reports a boot time of 02:16: the PC rebooted on its own
- **Oct 29 to Nov 2** Not a single request from outside
- **Nov 2, 01:52** I restart cloudflared by hand and the tunnel comes back
- **Nov 2, 02:02** UptimeRobot's `HEAD /` returns

From 02:15 to 01:52 a week later is 8 minutes short of a full 4 days.

The strangest part is that `server.log` was not empty during those 4 days. This is what all of October 30 looked like:

```
288  GET /
864  GET /_next/static/*
```

288 is 24 hours times 12 per hour: exactly the watchdog hitting the home page every 5 minutes and then confirming that 3 JS chunks load. **The site itself was fine the whole time. Nobody except the watchdog could reach it.**

## Why the tunnel did not come back after the reboot

On Windows, Cloudflare Tunnel can be installed as a service. I had done that, and the service showed "Automatic, Running".

The problem was that the service's start command **had no arguments at all**. Just `cloudflared.exe`, without `tunnel --config ... run`. It started at boot, its status said Running, and it did nothing. What had actually been carrying the traffic all along was a black console window opened by a `start-server.bat` I ran by hand.

That window lived in my login session. When the PC rebooted, the window was gone, and with nobody logging in to click the bat file, nobody brought it back.

I had actually found this on October 15 and written one line in my to-do list: "after a reboot, nobody logs in to click the bat, the tunnel is down, the whole site is down". The fix was written too. It needed administrator rights, and I never got around to it. Two weeks later it happened for real.

## Why nobody did anything for 4 days

This is the part that bothers me more. I had three layers of monitoring. Two stayed silent, and I ignored the one that spoke up.

1. **The watchdog** checks `http://localhost:3000`. From the PC's own point of view the site was perfectly healthy, so it quietly confirmed "all good" every 5 minutes. It is designed to write a log line only when something is wrong, so `watchdog.log` has no entries for those 4 days.
2. **UptimeRobot** probes from outside, so it did notice and it did send alert emails. I received them and did nothing. (As an aside, its October report said 0% uptime for an outage of only 4 days, so that setup had its own problem.)
3. **Me.** The site is my portfolio. I do not open my own website every day.

There is not much to analyze about the UptimeRobot layer: that one is on me. The watchdog layer is more interesting. It was not broken. It worked exactly as designed. The trouble is that the question it answers is "is the server running", while what I actually want to know is "can a visitor open the site". Most of the time those two questions have the same answer. They only differ at moments like this one, which are exactly the moments monitoring exists for.

## What I changed

**1. The tunnel is now a Windows service that really does its job.** I wrote a script, `setup-autostart.ps1`, that runs as administrator and adds `tunnel --config ... run` to the service's start command. It also switches the scheduled tasks to "Run whether user is logged on or not". Otherwise, after a reboot with nobody logged in, even the watchdog and the automatic deploys would not run.

**2. The watchdog asks one more question.** Once localhost is healthy, it requests `https://kbs0830.com/` through the public internet. A failure there means "the server is fine but the outside cannot get in", and it emails me:

```powershell
# A broken origin is already handled above. This part only runs when the origin
# is healthy and asks: can the outside world reach it?
if ($exitCode -eq 0) {
    $public = Test-SiteHealth -Url "https://kbs0830.com/" -MaxWaitSeconds 30
    if (-not $public.Success) {
        $svc = (Get-Service Cloudflared -ErrorAction SilentlyContinue).Status
        Send-Alert -Key "tunnel" -Subject "Site unreachable from outside (origin OK, tunnel suspected)" ...
    }
}
```

It retries for up to 30 seconds, so a brief network blip does not raise a false alarm. The same problem sends at most one email per hour, plus a "recovered" email when it clears. It only sends email and does not restart the tunnel: a non-admin process cannot restart a Windows service, and the service already restarts itself after a crash.

**3. A real reboot test.** Changing the settings does not count until the machine has actually been rebooted. On November 6 I got the chance to do a full reboot without logging in: Next.js was up within 20 seconds of boot, the tunnel came back about 2 minutes 20 seconds later (it is a "delayed start" service), and the site opened from outside. Only then did I consider it fixed.

## What I learned

- **"The service is running" is not "the service is doing its job".** Running in the Windows service list only means the process is alive. To confirm that it is really working, look from the end it is supposed to serve.
- **Health checks belong where your users are.** A check from localhost proves only that localhost is fine.
- **For a monitor that logs only on failure, silence does not mean all is well.** It may simply be checking something that is not the thing that broke.
- **An alert nobody acts on is the same as no alert.** The emails my watchdog sends now state what broke and whether a human still needs to step in, and the tunnel one includes the first command to try. At least I no longer have the excuse of not understanding the message.
- **"A reboot will break this", written on a to-do list, does not go away by itself.** It is just waiting for a reboot.

---

Author: PINGWEI LI (李秉威, Li Ping-Wei)
Original page: https://kbs0830.com/en/blog/tunnel-down-four-days
