Invalid yaml in a charm's actions.yaml results in cryptic "unexpected error"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snap Store Server |
Fix Committed
|
Undecided
|
Tong Shinn |
Bug Description
This is a charm whose actions.yaml doesn't parse correctly (it's invalid yaml).
The user sees:
2021-10-19 09:05:01.028 Status checked: {'revisions': [{'errors': [{'code': 'review-error', 'message': 'Unexpected error'}], 'revision': None, 'status': 'rejected', 'upload-id': '2d5d38aa-
On our side, the exception from packagereview is:
Failed to scan /srv/packagerev
Expected '<document start>', but found '<block sequence start>'
in "actions.yaml", line 2, column 1
The above is a yaml exception, the thing here is that the charm_scan method has a large block where it tries a few things and catches a few exceptions, but the loading of yaml files (done in line 143):
extra = extract_
is not wrapped in any of the specific exceptions, so any exception in that block falls through to:
except Exception as exc:
output = dict(error=
return ScanStatus.
It would be good to wrap extract_
tags: | added: bite-size charmhub |
Changed in snapstore-server: | |
assignee: | nobody → Tong-Wook Shinn (tshinn) |
Changed in snapstore-server: | |
status: | New → In Progress |
Changed in snapstore-server: | |
status: | In Progress → Fix Committed |