Metadata errors should be user friendly

Bug #957498 reported by Clint Byrum
6
This bug affects 1 person
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/Work/Development/oneiric/subway/metadata.yaml: provides.subway: expected unicode or utf-8 string, got None',) Bad data in charm info: /home/bkerensa/Work/Development/oneiric/subway/metadata.yaml: provides.subway: expected unicode or utf-8 string, got None

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.

Revision history for this message
Kapil Thangavelu (hazmat) wrote :

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.

Changed in juju:
importance: Medium → Low
milestone: none → galapagos
Changed in juju:
milestone: galapagos → none
Curtis Hovey (sinzui)
Changed in juju:
status: Confirmed → Triaged
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.