Metadata errors should be user friendly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pyjuju |
Triaged
|
Low
|
Unassigned |
Bug Description
Recently we saw a user quite confused when trying to deploy, with this bug:
2012-03-16 15:31:02,246 WARNING Charm 'subway' has an error: MetaDataError('Bad data in charm info: /home/bkerensa/
This was because his metadata.yaml was like this:
name: subway
summary: Web-Based IRC Client
description:
Subway is a web-based IRC client with a multi-user backend
and a JavaScript-heavy UI. Frontend/backend communication is
done with websockets (or best available fallback where not available).
The backend supports connection persistence and optional
logging when the browser disconnects.
provides:
subway:
interface: http
The lack of indent meant that the user got None. But really, the error message is exposing implementation details instead of telling them one is wrong.
I would suggest that we do some pre-validation of metadata.yaml that will provide useful feedback for obvious problems like this, and if nothing else, provide a line number and file reference to help dig it out.
Changed in juju: | |
milestone: | galapagos → none |
Changed in juju: | |
status: | Confirmed → Triaged |
Most users will be deploying from the store so this is specific to the context of charm authors. Actual yaml structural error messages are what we get yaml library, and it does include line numbers and the parser error msg. In this case its not a yaml error but a missing required metadata field while parsing the relation dict, and the error message could indeed be better for it.