network-get error in db relation

Bug #1751105 reported by Martin Hilton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
PostgreSQL Charm
Fix Released
Critical
Stuart Bishop

Bug Description

Whilst deploying this charm as part of a system we got thos following hook error:

Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-postgresql-0/.venv/lib/python3.5/site-packages/charms/reactive/__init__.py", line 72, in main
    bus.dispatch(restricted=restricted_mode)
  File "/var/lib/juju/agents/unit-postgresql-0/.venv/lib/python3.5/site-packages/charms/reactive/bus.py", line 375, in dispatch
    _invoke(other_handlers)
  File "/var/lib/juju/agents/unit-postgresql-0/.venv/lib/python3.5/site-packages/charms/reactive/bus.py", line 351, in _invoke
    handler.invoke()
  File "/var/lib/juju/agents/unit-postgresql-0/.venv/lib/python3.5/site-packages/charms/reactive/bus.py", line 173, in invoke
    self._action(*args)
  File "/var/lib/juju/agents/unit-postgresql-0/charm/reactive/postgresql/client.py", line 100, in master_provides
    db_relation_common(rel)
  File "/var/lib/juju/agents/unit-postgresql-0/charm/reactive/postgresql/client.py", line 232, in db_relation_common
    local['host'] = ingress_address(local.relname, local.relid)
  File "/var/lib/juju/agents/unit-postgresql-0/charm/reactive/postgresql/client.py", line 346, in ingress_address
    d = hookenv.network_get(endpoint, relid)
  File "/var/lib/juju/agents/unit-postgresql-0/.venv/lib/python3.5/site-packages/charmhelpers/core/hookenv.py", line 929, in inner_translate_exc2
    return f(*args, **kwargs)
  File "/var/lib/juju/agents/unit-postgresql-0/.venv/lib/python3.5/site-packages/charmhelpers/core/hookenv.py", line 1143, in network_get
    stderr=subprocess.STDOUT).decode('UTF-8').strip()
  File "/usr/lib/python3.5/subprocess.py", line 626, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.5/subprocess.py", line 708, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['network-get', 'db', '--format', 'yaml', '-r', 'db:4']' returned non-zero exit status 2

Manually running (juju-run) this command gives the output:

ERROR flag provided but not defined: -r

https://jujucharms.com/docs/2.3/developer-network-primitives does appear to suggest that this is a legal command, but it doesn't seem to work with juju versions before 2.3.

Revision history for this message
Tom Haddon (mthaddon) wrote :

This is with cs:postgresql-170 fwiw

Revision history for this message
Martin Hilton (martin-hilton) wrote :

Sorry I forgot to note that this was found when using cs:postgresql-170

Revision history for this message
Stuart Bishop (stub) wrote :

hookenv.network_get from charmhelpers is not helpfully falling back like it should.

Revision history for this message
Stuart Bishop (stub) wrote :
Stuart Bishop (stub)
Changed in postgresql-charm:
assignee: nobody → Stuart Bishop (stub)
importance: Undecided → Critical
status: New → 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.