containers / containers/podman-compose

podman-compose gives a lot meaningless errors for invalid yaml files

Open
#1,483 2 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
Python
Stars
6.2k
Forks
622
PR merge metrics
No merged PRs in 30d

Description

A specific example can be seen at https://github.com/containers/podman-compose/pull/1327

That pull-requests cures the issue but for that specific error only.

It is not a problem for small yaml files but causes headaches in monorepo style use cases where the yaml file is large and even spread through multiple file system files.

This happens for a lot of reasons. I think curing them on case by case basis is not feasible at the moment.
Instead a more thought out approach is required.

My intuition is that some kind of context tracing is required so when an error for invalid yaml is raised, it is possible to attach the required context for understanding the error message to the exception in a generic way.

The context should carry information like the actual file and line number that is causing the error and the reason for why the file was looked into, which can be e.g. an include directive, or service definition lookup caused by a depends_on directive, etc.

podman-compose version 1.5.0
podman version 5.4.2

Contributor guide

Open the contributing guide

Research direction

The issue names no source file or test; start by reproducing the invalid-YAML path from PR #1327 and tracing how the exception loses context across includes and depends_on lookups. Done means invalid YAML errors consistently identify the actual file and line, explain why that file was read, and provide useful context across the described cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, yaml
Domain
cli, devops
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.