normal charm to subordinate charm and now peer relation does not work
Tilman Baumann
tilman.baumann at canonical.com
Wed Jan 25 13:24:23 UTC 2017
On 25.01.2017 13:16, Stuart Bishop wrote:
> On 25 January 2017 at 18:43, Tilman Baumann
> I don't know why your peer relation (with global scope) starts
> misbehaving after you add the container scoped juju-info relation to
> turn your charm into a subordinate. It might be helpful to inspect the
> peer relation with the hook environment tools to try to narrow down if
> the problem is with Juju, charms.reactive, or something else. Using
> debug-hooks, or 'juju run --unit foo/0 "relation-ids ssh-peers"' and
> 'juju run --unit foo/0 "relation-list -r ssh-peers:64"' if you haven't
> done this before.
Thanks. That was the breakthrough hint.
$ juju run --unit iptables-peer-ssh/97 "relation-list -r ssh-peers:103"
iptables-peer-ssh/95
iptables-peer-ssh/98
iptables-peer-ssh/99
$ juju run --unit iptables-peer-ssh/97 "relation-get -r ssh-peers:103
private-address iptables-peer-ssh/95"
172.16.254.217
$ juju run --unit iptables-peer-ssh/97 "relation-get -r ssh-peers:103
private-address iptables-peer-ssh/98"
172.16.254.232
$ juju run --unit iptables-peer-ssh/97 "relation-get -r ssh-peers:103
private-address iptables-peer-ssh/99"
172.16.254.43
So clearly, the problem is not juju. I can see all relations.
It is either reactive or my charm code.
> One thing to remember is that units join the peer relation one at a
> time. So in your peer relation-joined hook, you will only see a single
> unit. Then a relation-changed, again with a single unit. And maybe a few
> more times with a single unit. Eventually the rest of the units will
> join, each time triggering relation-changed one or more times. Maybe
> your problem is just that you are looking too soon :)
Hm, perhaps that is the case. Though I should get the joined event
multiple times until the last unit has joined.
But I think I can keep working on this now, once the problem is isolated
a little more.
More information about the Juju
mailing list