landscape bundle error when deployed via gui (KeyError in config changed hook in haproxy charm)

Bug #1651260 reported by Pen Gale
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Invalid
High
Unassigned
juju-gui
New
Undecided
Unassigned

Bug Description

Hi All,

I ran into this bug while testing matrix, but it also seems to affect the gui.

Here's how to reproduce it:

1) Setup a model on aws, and fire up the gui.
2) Add the "Landscape Dense-Mass" bundle to the canvas (https://54.159.236.52:17070/gui/b13bbd14-2a27-4fbf-827e-35116de20180/?store=cs:bundle/landscape-dense-maas-1)
3) Commit, and wait for the deploy to settle.
4) Note that haproxy is in an errored state. Inspecting the logs, you will see a KeyError fetching the "services" key from the config during the config changed hook.

The error does not occur when one deploys the landscape bundle via the command line client. This bug possibly occurs because the haproxy charm is fairly old; updating the charmhelpers in that bundle might fix it. It would be nice to fix this in the gui (and in matrix!), though, as the juju client seems to be working around the bug, and other charms and bundles might break because of it.

Note that the "services" option is specified as a blank string in the bundle.yaml; it is possible that the juju client is doing something special with falsey values which the gui is not.

I'm filing this here because I suspect that we're running into some undocumented behavior on the part of core or the client, and I'd like to get some information about the fix here, before I attempt to apply the fix to matrix/python-libjuju, or file a bug with the gui.

(All this happens in a freshly bootstrapped controller, on aws, under juju 2.1 beta3.)

Tags: matrix
Cory Johns (johnsca)
tags: added: matrix
Pen Gale (pengale)
affects: juju-core → juju
Revision history for this message
Anastasia (anastasia-macmood) wrote :

Gui issues are tracked at https://github.com/juju/juju-gui/issues

I have created https://github.com/juju/juju-gui/issues/2325 with supplied content.

Changed in juju:
status: New → Invalid
Revision history for this message
Pen Gale (pengale) wrote :

Thank you for opening the bug against the gui.

However, I do not think that this bug is invalid in the context of core. There's a discrepancy between the websocket api and the command line client that is not well documented, and that is breaking clients that attempt to talk to the websocket api.

I'm requesting one of the following:

1) Documentation on what the command line client is doing to manipulate empty keys so that clients like the gui or python-libjuju can perform the same manipulation.

2) A patch to the websocket gui so that it behaves in the same way as the command line client, without additional development work on the part of people writing clients.

Thank you.

Changed in juju:
status: Invalid → New
Changed in juju:
status: New → Triaged
importance: Undecided → High
milestone: none → 2.2.0
Revision history for this message
John A Meinel (jameinel) wrote :

According to the code, the fix for http://pad.lv/1194945 was to add a "ConfigYAML" attribute that is more defined as to whether you want "nil" (not present) or the empty string.
The GUI should be updated to use the new field, and Juju should fully deprecate/remove the old field.

Revision history for this message
Anastasia (anastasia-macmood) wrote :

@John,
GUI team prefer to track issues on github. They may not notice launchpad project addition. I have previously created issue https://github.com/juju/juju-gui/issues/2325. They are aware of it. I'll re-ping them :D

Revision history for this message
Anastasia (anastasia-macmood) wrote :

The GUI team have addressed linked github issue. It will be released as part of GUI 2.4.3.

I'll mark this issue as Incomplete for juju. Feel free to re-open if you encounter the problem again or raise a GUI issue directly.

Changed in juju:
status: Triaged → Incomplete
milestone: 2.2.0 → none
Revision history for this message
Pen Gale (pengale) wrote :

I think that I've fixed this issue in python-libjuju by passing bundle options to config-yaml rather than config (I still need to do some final testing, and push for review tomorrow).

This is kind of a nasty "gotcha" hiding out in the api codebase. We could partially fix it with better documentation, but good documentation isn't necessarily going to fix the fact that the obvious param ("config") that the API uses isn't actually the correct param for some bundles.

Granted, I don't have any great ideas for a fix -- I understand why things are the way that they are :-/

Regardless, thank you for all the comments and follow-up everyone. I am very happy to be unstuck :-)

Revision history for this message
Anastasia (anastasia-macmood) wrote :

Marking as Invalid for Juju since the bug was on the GUI side and Juju behaves well when ConfigYAML is passed.

thank you for the report and the update, petevg \o/

Changed in juju:
status: Incomplete → Invalid
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.