[parser] Don't explode if snapcraft.yaml is missing
Metadata
Current evaluation
Fixed by merged PR #985 (commit 632022ccd), which replaced the missing snapcraft.yaml traceback with a clearer parser error.
Resolution: closed resolved
Reason: PR #985 was merged into master as commit 632022ccd and explicitly addressed LP bug #1599098. It improved handling of origins missing snapcraft.yaml by presenting a clearer error instead of a raw traceback.
Evaluated by: mr-cal-bot
No scores available.
Issue body
Slightly related to bug 1591207, there's this:
daniel@daydream:/tmp/test$ ~/dev/snappy/snapcraft/bin/snapcraft-parser -d -i https://wiki.ubuntu.com/snapcraft/parts?action=raw
Processing part 'qt5conf'
Von https://github.com/dplanella/qt5conf
* branch HEAD -> FETCH_HEAD
Already up-to-date.
Processing part 'qt4conf'
Von https://github.com/kyrofa/qt4conf
* branch HEAD -> FETCH_HEAD
Already up-to-date.
Processing part 'gtkconf'
Von https://github.com/dplanella/gtkconf
* branch HEAD -> FETCH_HEAD
Already up-to-date.
Processing part 'curl'
Von https://github.com/sergiusens/curl
* branch HEAD -> FETCH_HEAD
Already up-to-date.
Processing part 'mqtt-paho'
Von https://github.com/sergiusens/mqtt-paho
* branch HEAD -> FETCH_HEAD
Already up-to-date.
Processing part 'ffmpeg'
Von https://github.com/Winael/ffmpegconf
* branch HEAD -> FETCH_HEAD
Already up-to-date.
Traceback (most recent call last):
File "/home/daniel/dev/snappy/snapcraft/bin/snapcraft-parser", line 29, in <module>
snapcraft.internal.parser.main()
File "/home/daniel/dev/snappy/snapcraft/snapcraft/internal/parser.py", line 77, in main
return run(args)
File "/home/daniel/dev/snappy/snapcraft/snapcraft/internal/parser.py", line 248, in run
master_parts_list = _process_index(output)
File "/home/daniel/dev/snappy/snapcraft/snapcraft/internal/parser.py", line 222, in _process_index
parts_list, after_parts = _process_entry(data)
File "/home/daniel/dev/snappy/snapcraft/snapcraft/internal/parser.py", line 184, in _process_entry
origin_data = _get_origin_data(origin_dir)
File "/home/daniel/dev/snappy/snapcraft/snapcraft/internal/parser.py", line 99, in _get_origin_data
with open(os.path.join(origin_dir, 'snapcraft.yaml'), "r") as fp:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/ffmpeg/snapcraft.yaml'
daniel@daydream:/tmp/test$
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Fixed by merged PR #985 (commit 632022ccd), which replaced the missing snapcraft.yaml traceback with a clearer parser error. | |
| stealth/space-bunny-alpha | — | closed resolved | Missing snapcraft.yaml handling was improved in merged PR #985 (commit 632022ccd), replacing the parser traceback with a clearer error message. | |
| stealth/space-bunny-alpha | — | closed stale | Parser robustness issue was closed without any linked pull request, resolving commit, or maintainer explanation in the available record. | |
| qwen/qwen3.6-35b-a3b | — | — | Resolved by adding a missing file check to prevent parser crashes. The fix was merged and the issue closed. | |
| qwen/qwen3.6-35b-a3b | — | — | The parser crashed with a FileNotFoundError when snapcraft.yaml was missing. The issue was closed without comments or activity, indicating it was abandoned without a formal fix or resolution. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed to gracefully handle missing snapcraft.yaml files, preventing the parser from crashing with a FileNotFoundError. The issue was closed after the fix was merged. |
Update history
| Date | Change |
|---|---|
| created |
Related work
-
Likely Fixed By:
canonical/snapcraft#985
(confidence 99%)
Merged PR titled “Better message for missing snapcraft.yaml in origins,” resolving commit 632022ccd.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1792049 Uncaught yaml.ParserError | snapcraft (launchpad) | closed | YAML parser tracebacks were fixed by merged snapcore/snapcraft PR #2263 (commit 057f66649), which catches broader YAML exceptions and reports invalid YAML. | |
| #1605541 snapcraft-parser doesn't work | snapcraft (launchpad) | closed | Fixed in snapcore/snapcraft#681 by making snapcraft-parser handle CRLF-separated YAML documents. | |
| #1591207 Parser should warn when it encounters an invalid snapcraft.yaml | snapcraft (launchpad) | closed | Snapcraft now produces user-friendly errors when 'parts' is missing from snapcraft.yaml, addressing the request for a parser warning. | |
| #1604326 snapcraft init doesn't fail if there is a .snapcraft.yaml file | snapcraft (launchpad) | closed | Fixed by merged snapcraft#669 (commit 2cd727259): snapcraft init now detects an existing .snapcraft.yaml and fails instead of creating snapcraft.yaml. | |
| #1611541 Bad error when trying to run snapcraft-parser without bzr installed | snapcraft (launchpad) | closed | Missing bzr now produces a clearer parser error. PR #742 addressed missing source-type packages in snapcraft-parser in commit 14518acf2. |