Cannot Backup since Duplicity update

This worked for me:

sudo apt-get remove duplicity
sudo apt-get install duplicity=0.7.17-0ubuntu1
sudo apt-mark hold duplicity
1 Like

Ah good idea!

I’d like to include something in the next release of Mail-in-a-Box to fix this. I use S3 backups so I’m facing this issue also.

I’m concerned though that this rollback might have unintended consequences since it’s going back a major version. We were probably all using 0.8.21-ppa202111091602~ubuntu1 from the duplicity PPA until June 5, which is when my box automatically updated to 0.8.23-ppa202205151528~ubuntu18.04.1.

We switched to the duplicity PPA in Implement Backblaze for Backup by hija · Pull Request #1812 · mail-in-a-box/mailinabox · GitHub with adding support for Backblaze backups. I assume that took us from a 0.7 version to an 0.8 version but I haven’t checked.

Hopefully someone has some ideas for how we can implement a fix that works for everyone.

Thanks for the tip, watching this space to see if we have more elegant way to fix this long term.

I think I’ve figured out how to get things working with the latest duplicity. I’ll post more in S3 Backups failing with `ModuleNotFoundError: No module named 'boto3'` · Issue #2123 · mail-in-a-box/mailinabox · GitHub when it’s ready.

3 Likes

Can confirm this fixed the “boto3” s3 backup issue with my install. Thanks @JoshData for the quick fix. No noticeable issues after the update FWIW.

1 Like

Same here. Version 57 works perfectly for me for S3 compatible backups to Wasabi. Thanks so much @JoshData.

In case it helps others I did have the tactical downgrade fix in place prior to upgrade. So I made sure I did the unhold and upgrade prior to MIAB upgrade to 57.

sudo apt-mark unhold duplicity
sudo apt-get update
sudo apt-get upgrade
curl -s https://mailinabox.email/setup.sh | sudo bash
1 Like

I unmarked duplicity, then did an update, and upgrade duplicity.

I upgraded MiaB to v57.

I went to the admin and did a system check. It reported that I have more than one backup cache.

I went to admin / Backup Status. I got this message:

#### Backup Error
not enough values to unpack (expected 2, got 1)

Did it loose the backup configuration settings because the values displayed on the page is completely incorrect?

Did I set something wrong with the MiaB?

I’m using Wasabi which is a S3 service.

(Kudos to @JoshData for working on a fix!)

1 Like

To fix the “not enough values to unpack” backup error, I edited mailinabox/management/backup.py and changed line 211 from:

                target[1], target[2] = target[2].lstrip('/').split('/', 1)

to:

                try:
                        target[1], target[2] = target[2].lstrip('/').split('/', 1)
                except Exception as e:
                        target[1] = target[2].lstrip('/')
                        target[2] = ""

My Python’s pretty rusty, so I’m sure a proper fix will be better than my quick hack. :slight_smile: If you make these temporary changes yourself, please note the leading whitespace are all tabs, NOT individual spaces.

After that change, running “mailinabox/management/backup.py --full” worked fine for me.

I did have to reboot to get the admin page to load up correctly. Reboot probably wasn’t necessary, but seemed safest.

PS (should’ve been first thing I wrote): Thank you @JoshData for all your work!

2 Likes

Thank you for your “quick hack.” It allowed me to temporarily work around the “not enough values to unpack” backup error.

Thanks for this work around. It worked fine for me on an Amazon Lightsail instance. I assume that one needs to leave the changes in the backup.py until another upgrade comes along?
Thanks,
dfowlkes

Worked for me too. Ideally, it gets fixed next release and the file will be naturally updated.

I made the suggested changes in nano (vi was messing with tabs) and then

I found that when I did this I lost access to the box (both web as well as it responding to any mail clients).

I figured I would go and delete the contents of the s3 storage directory and backup caches and re-run the install.

Even on a “fresh” install I still get the error.
not enough values to unpack (expected 2, got 1)

I am happy to make the changes to mailinabox/management/backup.py and just wait if that is the only way to get things going but had thought with my “scorched earth” it would have worked.

EDIT…
Re read backup.py
I hadn’t realised that it completely stopped all system services so that makes sense.

FINAL EDIT…Hopefully helps someone.
Being paranoid, I ended up.

  1. Deleting the caches as suggested
  2. Setting my backup s3 to off
  3. making the changes to the file as noted
  4. reboot
    5.enabling the s3 backup and checking my access keys etc.
  5. backup ran overnight as shows correctly.
1 Like

Hi,

I also have the following problem with my backups on S3 when I go to the backups page:
not enough values to unpack (expected 2, got 1)

When I run in CLI : mailinabox/management/backup.py --full
I get this error : Attempt of list Nr. 1 failed. ModuleNotFoundError: No module named 'boto3

I wanted to make the fix of @makeitgo by editing mailinabox/management/backup.py, but I can’t find the code to replace in my file.

Is this fix made for V0.57 ? or for V0.56 ?

If you have some tracks to correct I’m interested :wink:

@regne the quickhack was for V0.57. (I would’ve updated my previous post to clarify, but seems I can’t edit after a few days.)

The fix was for 0.57 and @makeitgo did great with it.
Its on the line he mentioned (181 from memory) and if you see my post I had to edit with with nano as vi was saving with spaces instead of tabs.

You can verify that you made the change successfully by running the file to either get status or run a backup. (When you try with the broken one it will return an error).

pwd
/home/ubuntu
sudo mailinabox/management/backup.py --status

or if you want to manually run a full backup. Be aware that this will stop mail services while its running.

sudo mailinabox/management/backup.py --full

I let it do its thing overnight and it was happy.

Thank you for your answers.

In fact what happens is that my file /home/ubuntu/mailinabox/management/backup.py was not up to date.

I reinstalled Mail in a box and now I have the right code. I have now succeeded in applying the fix!

Thanks a lot for your help!

Glad its sorted. Thank @makeitgo as he figured out the fix. I just gave you a little more info in the answers. Enjoy.

Same issue. No backups have been done for a month or two.

So you have decided to necro-post on an old thread from a year ago which is highly unlikely to be relevant? Please create a new thread with any relevant information that others can use to assist you such as error messages, logs, etc.