Live data from Hacker News

418 I'm a teapot

developer.mozilla.org

51–60 of 195 posts

Re: 418 I'm a teapot

#51
post #31

Earlier quoted context omitted.

It’s still in my production code, usually in places where i don’t expect code to ever lead to. It’s just my general “something particularly odd has happened” response.

I've never worked on a webserver but doesn't 500 seem better suited for that condition?

Yes. And write something to the logs, so you can find out there's a bug before users call your helpdesk. Arguably that's the most important part of any 5xx error.

It's a bit of a purist argument, but 4xx series means the client can fix something and get a better response.

Re: 418 I'm a teapot

#52
post #17

I honestly use this a lot when I'm testing, because it's basically the only response that can show up where I know god damned well that it's only happening because I programmed it to happen under certain conditions. edit: a common one for me is that if any test passes a post request without a csrf token... sorry, I'm a teapot, because I forgot to add a csrf token to that form.

Why not respond with an error message saying that there’s a missing CSRF token?

Re: 418 I'm a teapot

#53
post #51

Earlier quoted context omitted.

I've never worked on a webserver but doesn't 500 seem better suited for that condition?

Yes. And write something to the logs, so you can find out there's a bug before users call your helpdesk. Arguably that's the most important part of any 5xx error. It's a bit of a purist argument, but 4xx series means the client can fix something and get a better response.

Hmm, I don't think it's that purist. All my HTTP clients have the logic that 4xx is a non-retryable error, i.e. if I repeat the request I will always get the same response unless something is changed, whereas 5xx means that something is wrong on the backend and I should retry it later.

It is true I have often encountered inconsistencies in implementations but I do think that when that happens it really is a backend bug that should be fixed.

Re: 418 I'm a teapot

#54

I came across this a while back that I enjoyed but is kinda just an “lol” but not super useful status code thing: https://github.com/3digitdev/Haiku-TTP-Codes Doesn’t have any for 418 yet though… a PR may be in order!

Teapot's witty brew, HTTP 418, "I'm just a teapot."

Re: 418 I'm a teapot

#56
post #47

Every time this pops up, I'm reminded of the day that the NPM registry started returning 418 responses for users accessing it via corporate HTTP proxies. I remember being at a training course that day and my manager asking me what we could do to fix it because our CI was failing to pull dependencies from NPM. Trying to explain that NPM was returning a status code intended as an April Fools joke and which was never me…

I remember that day. As a more junior developer I was very confused as to what I had surely done wrong.

Re: 418 I'm a teapot

#57
post #23

I'm more amused by "A combined coffee/tea pot that is temporarily out of coffee should instead return 503 [Service Unavailable]".

Kinda thought this should respond 404

A 404 would mean that the client should not expect to find coffee there at all, which in this case would actually be better replaced by 418. However, if coffee can be found, just not right now, then it's the server's fault, so a 5xx code is in order, and 503 fits the bill best.

Re: 418 I'm a teapot

#58

There is no shortage of numbers. I wonder if it would make sense for every web-server ot have its own status-code if up and running? Of course they would have to be registered somewhere.

The whole point of protocols is to get the same results on the same situation regardless of server implementation. What could possibly be gained by returning intentionally different error codes?

Re: 418 I'm a teapot

#59
Many years ago, some person misconfigured their squid proxy and was hitting https://jsonip.com to the point my server at the time was turning green in the gills.

I started responding with 418 "You are a tea kettle" or something like that to those specific requests. The originating dev actually paid attention to their error messages and quickly resolved their config issue.

Fast forward to March this year. Some fucking numb nuts a-hole decided to add jsonip.com to an EXTREMELY widely used version of Dalvik/Android software that gets deployed to hundreds of thousands or millions of devices.

Overnight my traffic levels increased by 300%. I'm a solo dev offering a free service for 12 years. That kind of increase in traffic costs me money I've never had to plan for.

I ended up switching to Cloudeflare to handle the load with a WAF filter on the offending android tvs and other devices.

However Cloudflare doesn't properly route ipv4 address because "ipv6 is cool so we only do that" or something. Despite numerous support requests, that's still shmaybe an enterprise level feature.

I apologize to any long time users of the service. This was completely unexpected after more than a decade. I've been trying different "fixes" for 2 months and have not resolved a way to block this garbage traffic and still provide the original services.

Yea sorry I turned this funny old internet post about the mit coffee pot into a thing happening to me.

But if for some ungodly reason you're the dev or know who did it, REMOVE MY SERVICE ADDRESS FROM YOUR OUT OF DATE FROM TV/SMART DEVICE ANDROID code. You're literally fucking killing me. I've literally spend dozens of hours trying to find out if this was a contribution to a public source repo. Nothing.

Based on the Dalvik user agent, I only found a handful of references in Chinese repos. But google search is so terrible these days, even those are false flags.

So I have no idea who to contact about this. Some dipshit on your team(s) decided to abuse a free service as though there isn't a single human person behind it absorbing the costs and making sure it runs.

Re: 418 I'm a teapot

#60
post #59

Many years ago, some person misconfigured their squid proxy and was hitting https://jsonip.com to the point my server at the time was turning green in the gills. I started responding with 418 "You are a tea kettle" or something like that to those specific requests. The originating dev actually paid attention to their error messages and quickly resolved their config issue. Fast forward to March this year. Some fucking…

>as though there isn't a single human person behind it absorbing the costs and making sure it runs.

Obligatory https://xkcd.com/2347/

Post reply on HN