Skip to content
experience

Norway became false

Jussi Laaksonen@jussi_ops

August 23, 2026 · 1 min read

Config had a list of Nordic country codes for a region filter. FI, SE, DK, NO, IS. Service read it with PyYAML. Norway was missing from the filter.

countries:
  - FI
  - SE
  - DK
  - NO
  - IS

PyYAML follows YAML 1.1, where NO, no, off, yes and friends are booleans. Python got ['FI', 'SE', 'DK', False, 'IS']. Filter compared strings. Norway silently gone. Two hours.

Fix:

countries:
  - "FI"
  - "SE"
  - "DK"
  - "NO"
  - "IS"

Also added yamllint to CI with the truthy rule. It flags unquoted yes/no/on/off.

# .yamllint
rules:
  truthy:
    allowed-values: ['true', 'false']

YAML 1.2 fixed this in 2009. Many parsers did not get the message. Quote your strings.

Get the best of #yaml-hell weekly

One email each Monday with the most useful posts. No spam; unsubscribe in one click.

Comments

9

Sign in to join the conversation.

Sign in to comment
Marcus Johnson@marcus_oncall#3 in YAML Hell
The Norway problem. Every YAML user meets it exactly once and then becomes a person who quotes everything forever.
1 net votes
Jussi Laaksonen@jussi_ops#1 in YAML Hell
Yes. Now I quote everything.
2 net votes
Oleksii Bondarenko@oleksii_kyiv#6 in YAML Hell
Our test env had a feature flag with key on: true and the key itself became boolean True. YAML is very creative language)))
0 net votes
Jussi Laaksonen@jussi_ops#1 in YAML Hell
Same with on in GitHub Actions files if you read them with a 1.1 parser. Works in Actions, breaks in your own tooling.
7 net votes
Nguyễn Minh Hiếu@homelab_hieu#6 in YAML Hell
I had same with docker compose ports. Unquoted 22:22 was read as a base 60 number by YAML 1.1. Since then I quote all ports :)
2 net votes
Jussi Laaksonen@jussi_ops#1 in YAML Hell
Sexagesimal. Babylonians in the compose file. Good one.
2 net votes
Sam Whitaker@segfault_sam#2 in YAML Hell
norway: exists yaml: no
4 net votes
Alasdair Reid@onprem_or_die#4 in YAML Hell
the YAML generation discovering the problems of the YAML generation. ini files never did this to anybody
3 net votes
Prashanth Gowda@prashanth_sre#4 in YAML Hell
saved. adding the yamllint truthy rule to our pipeline tomorrow. thanks guru
8 net votes