client-relation-joined hook failes on Juju 1.25 because network-get is called

Bug #1792856 reported by Xav Paice
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Elasticsearch Charm
Won't Fix
Undecided
Unassigned

Bug Description

When running Juju 1.25.x, the hook client-relation-joined fails with:

Traceback (most recent call last):
  File "./hooks/client-relation-joined", line 107, in <module>
    hooks.execute(sys.argv)
  File "/var/lib/juju/agents/unit-elasticsearch-1/charm/hooks/charmhelpers/contrib/ansible/__init__.py", line 229, in execute
    self.playbook_path, tags=[hook_name], extra_vars=extra_vars)
  File "/var/lib/juju/agents/unit-elasticsearch-1/charm/hooks/charmhelpers/contrib/ansible/__init__.py", line 161, in apply_playbook
    subprocess.check_call(call, env=env)
  File "/usr/lib/python3.5/subprocess.py", line 581, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ansible-playbook', '-c', 'local', 'playbook.yaml', '--tags', 'client-relation-joined']' returned non-zero exit status 2
root@juju-machine-0-lxc-27:/var/lib/juju/agents/unit-elasticsearch-1/charm# network-get
network-get: command not found

From a Juju 2.x model:
root@elastic-2:/var/lib/juju/tools# find . -name network-get
./2.3.7-xenial-amd64/network-get
./2.4.1-xenial-amd64/network-get

Looks like the network-get tool is introduced in Juju 2, and so the Elasticsearch charm as it stands doesn't support 1.25.

Is this something we want to fix?

Revision history for this message
Kevin W Monroe (kwmonroe) wrote :

This might be a quick fix:

--- a/playbook.yaml
+++ b/playbook.yaml
@@ -65,7 +65,8 @@
     - name: Get the primary address of client relation
       tags:
         - client-relation-joined
- command: network-get client --primary-address
+ command: >
+ bash -c 'network-get client --primary-address 2>/dev/null || unit-get private-address'
       register: client_primary_address

But it's untested, and I'm not sure what the *next* problem would be with ES on 1.25.

Revision history for this message
Wouter van Bommel (woutervb) wrote :

Juju 1 series is no longer supported / in use

Changed in charm-elasticsearch:
status: New → Won't Fix
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.