I've encountered this and can't seem to get past it. My leader unit is active/idle but the two other landscape-server units are "Waiting on relations: db".
The last few lines of the landscape-server unit logs on the waiting units:
2023-09-22 08:14:13 INFO juju.worker.uniter.operation runhook.go:159 ran "amqp-relation-changed" hook (via hook dispatching script: dispatch)
2023-09-22 08:14:14 INFO juju.worker.uniter.operation runhook.go:159 ran "amqp-relation-changed" hook (via hook dispatching script: dispatch)
2023-09-22 08:14:28 INFO unit.landscape-server/1.juju-log server.go:316 db:51: landscape-server/1 not in allowed_units
2023-09-22 08:14:28 INFO juju.worker.uniter.operation runhook.go:159 ran "db-relation-changed" hook (via hook dispatching script: dispatch)
2023-09-22 08:15:24 INFO unit.landscape-server/1.juju-log server.go:316 db:51: landscape-server/1 not in allowed_units
2023-09-22 08:15:24 INFO juju.worker.uniter.operation runhook.go:159 ran "db-relation-changed" hook (via hook dispatching script: dispatch)
2023-09-22 08:18:04 INFO juju.worker.uniter.operation runhook.go:159 ran "update-status" hook (via hook dispatching script: dispatch)
2023-09-22 08:23:57 INFO juju.worker.uniter.operation runhook.go:159 ran "update-status" hook (via hook dispatching script: dispatch)
2023-09-22 08:29:31 INFO juju.worker.uniter.operation runhook.go:159 ran "update-status" hook (via hook dispatching script: dispatch)
2023-09-22 08:34:24 INFO juju.worker.uniter.operation runhook.go:159 ran "update-status" hook (via hook dispatching script: dispatch)
However, when I look at the relation data, I see landscape-server/1 in the allowed-units:
I wonder if the list is supposed to be comma or space delimited. The relation data is comma separated but the code in the landscape-server charm doesn't appear to be looking for commas:
Changing this to "split(',')" does indeed seem to resolve this. I changed the src/charm.py in all the deployed units and removed and re-added the landscape-server:db landscape-postgresql:db-admin relation and my units are now all active/idle.
I've encountered this and can't seem to get past it. My leader unit is active/idle but the two other landscape-server units are "Waiting on relations: db".
The last few lines of the landscape-server unit logs on the waiting units:
2023-09-22 08:14:13 INFO juju.worker. uniter. operation runhook.go:159 ran "amqp-relation- changed" hook (via hook dispatching script: dispatch) uniter. operation runhook.go:159 ran "amqp-relation- changed" hook (via hook dispatching script: dispatch) server/ 1.juju- log server.go:316 db:51: landscape-server/1 not in allowed_units uniter. operation runhook.go:159 ran "db-relation- changed" hook (via hook dispatching script: dispatch) server/ 1.juju- log server.go:316 db:51: landscape-server/1 not in allowed_units uniter. operation runhook.go:159 ran "db-relation- changed" hook (via hook dispatching script: dispatch) uniter. operation runhook.go:159 ran "update-status" hook (via hook dispatching script: dispatch) uniter. operation runhook.go:159 ran "update-status" hook (via hook dispatching script: dispatch) uniter. operation runhook.go:159 ran "update-status" hook (via hook dispatching script: dispatch) uniter. operation runhook.go:159 ran "update-status" hook (via hook dispatching script: dispatch)
2023-09-22 08:14:14 INFO juju.worker.
2023-09-22 08:14:28 INFO unit.landscape-
2023-09-22 08:14:28 INFO juju.worker.
2023-09-22 08:15:24 INFO unit.landscape-
2023-09-22 08:15:24 INFO juju.worker.
2023-09-22 08:18:04 INFO juju.worker.
2023-09-22 08:23:57 INFO juju.worker.
2023-09-22 08:29:31 INFO juju.worker.
2023-09-22 08:34:24 INFO juju.worker.
However, when I look at the relation data, I see landscape-server/1 in the allowed-units:
$ juju show-unit landscape-server/1 --endpoint db jammy/landscape -server- 93 endpoint: db-admin -data: {} -postgresql/ 0:
allowed- subnets: 172.24. 15.171/ 32,172. 24.15.179/ 32,172. 24.15.181/ 32
allowed- units: landscape- server/ 0,landscape- server/ 1,landscape- server/ 2
egress- subnets: 172.24.15.167/32
ingress- address: 172.24.15.167 landscape- server fallback_ application_ name=landscape- server
host= 172.24. 15.168 password=xx port=5432 user=relation-51
private- address: 172.24.15.167 landscape- server fallback_ application_ name=landscape- server
host= 172.24. 15.167 password=xx port=5432 user=relation-51 -postgresql/ 1:
allowed- subnets: 172.24. 15.171/ 32,172. 24.15.179/ 32,172. 24.15.181/ 32
allowed- units: landscape- server/ 0,landscape- server/ 1,landscape- server/ 2
egress- subnets: 172.24.15.168/32
ingress- address: 172.24.15.168 landscape- server fallback_ application_ name=landscape- server
host= 172.24. 15.168 password=xx port=5432 user=relation-51
private- address: 172.24.15.168 landscape- server fallback_ application_ name=landscape- server
host= 172.24. 15.167 password=xx port=5432 user=relation-51
landscape-server/1:
machine: "9"
opened-ports: []
public-address: 172.24.15.179
charm: ch:amd64/
leader: true
life: alive
relation-info:
- relation-id: 51
endpoint: db
related-
application
related-units:
landscape
in-scope: true
data:
host: 172.24.15.168
master: dbname=
port: "5432"
standbys: dbname=
state: standby
user: relation-51
landscape
in-scope: true
data:
database: landscape-server
host: 172.24.15.168
master: dbname=
password: xx
port: "5432"
standbys: dbname=
state: master
user: relation-51
version: "14.7"
I wonder if the list is supposed to be comma or space delimited. The relation data is comma separated but the code in the landscape-server charm doesn't appear to be looking for commas:
allowed_units = unit_data[ "allowed- units"] .split( )
Changing this to "split(',')" does indeed seem to resolve this. I changed the src/charm.py in all the deployed units and removed and re-added the landscape-server:db landscape- postgresql: db-admin relation and my units are now all active/idle.