/tmp directory is being deleted

Bug #1974218 reported by Nicholas Malacarne
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
juju-backup-all
Fix Released
Undecided
Garrett Neugent

Bug Description

Hello,

The BootStack team recently ran into an issue with `juju-backup-all` on some of our clouds. In some instances, the entire `/tmp` directory is removed.

This may be due to cases where the `action_output` results are an empty string which would result in the deletion of the entire /tmp directory:

https://git.launchpad.net/juju-backup-all/tree/jujubackupall/backup.py#n84
https://git.launchpad.net/juju-backup-all/tree/jujubackupall/backup.py#n87
https://git.launchpad.net/juju-backup-all/tree/jujubackupall/backup.py#n74

Thanks.

Tags: bseng-124

Related branches

description: updated
Andrea Ieri (aieri)
tags: added: bseng-124
Changed in juju-backup-all:
assignee: nobody → Garrett Thompson (thogarre)
Changed in juju-backup-all:
status: New → In Progress
Revision history for this message
Garrett Neugent (thogarre) wrote :

It looks like an old version of the snap is running where this is happening. This line looks to be the culprit line (note that it’s the parent, not the path to the file):

```python
rm_command = "sudo rm -r {}".format(filepath.parent)
```

This line has since been removed [0], but a new version the snap has not yet been built, so it hasn't been tested/rolled out anywhere yet.

In the current version of the file, the `-r` flag is still being provided, despite all the backups being individual gzip files. I've submitted MR 424592 [1] to address this.

Note that I've also updated the ownership of the snap, and created a snap recipe [2] so that new snaps will automatically be built and published to the latest/edge edge when the master branch of this repo is updated.

I'll mark this as pending review to reflect the current status.

[0] https://git.launchpad.net/juju-backup-all/commit/?id=16c68c9cfe7ce5f48313c79e4e5a90a982ab2383
[1] https://code.launchpad.net/~thogarre/juju-backup-all/+git/juju-backup-all/+merge/424592
[2] https://launchpad.net/juju-backup-all/+snaps

Changed in juju-backup-all:
status: In Progress → Fix Committed
Changed in juju-backup-all:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.