Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Juju GUI handling of empty config breaks promulgated charms #2486

Closed
merlijn-sebrechts opened this issue Feb 20, 2017 · 4 comments
Closed

Juju GUI handling of empty config breaks promulgated charms #2486

merlijn-sebrechts opened this issue Feb 20, 2017 · 4 comments

Comments

@merlijn-sebrechts
Copy link

How to reproduce:

Deploy cassandra with the GUI. Cassandra installation will fail with the following error.

unit-cassandra-0: 18:28:04 INFO unit.cassandra/0.install Traceback (most recent call last):
unit-cassandra-0: 18:28:04 INFO unit.cassandra/0.install   File "/var/lib/juju/agents/unit-cassandra-0/charm/hooks/install", line 19, in <module>
unit-cassandra-0: 18:28:04 INFO unit.cassandra/0.install     hooks.bootstrap()
unit-cassandra-0: 18:28:04 INFO unit.cassandra/0.install   File "/var/lib/juju/agents/unit-cassandra-0/charm/hooks/hooks.py", line 37, in bootstrap
unit-cassandra-0: 18:28:04 INFO unit.cassandra/0.install     set_proxy()
unit-cassandra-0: 18:28:04 INFO unit.cassandra/0.install   File "/var/lib/juju/agents/unit-cassandra-0/charm/hooks/hooks.py", line 24, in set_proxy
unit-cassandra-0: 18:28:04 INFO unit.cassandra/0.install     if config['http_proxy']:
unit-cassandra-0: 18:28:04 INFO unit.cassandra/0.install KeyError: 'http_proxy'

The Cassandra charm expects config['http_proxy'] to return an empty string. This is what happens when deploying Cassandra using the CLI. However, config_get crashes because the config isn't set. running config-get in the hooks context shows that the http_proxy config value just isn't set.

root@ip-.........:/var/lib/juju/agents/unit-cassandra-0/charm# config-get
authenticator: PasswordAuthenticator
authorizer: AllowAllAuthorizer
cluster_name: juju
commitlog_directory: commitlog
compaction_throughput_mb_per_sec: 16
data_file_directories: data
datacenter: juju
edition: community
heap_newsize: 32M
install_keys: |
  - null  # Apache package signing key added automatically.
  - null  # PPA package signing key added automatically.
  - null  # PPA package signing key added automatically.
  # - null  # DataStack package signing key added automatically.
install_sources: |
  - deb http://www.apache.org/dist/cassandra/debian 30x main
  - ppa:openjdk-r/ppa   # For OpenJDK 8
  - ppa:cassandra-charmers/stable  # For Python driver
io_scheduler: noop
jre: openjdk
max_heap_size: 384M
nagios_context: juju
nagios_disk_crit_pct: 25
nagios_disk_warn_pct: 50
nagios_heapchk_crit_pct: 90
nagios_heapchk_warn_pct: 80
native_transport_port: 9042
num_tokens: 256
package_status: install
partitioner: Murmur3Partitioner
rpc_port: 9160
saved_caches_directory: saved_caches
ssl_storage_port: 7001
storage_port: 7000
stream_throughput_outbound_megabits_per_sec: 200
tombstone_failure_threshold: 100000
tombstone_warn_threshold: 1000
wait_for_storage_broker: false
@hatched
Copy link
Contributor

hatched commented Feb 20, 2017

Thanks for this report.

The GUI doesn't unset any configuration values so I'll have to investigate why it's being unset.

@simonklb
Copy link

This would probably be solved by using a newer version of charmhelpers where the --all flag is appended to the config-get command.
See: http://bazaar.launchpad.net/~charm-helpers/charm-helpers/devel/view/head:/charmhelpers/core/hookenv.py#L336

@hatched
Copy link
Contributor

hatched commented Feb 20, 2017

This doesn't appear to be a GUI issue, the deploy command is sending the config value as an empty string and then it seems Juju is unsetting the value.

{
  "type": "Application",
  "request": "Deploy",
  "params": {
    "applications": [
      {
        "application": "cassandra",
        "charm-url": "cs:cassandra-29",
        "config": {
          "authenticator": "PasswordAuthenticator",
          "authorizer": "AllowAllAuthorizer",
          "cluster_name": "juju",
          "commitlog_directory": "commitlog",
          "compaction_throughput_mb_per_sec": "16",
          "data_file_directories": "data",
          "datacenter": "juju",
          "edition": "community",
          "extra_packages": "",
          "heap_newsize": "32M",
          "http_proxy": "",
          "install_keys": "- null  # Apache package signing key added automatically.\n- null  # PPA package signing key added automatically.\n- null  # PPA package signing key added automatically.\n# - null  # DataStack package signing key added automatically.\n",
          "install_sources": "- deb http://www.apache.org/dist/cassandra/debian 30x main\n- ppa:openjdk-r/ppa   # For OpenJDK 8\n- ppa:cassandra-charmers/stable  # For Python driver\n",
          "io_scheduler": "noop",
          "jre": "openjdk",
          "listen_interface": "",
          "max_heap_size": "384M",
          "nagios_context": "juju",
          "nagios_disk_crit_pct": "25",
          "nagios_disk_warn_pct": "50",
          "nagios_heapchk_crit_pct": "90",
          "nagios_heapchk_warn_pct": "80",
          "nagios_servicegroups": "",
          "native_transport_port": "9042",
          "num_tokens": "256",
          "package_status": "install",
          "partitioner": "Murmur3Partitioner",
          "private_jre_url": "",
          "rack": "",
          "rpc_interface": "",
          "rpc_port": "9160",
          "saved_caches_directory": "saved_caches",
          "ssl_storage_port": "7001",
          "storage_port": "7000",
          "stream_throughput_outbound_megabits_per_sec": "200",
          "tombstone_failure_threshold": "100000",
          "tombstone_warn_threshold": "1000",
          "wait_for_storage_broker": "false"
        },
        "config-yaml": "",
        "constraints": {},
        "num-units": 0,
        "resources": {},
        "series": "xenial"
      }
    ]
  },
  "version": 3,
  "request-id": 11
}

@hatched
Copy link
Contributor

hatched commented Feb 20, 2017

I had thought I'd seen this before, turns out it is a known issue: https://bugs.launchpad.net/juju/+bug/1513466

So in the meantime it's probably best to get the charm updated to be more resilient.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants