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
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: juju/agents/ unit-landscape- postgresql- 1/.venv/ lib/python3. 6/site- packages/ charms/ reactive/ __init_ _.py", line 74, in main dispatch( restricted= restricted_ mode) juju/agents/ unit-landscape- postgresql- 1/.venv/ lib/python3. 6/site- packages/ charms/ reactive/ bus.py" , line 390, in dispatch other_handlers) juju/agents/ unit-landscape- postgresql- 1/.venv/ lib/python3. 6/site- packages/ charms/ reactive/ bus.py" , line 359, in _invoke invoke( ) juju/agents/ unit-landscape- postgresql- 1/.venv/ lib/python3. 6/site- packages/ charms/ reactive/ bus.py" , line 181, in invoke _action( *args) juju/agents/ unit-landscape- postgresql- 1/charm/ reactive/ postgresql/ replication. py", line 635, in drain_master_ and_promote_ anointed wal_received_ offset( postgresql. connect( )) juju/agents/ unit-landscape- postgresql- 1/charm/ reactive/ postgresql/ postgresql. py", line 130, in connect connect( user=user, database=database, host=host, port=port_) python3/ dist-packages/ psycopg2/ __init_ _.py", line 130, in connect factory= connection_ factory, **kwasync) OperationalErro r: FATAL: the database system is starting up
Traceback (most recent call last):
File "/var/lib/
bus.
File "/var/lib/
_invoke(
File "/var/lib/
handler.
File "/var/lib/
self.
File "/var/lib/
local_offset = postgresql.
File "/var/lib/
return psycopg2.
File "/usr/lib/
conn = _connect(dsn, connection_
psycopg2.