[2.7.3] relation-get --app fails on non-leader units (peer relations)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Fix Released
|
High
|
Achilleas Anagnostopoulos |
Bug Description
See the attachment which contains a screencast.
On a non-leader unit:
* peer-relation-
* `relation-get --app=True` is called and returns 0;
* the same happens for a more explicit variation `relation-get -r 0 - ceph-iscsi --app=True --format=json`
* charm exits with 0 exit code;
* unit agent fails the peer-relation-
unit-ceph-iscsi-0: 23:49:22 ERROR juju.worker.
unit-ceph-iscsi-0: 23:49:22 ERROR juju.worker.
JUJU_REMOTE_APP is set appropriately:
env | grep JUJU_
JUJU_METER_INFO=not set
JUJU_CHARM_
JUJU_CONTEXT_
JUJU_MODEL_
JUJU_VERSION=2.7.3
JUJU_CHARM_
JUJU_UNIT_
JUJU_RELATION_
JUJU_HOOK_
JUJU_AGENT_
JUJU_RELATION=
JUJU_CHARM_
JUJU_AVAILABILI
JUJU_METER_
JUJU_CHARM_
JUJU_DEBUG=
JUJU_API_
JUJU_REMOTE_UNIT=
JUJU_PRINCIPAL_
JUJU_REMOTE_
JUJU_MODEL_
JUJU_MACHINE_ID=0
JUJU_SLA=
JUJU_AGENT_
JUJU_CHARM_
The expected behavior is that non-leader units should be able to read peer app relation data for their own application.
Note: non-leader units should not be able to read app relation data for *their own app* for non-peer relations. I think this restriction is just applied to peer relations and causes this issue because units do have to read their own app's relation data which is a special case.
Changed in juju: | |
status: | New → In Progress |
assignee: | nobody → Achilleas Anagnostopoulos (achilleasa) |
importance: | Undecided → High |
milestone: | none → 2.7.4 |
Changed in juju: | |
status: | In Progress → Fix Committed |
Changed in juju: | |
milestone: | 2.7.4 → 2.7.5 |
Changed in juju: | |
status: | Fix Committed → Fix Released |
Looks like this is a regression compared to 2.7.2.
I used not to get this error with a charm I was working on. This could be used as a reproducer:
git clone https:/ /github. com/dshcherb/ charm-cockroach db zone_replicas= 3 --config system_ data_replicas= 3 -n 3
git submodule update --init
juju deploy ./ --config default_