Readit News logoReadit News
azernik · 8 months ago
Even worse is the all-decimal MAC problem.

Some genius decided that, to make time input convenient, YAML would parse HH:MM:SS as SS + 60×MM + 60×60×HH. So you could enter 1:23:45 and it would give you the correct number of seconds in 1 hour, 23 minutes, and 45 seconds.

They neglected to put a maximum on the number of such sexagesimal places, so if you put, say, six numbers separated by colons like this, it would be parsed as a very large integer.

Imagine my surprise when, while working at a networking company, we had some devices which failed to configure their MAC addresses in YAML! After this YAML config file had been working for literal years! (I believe this was via netplan? It's been like a decade, I don't remember.)

Turns out, if an unquoted MAC address had even a single non-decimal hex digit, it would do what we expected (parse as a string). This is not only by FAR the more common case, but also we had an A in our vendor prefix, so we never ran into this "feature" during initial development.

Then one day we ran out of MAC addresses and got a new vendor prefix. This time it didn't have any letters in it. Hilarity ensued.

(This behavior has thankfully been removed in more recent YAML standards.)

weinzierl · 8 months ago
Perl has a Poland Problem. The customary file extension for Perl files is *.pl. This worked well until Apache introduced content negotiation and the convention to add a language code as file extension. It had index.html.en, index.html.de, for example.

index.html.pl is where the problem started and the reason why the officially recommended file extension for Perl files used to be (still is?) *.plx.

I don't have the Camel book at hand, but Randal Schwartz's Learning Perl 5th edition says:

"Perl doesn't require any special kind of filename or extension, and it's better not to use an extension at all. But some systems may require an extension like plx (meaning PerL eXecutable); see your system's release notes for more information."

dtech · 8 months ago
That sounds more like an Apache problem than a Perl problem. It's their mistake and it's not even relevant outside Apache context
maxloh · 8 months ago
That should be marked as a breaking change on Apache side IMO. It would be a security nightmare if server code were leaked to public.
weinzierl · 8 months ago
It should have been an Apache problem, yes. Not only did it turn out that at least the language negotiation part of content negotiation wasn't the best idea but the way Apache handled it was problematic apart from the pl problem. In the end the Perl community took the issue upon them, so historically I'd say it was a Perl problem (of choice).
ginko · 8 months ago
Also, Prolog has the Perl problem. :)
weinzierl · 8 months ago
Yes, I think Prolog had pl even before Perl came around, but Perl snatched it away,
gnabgib · 8 months ago
Related

The YAML document from hell (566 points, 2023, 353 comments) https://news.ycombinator.com/item?id=34351503

That's a Lot of YAML (429 points, 2023, 478 comments) https://news.ycombinator.com/item?id=37687060

No YAML (Same as above) (152 points, 2021, 149 comments) https://news.ycombinator.com/item?id=29019361

mdaniel · 8 months ago
And some light commentary a few days ago: https://news.ycombinator.com/item?id=43648263 - Apr 2025 (51 comments)
pkkm · 8 months ago
Programming with string templates, in a highly complex and footgun-rich markup language, is one of the things I find most offputting about the DevOps ecosystem.
sph · 8 months ago
I believe Satan itself decided to mix YAML, Jinja and Turing-complete logic when it created Ansible. It truly is the sendmail of the modern era.
senderista · 8 months ago
Several years ago when I was writing a deployment system for a cloud distributed database, I tried to automate everything with Ansible playbooks and the Ansible "API" (LOL). I pretty quickly gave up on implementing anything but the most trivial logic in templated YAML and switched to Python (wrapping maximally-dumb Ansible playbooks) for everything nontrivial.
Fizzadar · 8 months ago
You might like pyinfra.
nicktelford · 8 months ago
This is why I generally use Terraform for Kubernetes. It's not perfect, but it's miles better than the various different YAML-templating solutions (Kustomize, Helm) popular in the Kubernetes ecosystem.
mdaniel · 8 months ago
Two different stateful recordkeeping control planes with disparate opinions about the current state of the world. What can go wrong.
anvandare · 8 months ago
"The limits of my keyboard mean the limits of my programming language."

If only they had had ⊥ and ⊤ somewhere on their keys to work with Booleans directly while designing the languages. In another branch of history, perchance.[1]

[1] https://en.wikipedia.org/wiki/APL_(programming_language)#/me...

tossandthrow · 8 months ago
⊥ and ⊤ is not entirely congruent to false and true.

Boolean and propositional logic is not the same.

Q6T46nT668w6i3m · 8 months ago
For _ordinary_ two‑valued classical propositional logic, e.g., YAML, they are congruent.
rusk · 8 months ago
I have an emacs macro for this
whacko_quacko · 8 months ago
Pandas has a Nigeria problem, where NA -> NaN.

It's not that bad, because you can explicitly turn that behavior off, but ask me how I know =(

orangewindies · 8 months ago
That's a Namibia problem, Nigeria is NG.
whacko_quacko · 8 months ago
Damn, you're right ^^' Thanks for pointing that out
trueismywork · 8 months ago
How?
whacko_quacko · 8 months ago
For example when reading a CSV. Try using `read_csv` on a file that contains two letter country codes including NA.
alkonaut · 8 months ago
Always quote all yaml strings. If you have a yaml file that has something that isn't a simple value (number, boolean) such as for example a date, time, ip-address, mac address, country code, phone number, server name, configuration name, etc. etc. then you are asking for trouble. Just DON'T DO THAT. It's pretty simple.

"Yeah but it's so convenient"

"Yeah but the benefit of yaml is that you don't need quotes everywhere so that it's more human readable"

DON'T

ohgr · 8 months ago
Yeah that.

00,01,02,03,04,05,06,07,OH SHIT

ashishb · 8 months ago
How often do people even encounter this issue? I have been using YAML for 5+ years and have never had it before. Further, I use `yamllint` which points this out as a lint issue "truthy value should be one of [false, true]".
tetha · 8 months ago
I don't recall encountering the norway problem in the wild.

Ansible has a pretty common issue with file permissions, because pretty much every numeric representation of a file mode is a valid number in YAML - and most of them are not what you want.

Sure, we can open up a whole 'nother can of worms if we should be programming infrastructure provisioning in YAML, but it's what we have. Chef with Ruby had much more severe issues once people started to abuse it.

Plus, ansible-lint flags that reliably.

hinkley · 8 months ago
Fractions are discriminatory when they happen to one individual or group every time or even just the first time.

See also p95 but the same couple of users always see the p99 time, due to some bug.

ashishb · 8 months ago
Indeed, based on the comments, it is a scissor-bug. Most people never encountered it while some encountered it a lot.
rat87 · 8 months ago
I have when getting an openapi yaml file from someone else.
jeltz · 8 months ago
I have seen it twice but I work in Sweden where we often do things also for the Norwegian market.
mongol · 8 months ago
Has been encountered where I work. A global website with lots of country-specific config.
speedgoose · 8 months ago
I have encountered it once, though I live in Norway and worked in IT there for a decade.
Y-bar · 8 months ago
Never experienced it for the past 10+ years since the bug was fixed in the spec.
Y_Y · 8 months ago
I don't think false is truthy.
peanut-walrus · 8 months ago
I for one did encounter exactly this problem when configuring a list of countries via ansible for geoip whitelisting.