Comment 8 for bug 2019086

Revision history for this message
Vern Hart (vern) wrote :

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:

$ juju show-unit landscape-server/1 --endpoint db
landscape-server/1:
  machine: "9"
  opened-ports: []
  public-address: 172.24.15.179
  charm: ch:amd64/jammy/landscape-server-93
  leader: true
  life: alive
  relation-info:
  - relation-id: 51
    endpoint: db
    related-endpoint: db-admin
    application-data: {}
    related-units:
      landscape-postgresql/0:
        in-scope: true
        data:
          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
          host: 172.24.15.168
          ingress-address: 172.24.15.167
          master: dbname=landscape-server fallback_application_name=landscape-server
            host=172.24.15.168 password=xx port=5432 user=relation-51
          port: "5432"
          private-address: 172.24.15.167
          standbys: dbname=landscape-server fallback_application_name=landscape-server
            host=172.24.15.167 password=xx port=5432 user=relation-51
          state: standby
          user: relation-51
      landscape-postgresql/1:
        in-scope: true
        data:
          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
          database: landscape-server
          egress-subnets: 172.24.15.168/32
          host: 172.24.15.168
          ingress-address: 172.24.15.168
          master: dbname=landscape-server fallback_application_name=landscape-server
            host=172.24.15.168 password=xx port=5432 user=relation-51
          password: xx
          port: "5432"
          private-address: 172.24.15.168
          standbys: dbname=landscape-server fallback_application_name=landscape-server
            host=172.24.15.167 password=xx port=5432 user=relation-51
          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.