Skip to content

Parsing error with <unknown position> as line / column or bad line #2747

@jonathanpoelen

Description

@jonathanpoelen

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
               - d

data2.yml:

[a, ,]

Command

yq <data1.yml
yq <data2.yml

Actual 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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions