Bug
Running the create-replication action on a unit that has no async-replication relation crashes with an unhandled AttributeError.
Steps to reproduce
- Deploy
postgresql (VM charm) with no async-replication relation
- Run
juju run postgresql/<unit> create-replication name=default
Error
Action id 2865 failed: exit status 1
Uncaught AttributeError in charm code: 'NoneType' object has no attribute 'name'
Full traceback from /var/log/juju/unit-postgresql-54.log:
Traceback (most recent call last):
...
File ".../src/relations/async_replication.py", line 602, in _on_create_replication
if self._relation.name == REPLICATION_CONSUMER_RELATION:
^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'name'
self._relation is None because no async-replication relation exists on the unit. The handler does not guard against this.
Environment
- Charm: Charmed PostgreSQL VM
- Charm revision: 1047
- Juju version:
juju version on controller
Bug
Running the
create-replicationaction on a unit that has noasync-replicationrelation crashes with an unhandledAttributeError.Steps to reproduce
postgresql(VM charm) with no async-replication relationjuju run postgresql/<unit> create-replication name=defaultError
Full traceback from
/var/log/juju/unit-postgresql-54.log:self._relationisNonebecause noasync-replicationrelation exists on the unit. The handler does not guard against this.Environment
juju versionon controller