i.e. there is no "username" key in the unit relation data, which is what the code relies on. It did, however, expose a bug in the code that cause the overwrite of the private-address field. I'll address that, so it no longer breaks things.
The other part about app data bag support may take a little longer; I'm not sure how it found the username when the units were related/integrated, as it's not clear how it found it in the app data bag, unless the relation-get changes when the relation-updated hook is firing (which it may).
Light bulb moment! It's due to rabbitmq-server not supporting app data bags; it predates their introduction, basically. The key part is:
╰─$ juju exec -u rabbitmq-server/0 -- relation-get -r amqp:14 - remote- 61a200e299af4cb 38a8eb904a0133d f6/0 1 ↵
egress-subnets: 10.152.183.50/32
ingress-address: 10.152.183.50
private-address: 10.152.183.50
i.e. there is no "username" key in the unit relation data, which is what the code relies on. It did, however, expose a bug in the code that cause the overwrite of the private-address field. I'll address that, so it no longer breaks things.
The other part about app data bag support may take a little longer; I'm not sure how it found the username when the units were related/integrated, as it's not clear how it found it in the app data bag, unless the relation-get changes when the relation-updated hook is firing (which it may).