if a formula in a repo has invalid metadata, it can stop any deploy from the repo.

Bug #810765 reported by Juan L. Negron
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pyjuju
Fix Released
Medium
Kapil Thangavelu

Bug Description

I cannot deploy mysql any longer.

Pastebin: http://pastebin.ubuntu.com/644396/

Related branches

Revision history for this message
Juan L. Negron (negronjl) wrote :
Download full text (6.7 KiB)

Just in case...here is the output.

negronjl@negronjl-laptop:~/src/ensemble/formulas$ ensemble --verbose deploy --repository . mysql
2011-07-14 14:56:25,802 DEBUG Initializing ensemble deploy runtime
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/ensemble/control/command.py", line 48, in _run
    d = defer.maybeDeferred(self.callback, self.options)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 133, in maybeDeferred
    result = f(*args, **kw)
  File "/usr/lib/pymodules/python2.7/ensemble/control/deploy.py", line 51, in command
    options.log)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1141, in unwindGenerator
    return _inlineCallbacks(None, f(*args, **kwargs), Deferred())
--- <exception caught here> ---
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1020, in _inlineCallbacks
    result = g.send(result)
  File "/usr/lib/pymodules/python2.7/ensemble/control/deploy.py", line 64, in deploy
    formula = repository.find(formula_name)
  File "/usr/lib/pymodules/python2.7/ensemble/formula/repository.py", line 33, in find
    for formula in self:
  File "/usr/lib/pymodules/python2.7/ensemble/formula/repository.py", line 18, in __iter__
    yield get_formula_from_path(dentry_path)
  File "/usr/lib/pymodules/python2.7/ensemble/formula/provider.py", line 26, in get_formula_from_path
    return FormulaDirectory(specification)
  File "/usr/lib/pymodules/python2.7/ensemble/formula/directory.py", line 24, in __init__
    self.metadata = MetaData(os.path.join(path, "metadata.yaml"))
  File "/usr/lib/pymodules/python2.7/ensemble/formula/metadata.py", line 166, in __init__
    self.load(path)
  File "/usr/lib/pymodules/python2.7/ensemble/formula/metadata.py", line 237, in load
    self.parse(f.read(), path)
  File "/usr/lib/pymodules/python2.7/ensemble/formula/metadata.py", line 248, in parse
    return self.parse_serialization_data(yaml.load(content), path)
  File "/usr/lib/python2.7/dist-packages/yaml/__init__.py", line 58, in load
    return loader.get_single_data()
  File "/usr/lib/python2.7/dist-packages/yaml/constructor.py", line 42, in get_single_data
    node = self.get_single_node()
  File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 36, in get_single_node
    document = self.compose_document()
  File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 55, in compose_document
    node = self.compose_node(None, None)
  File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/usr/lib/python2.7/dist-packages/yaml/composer.py", line 127, in compose_mapping_node
    while not self.check_event(MappingEndEvent):
  File "/usr/lib/python2.7/dist-packages/yaml/parser.py", line 93, in check_event
    self.current_event = self.state()
  File "/usr/lib/python2.7/dist-packages/yaml/parser.py", line 434, in parse_block_mapping_key
    "expected <block end>, but found %r" % token.id, token.start_mark)
yaml.parser.ParserError: while parsing a block mapping
  in "<string>", line 1, column 1:
    ensemble: formula
    ^
expected <block end>, but found '<block m...

Read more...

Revision history for this message
Juan L. Negron (negronjl) wrote : Re: cannot deploy any formulas

As it turns out, after updating to the latest ensemble (0.5+bzr275-0ensemble1~natty1), I am no longer able to deploy any formulas.

-Juan

summary: - cannot deploy mysql
+ cannot deploy any formulas
Revision history for this message
Kapil Thangavelu (hazmat) wrote :

mark pointed out problem.. ensemble scans the entire repo looking for the named formula. if one of the formulas is invalid.. it will hose the deploy.

summary: - cannot deploy any formulas
+ if a formula in a repo has invalid metadata, it can stop any deploy from
+ the repo.
Changed in ensemble:
importance: Undecided → High
Revision history for this message
Gustavo Niemeyer (niemeyer) wrote :

We'll have to print a nice error message there indeed, to let the user know what's broken.

In the future the repo work will also address this in "ensemble publish", which will validate the formula
before uploading.

Revision history for this message
Juan L. Negron (negronjl) wrote :

This turned out to be true. I had a formula with a bad metadata.yaml file. Once I removed that folder, everything went back to normal.

Although I am happy that my particular issue is gone for now, this is pretty horrible.

-Juan

Changed in ensemble:
assignee: nobody → Kapil Thangavelu (hazmat)
milestone: none → dublin
importance: High → Medium
status: New → In Progress
Changed in ensemble:
status: In Progress → Fix Released
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.