[charm] nrpe relation fails when conn-check gets the relation before the primary service.

Bug #1528595 reported by Guillermo Gonzalez on 2015-12-22
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
conn-check
Medium
Wes Mason

Bug Description

IMO, looks like a timing issue.

The error is:

2015-12-22 14:28:50 INFO nrpe-external-master-relation-changed TASK: [nrpe-external-master | Call charmhelpers nrpe support] *****************
2015-12-22 14:28:50 INFO nrpe-external-master-relation-changed fatal: [localhost] => One or more undefined variables: list object has no element 0

and the steps to resolved this are:

juju remove-relation <service> conn-check
juju resolved conn-check
# wait for the hooks to finish
juju add-relation <service> conn-check

Wes Mason (wesmason) on 2016-02-25
Changed in conn-check:
importance: Undecided → Medium
assignee: nobody → Wes Mason (wesmason)
Wes Mason (wesmason) wrote :

Had this bug occur in a recent env during a separate task, so took the oppertunity to debug, finally tracked it down to the config_path env, which is evaluated lazily as part of the checks.0.command in the nrpe call, it needs to be fixed to not rely explicitly on the relation data:

config_path: "{{ relations['conn-check'.0|default({})['config_path'] | default('/srv/conn-check/config.yaml') }}"

Wes Mason (wesmason) wrote :

It might be enough to include relations['conn-check'] in the when clause for the nrpe role so it doesn't fire until both nrpe-external-master and conn-check are available.

Wes Mason (wesmason) on 2016-03-10
Changed in conn-check:
status: New → In Progress
Wes Mason (wesmason) on 2016-04-26
Changed in conn-check:
status: In Progress → Fix Committed
Wes Mason (wesmason) on 2016-04-27
Changed in conn-check:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers