My Website Was Fine Until I Let a Chatbot Look at It
TL;DR: A chatbot changed one number in a config file I didn't understand, and I only found out because I eventually learned what the file was for. I host my website on a Raspberry Pi at home, behind a Cloudflare Tunnel,
TL;DR: A chatbot changed one number in a config file I didn't understand, and I only found out because I eventually learned what the file was for.
I host my website on a Raspberry Pi at home, behind a Cloudflare Tunnel, and for a while all of that worked perfectly. Then two or three days ago the site started showing a 404, and I began a three-act tragedy in which I was the main character and also, indirectly, the villain.
Act 1: In which I understand nothing
I had set up the Tunnel by asking Gemini to make it work and pasting whatever came back, which a hiring manager might call rapid prototyping and which I would more accurately call typing commands I didn't understand into the machine that holds my entire website. I was also trying to get CI/CD going at the time, meaning a GitHub runner that would SSH into the Pi and deploy for me, but the pipeline doesn't exist yet and is currently more of a rumor, so the broken website understandably took priority over it, since a 404 on my own domain is considerably more embarrassing than a deploy script I haven't written.
Act 2: In which I consult the machine that probably broke it
I handed my config.yml to the chatbot and told it, more or less, that something was broken and it should find the problem, and what I completely failed to mention is that the website had been working three days earlier. That detail turns the whole question from "what is wrong with this setup?" into "what changed?", which is a much better question, and by leaving it out I basically asked a very eager assistant to go fix something that had no reason to need fixing.
It found something to fix anyway, because that is what these tools do when you say the word broken, and the thing it touched was the port number in my ingress rules. I know for certain that the AI did this and not me, because I had to google what "ingress" even means, and a person who needs a search engine to define a word in their own config file is not a person who confidently edited it by hand. I can't show you a before-and-after diff, since my Pi has no version control and no backups of any previous config, so the entire audit trail of this incident is me being absolutely sure.
Act 3: In which I learn a Linux command that has existed for decades
I had a theory that it was a port problem, but I couldn't confirm it because I didn't know the commands and I'm still learning Linux, so I asked the same AI how to check, which is a little like asking the arsonist for directions to the fire department but did work out in the end. The answer was ss -tlpn, a one-line command that lists which programs are listening on which ports, and it showed my app sitting happily on port 80.
Then I looked at what my Cloudflare config was actually pointing at:
service: http://localhost:8000
My app lived on port 80 and my Tunnel was delivering every visitor to port 8000, where absolutely nothing was waiting, so Cloudflare was essentially a very reliable courier bringing packages to the wrong address, with me as the person who supplied the address, or at least the person who failed to check it. I changed 8000 back to 80, restarted cloudflared, and the site came back, so the fix was a single number and the time it took me to find it was not something I'm going to put on my resume.
What a Tunnel actually is (now that I know)
I did go read up on how this works, and it's smarter than I expected. The usual way to put a home server on the internet is to expose your home IP and open ports on your router, which is exactly the kind of thing you'd rather not do from the same network where you also stream TV, and a Tunnel avoids all of it by flipping the direction of the connection: a small daemon called cloudflared runs on the Pi and dials out to Cloudflare, and when someone visits my domain, Cloudflare sends their request back down that already-open connection to my Pi, which means no inbound ports, no exposed home IP, and a free HTTPS certificate as a bonus.
My first attempt at explaining this, in a voice memo, was a confused mess about VPNs and certificates, and my second attempt was actually correct, which I'm choosing to take as proof that reading things works.
The part that actually mattered is that a Tunnel has two links, one from Cloudflare to cloudflared and one from cloudflared to my app, and the first link was healthy the entire time while the second was pointed at nothing, which is a failure that "Tunnel: connected" on the dashboard will never tell you about.
What I learned
- Tell the debugger the history. "It worked three days ago" is probably the most useful sentence in any bug report, and I left it out of mine.
- Don't hand a working config to an AI and tell it that it's broken. It will go looking for a bug, and sometimes the bug it finds is the one it creates.
- Put the config in version control. Git on the Pi is now an urgent personal project, because "I'm sure it changed" is not evidence.
- A connected tunnel does not mean a working site. There are two links, which means two places to fail.
-
Learn
ss -tlpn. It's one line, it has been around longer than my interest in computers, and it would have saved me a lot of grief.
The site is back up, the pipeline is still a rumor, and I'm told that everyone goes through this at some point, although mostly I'm told it by people who have version control.
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.