Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"database-peers-relation-broken" 'NoneType' object has no attribute 'data' #691

Open
mcfly722 opened this issue Dec 4, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@mcfly722
Copy link

mcfly722 commented Dec 4, 2024

Steps to reproduce

  1. Install PostgreSQL using juju

  2. Try to delete failed node

juju remove-unit postgresql/1 --destroy-storage

Expected behavior

Expected that unit would be deleted without problems

Actual behavior

Unit postgresql/1 becomes in error state with 'hook failed: "database-peers-relation-broken"' error.

Versions

Operating system: Ubuntu 22.04.5 LTS
Juju CLI: 3.4.6-genericlinux-amd64
Charm revision: 411
LXD: 5.21.2 LTS

juju status

Model            Controller        Cloud/Region      Version  SLA          Timestamp
postgresql-maas  lxd-maas-default  lxd-maas/default  3.4.4    unsupported  14:14:07Z

SAAS        Status  Store                 URL
grafana     active  controller-openstack  admin/cos.grafana
loki        active  controller-openstack  admin/cos.loki
prometheus  active  controller-openstack  admin/cos.prometheus

App                  Version  Status  Scale  Charm            Channel        Rev  Exposed  Message
data-integrator               active      2  data-integrator  latest/stable   27  no
grafana-agent                 active      2  grafana-agent    latest/stable  216  no
keycloac-integrator           active      1  data-integrator  latest/stable   41  no
postgresql           14.11    active      3  postgresql       14/stable      411  no
postgresql-keycloak  14.11    active      1  postgresql       14/stable      411  no

Unit                    Workload  Agent  Machine  Public address  Ports     Message
data-integrator/3*      active    idle   0        10.88.80.8
data-integrator/4       active    idle   1        10.88.80.9
keycloac-integrator/0*  active    idle   0        10.88.80.8
postgresql-keycloak/0*  active    idle   6        10.88.81.132    5432/tcp  Primary
postgresql/0*           active    idle   0        10.88.80.8      5432/tcp  Primary
  grafana-agent/5       active    idle            10.88.80.8
postgresql/1            error     idle   1        10.88.80.9      5432/tcp  hook failed: "database-peers-relation-broken"
postgresql/5            active    idle   9        10.88.80.10     5432/tcp
  grafana-agent/6*      active    idle            10.88.80.10

Machine  State    Address       Inst id        Base          AZ  Message
0        started  10.88.80.8    juju-9eb3f3-0  [email protected]      Running
1        started  10.88.80.9    juju-9eb3f3-1  [email protected]      Running
6        started  10.88.81.132  juju-9eb3f3-6  [email protected]      Running
9        started  10.88.80.10   juju-9eb3f3-9  [email protected]      Running

Log output

juju debug-log --include=postgresql/1

unit-postgresql-1: 14:10:01 DEBUG unit.postgresql/1.juju-log database-peers:2: ops 2.12.0 up and running.
unit-postgresql-1: 14:10:01 DEBUG unit.postgresql/1.juju-log database-peers:2: Re-emitting deferred event <RelationChangedEvent via PostgresqlOperatorCharm/on/database_peers_relation_changed[172339]>.
unit-postgresql-1: 14:10:01 ERROR unit.postgresql/1.juju-log database-peers:2: Uncaught exception while in charm code:
Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-postgresql-1/charm/./src/charm.py", line 1646, in <module>
    main(PostgresqlOperatorCharm)
  File "/var/lib/juju/agents/unit-postgresql-1/charm/venv/ops/main.py", line 544, in main
    manager.run()
  File "/var/lib/juju/agents/unit-postgresql-1/charm/venv/ops/main.py", line 520, in run
    self._emit()
  File "/var/lib/juju/agents/unit-postgresql-1/charm/venv/ops/main.py", line 506, in _emit
    self.framework.reemit()
  File "/var/lib/juju/agents/unit-postgresql-1/charm/venv/ops/framework.py", line 861, in reemit
    self._reemit()
  File "/var/lib/juju/agents/unit-postgresql-1/charm/venv/ops/framework.py", line 941, in _reemit
    custom_handler(event)
  File "/var/lib/juju/agents/unit-postgresql-1/charm/./src/charm.py", line 479, in _on_peer_relation_changed
    if "cluster_initialised" not in self._peers.data[self.app]:
AttributeError: 'NoneType' object has no attribute 'data'
unit-postgresql-1: 14:10:02 ERROR juju.worker.uniter.operation hook "database-peers-relation-broken" (via hook dispatching script: dispatch) failed: exit status 1
@mcfly722 mcfly722 added the bug Something isn't working label Dec 4, 2024
Copy link

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/DPE-6144.

This message was autogenerated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant