Backup script failing

I removed python-future and then get this error:
root@box:~# /root/mailinabox/management/backup.py Traceback (most recent call last): File "/usr/bin/duplicity", line 32, in <module> from duplicity import gpg File "/usr/local/lib/python3.10/dist-packages/duplicity/gpg.py", line 40, in <module> from duplicity import tempdir File "/usr/local/lib/python3.10/dist-packages/duplicity/tempdir.py", line 30, in <module> from future import standard_library ModuleNotFoundError: No module named 'future' Something is wrong with the backup:

There is no /usr/local/lib/python3.10/dist-packages/duplicity/ directory on our MiaB instance. Currently, running “duplicity --version” returns “duplicity 2.1.3” and running “python3 --version” returns “Python 3.10.12” on our instance. Compare what you see from your MiaB instance to these versions. If you see different versions then review what was reported when you ran “apt purge python3-future” and compare that to what I quoted yesterday appearing above, adjusting for the now newer version of duplicity.

If something appears wrong, or if you continue the see the error message that you quoted, then I recommend reinstalling python and duplicity by running “apt-get reinstall python3” and “apt-get reinstall duplicity” which should correct any installation or update errors related to those packages. I hope that this helps.

@SHAdmin, thank you, your post pointed me in the right direction. python3-future wasn’t installed, so I did the following:

  • rm -rf /usr/local/lib/python3.10/dist-packages/duplicity/
  • apt-get purge duplicity
  • apt-get reinstall python3
  • apt-get reinstall duplicity

After this, I was able to run backup.py without errors.

Many thanks!

I have been having the same issues. I’ve tried several of the suggested fixes mentioned in this topic with no resolution. The error message I receive when running sudo management/backup.py from the /home/ubuntu/mailinabox directory is

GPGError: GPG Failed, see log below:
===== Begin GnuPG log =====
gpg: AES256.CFB encrypted data
gpg: encrypted with 1 passphrase
gpg: decryption failed: Bad session key
===== End GnuPG log =====

Traceback (most recent call last):
  File "/home/ubuntu/mailinabox/management/backup.py", line 647, in <module>
    perform_backup(full_backup)
  File "/home/ubuntu/mailinabox/management/backup.py", line 318, in perform_backup
    shell('check_call', [
  File "/home/ubuntu/mailinabox/management/utils.py", line 126, in shell
    ret = getattr(subprocess, method)(cmd_args, **kwargs)
  File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/bin/duplicity', 'full', '--verbosity', 'warning', '--no-print-statistics', '--archive-dir', '/home/user-data/backup/cache', '--exclude', '/home/user-data/backup', '--volsize', '250', '--gpg-options', "'--cipher-algo=AES256'", '--allow-source-mismatch', '/home/user-data', 'file:///home/user-data/backup/encrypted']' returned non-zero exit status 31.

I have tried deleting the secret key, rerunning the MIAB install script, downloading the new secret key, then rerunning the backup.py script, but I still get the same error. My last full backup was on Aug 25 and I need to get this working. At the moment I’m just trying to get the local backup working before switching back to Amazon S3.

Help would be greatly appreciated!!

Ok, so I’ve finally moved past the GPG errors. I fixed those by modifying the gpg-options in backup.py like below. There are 2 places in the script - around line 60 and 310.
Not working:

"--gpg-options", "--cipher-algo=AES256"

Working:

"--gpg-options", "--cipher-algo AES256"

Now I’m onto a brand new error.

ubuntu@xxxxx:~/mailinabox/management$ sudo ./backup.py 
UnsupportedBackendScheme: scheme not supported in url: boto+s3://backup-xxxxx/mail-backup
Something is wrong with the backup: ERROR 23 UnsupportedBackendScheme
. UnsupportedBackendScheme: scheme not supported in url: boto+s3://backup-xxxxx/mail-backup

The AWS credentials are just fine - I was able to list my old backups in the management GUI. The custom.yaml file at /home/user-data/backup/ seems ok. I haven’t figured out where to go from here.

Ok - weird. The mailinabox upgrade that I performed didn’t overwrite my old backup.py apparently… I grabbed a fresh copy from https://github.com/mail-in-a-box/mailinabox/blob/main/management/backup.py. Everything works now.

Try using /root/mailinabox/management

Not the one in your home directory.

This topic was automatically closed 40 days after the last reply. New replies are no longer allowed.