← Back to issue list

yaml validation errors are not helpful if the file is empty

View original Github issue

Metadata

Project
charmcraft
Number
#2071
Type
issue
State
open
Author
PietroPasotti
Labels
Created
2025-01-10 12:51:10+00:00
Updated
2025-08-15 15:18:01+00:00
Closed

Current evaluation

No evaluation has been recorded for this issue yet.

Issue body

### Bug Description validation error is not helpful on an empty file. (it was actually hard to find out that the file was empty because I thought I'd deleted it). The project already had a (valid) charmcraft.yaml next to it, and couldn't figure out why charmcraft wasn't liking it. ### To Reproduce charmcraft pack ### Environment charmcraft 3.2.2 ### metadata.yaml ```yaml # Copyright 2025 Canonical Ltd. # See LICENSE file for licensing details. ``` ### Relevant log output ```shell ❯ charmcraft pack Invalid file: 'metadata.yaml' Recommended resolution: Ensure metadata.yaml meets the juju metadata.yaml specification. For more information, check out: https://juju.is/docs/sdk/metadata-yaml Full execution log: '/home/pietro/.local/state/charmcraft/log/charmcraft-20250110-134846.839621.log' ```

Evaluation history

No evaluation history available.