juju is stripping underscore from options

Bug #1243827 reported by David Ames
32
This bug affects 6 people
Affects Status Importance Assigned to Milestone
goyaml
Fix Released
Undecided
Abel Deuring
juju-core
Fix Released
High
Katherine Cox-Buday
1.20
Fix Released
High
Katherine Cox-Buday
juju-deployer
Invalid
Critical
Kapil Thangavelu

Bug Description

juju is stripping underscore from options

Originally found in 0.2.3+bzr115-0~26~precise1ubuntu1~0.IS.12.04 and subsequently confirmed in latest source code

is-charms:
  series: precise
  services:
    is-charms-cassandra:
      num_units: 3
      charm: cassandra
      constraints: mem=4G
      options:
        extra-jvm-opts: -Djavaagent:$CASSANDRA_HOME/lib/jamm-0.2.5.jar

juju get is-charms-cassandra

  extra-jvm-opts:
    description: 'string to be appended to JVM_OPTS, e.g.:

      -Djavaagent:$CASSANDRAHOME/lib/jamm-0.2.5.jar

Using double underscore "escapes"
is-charms:
  series: precise
  services:
    is-charms-cassandra:
      num_units: 3
      charm: cassandra
      constraints: mem=4G
      options:
        extra-jvm-opts: -Djavaagent:$CASSANDRA__HOME/lib/jamm-0.2.5.jar

juju get is-charms-cassandra

  extra-jvm-opts:
    description: 'string to be appended to JVM_OPTS, e.g.:

      -Djavaagent:$CASSANDRA_HOME/lib/jamm-0.2.5.jar

Related branches

David Ames (thedac)
description: updated
Changed in juju-deployer:
assignee: nobody → Kapil Thangavelu (hazmat)
Revision history for this message
Jacek Nykis (jacekn) wrote :

I experienced exactly the same problem. My config has:
nagios_check_https_params: "-H 127.0.0.1 --ssl -p {https_port}"

which ends up being:
value: -H 127.0.0.1 --ssl -p {httpsport}

Haw Loeung (hloeung)
tags: added: canonical-webops
Changed in juju-deployer:
status: New → Confirmed
importance: Undecided → Critical
Revision history for this message
Kapil Thangavelu (hazmat) wrote :

Its really unclear where this is happening, i'm writing a functional test to see if i can reproduce.

Changed in juju-deployer:
status: Confirmed → In Progress
milestone: none → 0.3.3
Revision history for this message
Kapil Thangavelu (hazmat) wrote :

so i've written a few tests, and i can't reproduce this. has anyone confirmed that this issues doesn't exist with juju-core by itself?

Changed in juju-deployer:
status: In Progress → Incomplete
milestone: 0.3.3 → none
Revision history for this message
Kapil Thangavelu (hazmat) wrote :

confirmed. this is not an issue in deployer, its an issue in juju-core. it looks like core is stripping the underscore on the way in from a cli deploy --config config.yaml.. i've verified what deployer passes in is correct and that the resulting values for service config stored in mongodb have the values stripped.

summary: - juju-deployer is stripping underscore from options
+ juju is stripping underscore from options
Changed in juju-deployer:
status: Incomplete → Invalid
description: updated
Curtis Hovey (sinzui)
Changed in juju-core:
status: New → Triaged
importance: Undecided → High
tags: added: config
Changed in juju-core:
milestone: none → 2.0
importance: High → Critical
milestone: 2.0 → 1.17.4
Curtis Hovey (sinzui)
Changed in juju-core:
importance: Critical → High
Curtis Hovey (sinzui)
Changed in juju-core:
milestone: 1.17.4 → 1.18.0
Curtis Hovey (sinzui)
Changed in juju-core:
assignee: nobody → Abel Deuring (adeuring)
Revision history for this message
Abel Deuring (adeuring) wrote :

This is acutally a bug in goyyaml. Fix coming soon.

Changed in goyaml:
assignee: nobody → Abel Deuring (adeuring)
Changed in juju-core:
status: Triaged → Invalid
Changed in goyaml:
status: New → In Progress
Revision history for this message
Abel Deuring (adeuring) wrote :

Did double underscores really ever work? I tried to reproduce this workaround but can't get it working.

Wrapping the strings in question in quotation marks should work though.

Also, the root cause of the problem seems to be a bug in the function resolve() in the goyaml package, which removes _all_ underscores from a string if it starts with a digit or a '+' or '-'. (see the linked branch)

Changed in goyaml:
status: In Progress → Fix Committed
status: Fix Committed → Fix Released
Curtis Hovey (sinzui)
Changed in juju-core:
milestone: 1.20.0 → none
Curtis Hovey (sinzui)
Changed in juju-core:
status: Invalid → Triaged
assignee: Abel Deuring (adeuring) → nobody
milestone: none → 1.21-alpha1
David Britton (dpb)
tags: added: cloud-installer landscape
Revision history for this message
Curtis Hovey (sinzui) wrote :

The fix was made upstream, but the bug wrongly claimed to be invalid for juju-core. The bug does affect juju-core because it must update dependencies.tsv to to use the fix. The commit with the fix is 1418a9bc452f9cf4efa70307cafcb10743e64a56
    https://github.com/go-yaml/yaml/commit/1418a9bc452f9cf4efa70307cafcb10743e64a56#diff-d41d8cd98f00b204e9800998ecf8427e

Revision history for this message
David Britton (dpb) wrote :

I hit this using 1.20.4. I'm attching the debugging I did to make sure it's not lost. This error showed up not with juju get/set, but instead with jujud on the bootstrap node reading in the environment configuration:

Ian Booth (wallyworld)
Changed in juju-core:
assignee: nobody → Katherine Cox-Buday (cox-katherine-e)
Changed in juju-core:
status: Triaged → In Progress
Ian Booth (wallyworld)
Changed in juju-core:
status: In Progress → Fix Committed
Curtis Hovey (sinzui)
Changed in juju-core:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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