Parsing error with <unknown position> as line / column or bad line
Author: jonathanpoelenCreated Jun 14, 2026Updated Sep 15, 2026
Labelsbugv4
Describe the bug
Sometimes, when a parsing error occurs, the position is unknown position or the line above it.
Version of yq: v4.53.2 Operating system: Manjaro Linux Installed via: pacman (package manager)
Input Yaml data1.yml:
- a
- b # oups
- ddata2.yml:
[a, ,]Command
yq <data1.yml
yq <data2.ymlActual behaviour
Error: bad file '-': yaml: while parsing a block collection at <unknown position>: line 2, column 16: did not find expected '-' indicator
Error: bad file '-': yaml: while parsing a flow node at <unknown position>: did not find expected node content
Expected behaviour
Replace <unknown position> with the correct position and line 1 with line 2 (the second line has only 10 columns).
Source: mikefarah/yq