Comment 1 for bug 1930442

Revision history for this message
Paul Goins (vultaire) wrote :

While I think this is tangential to the bug's intended issue (lack of alerting or "juju status" indication of when replication is not healthy), if you wish to know the exact context of the Juju error encountered, here is a traceback from the failed replication-relation-changed hook:

2021-06-01 16:11:04 ERROR juju-log replication:3: Hook error:
Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-landscape-postgresql-1/.venv/lib/python3.6/site-packages/charms/reactive/__init__.py", line 74, in main
    bus.dispatch(restricted=restricted_mode)
  File "/var/lib/juju/agents/unit-landscape-postgresql-1/.venv/lib/python3.6/site-packages/charms/reactive/bus.py", line 390, in dispatch
    _invoke(other_handlers)
  File "/var/lib/juju/agents/unit-landscape-postgresql-1/.venv/lib/python3.6/site-packages/charms/reactive/bus.py", line 359, in _invoke
    handler.invoke()
  File "/var/lib/juju/agents/unit-landscape-postgresql-1/.venv/lib/python3.6/site-packages/charms/reactive/bus.py", line 181, in invoke
    self._action(*args)
  File "/var/lib/juju/agents/unit-landscape-postgresql-1/charm/reactive/postgresql/replication.py", line 635, in drain_master_and_promote_anointed
    local_offset = postgresql.wal_received_offset(postgresql.connect())
  File "/var/lib/juju/agents/unit-landscape-postgresql-1/charm/reactive/postgresql/postgresql.py", line 130, in connect
    return psycopg2.connect(user=user, database=database, host=host, port=port_)
  File "/usr/lib/python3/dist-packages/psycopg2/__init__.py", line 130, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: FATAL: the database system is starting up