canonical / charm-juju-backup-all

Juju Backup All - a charm to perform Juju and database backups
Apache License 2.0
1 stars 5 forks source link

NotImplementedError in get_controllers #8

Open jneo8 opened 11 months ago

jneo8 commented 11 months ago

juju-backup-all cron job failed with NotImplementedError. It looks like auto_backup.py script used the system installed juju lib rather the one in /var/lib/juju/agents/unit-juju-backup-all-0/charm/venv.

The workaround is to replace sys.path.append("REPLACE_CHARMDIR/venv") in auto_backup.py with sys.path.insert(0,"REPLACE_CHARMDIR/venv")

pip3 list |grep juju

juju (0.7.4) juju-wait (2.7.0)

error log 2022-07-13 06:45:38,473 DEBUG main writing error details to the results file 2022-07-13 06:45:38,473 ERROR main backup failed! check log for details Traceback (most recent call last): File "/var/lib/jujubackupall/auto_backup.py", line 156, in auto_backup.run() File "/var/lib/jujubackupall/auto_backup.py", line 130, in run backup_results = self.perform_backup() File "/var/lib/jujubackupall/auto_backup.py", line 67, in perform_backup ssh_helper.push_ssh_keys_to_models() File "/var/lib/juju/agents/unit-juju-backup-all-0/charm/src/utils.py", line 260, in push_ssh_keys_to_models for controller_name in backup_processor.controller_names: File "/var/lib/juju/agents/unit-juju-backup-all-0/charm/venv/jujubackupall/process.py", line 80, in controller_names controllers = get_all_controllers() File "/var/lib/juju/agents/unit-juju-backup-all-0/charm/venv/jujubackupall/utils.py", line 70, in get_all_controllers juju_controller_names = list(juju_local_env.get_controllers().keys()) File "/usr/lib/python3/dist-packages/juju/juju.py", line 63, in get_controllers raise NotImplementedError()


Imported from Launchpad using lp2gh.