------
Giving up after 5 attempts. ModuleNotFoundError: No module named 'boto3'
Something is wrong with the backup: Attempt of list Nr. 1 failed. ModuleNotFoundError: No module named 'boto3'
WARNING 1
. Attempt of list Nr. 1 failed. ModuleNotFoundError: No module named 'boto3'
Attempt of list Nr. 2 failed. ModuleNotFoundError: No module named 'boto3'
WARNING 1
. Attempt of list Nr. 2 failed. ModuleNotFoundError: No module named 'boto3'
Attempt of list Nr. 3 failed. ModuleNotFoundError: No module named 'boto3'
WARNING 1
. Attempt of list Nr. 3 failed. ModuleNotFoundError: No module named 'boto3'
Attempt of list Nr. 4 failed. ModuleNotFoundError: No module named 'boto3'
WARNING 1
. Attempt of list Nr. 4 failed. ModuleNotFoundError: No module named 'boto3'
ERROR 50 list
. Giving up after 5 attempts. ModuleNotFoundError: No module named 'boto3'
----------------------
When I manually run from SSH:
cd mailinabox
sudo management/backup.py
I get the same errors.
Ubuntu pushed out an update for Duplicity last week and it was installed on my Ubuntu 18.04 instance:
--------------------------
The following packages will be upgraded:
duplicity
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 330 kB of archives.
After this operation, 4096 B of additional disk space will be used.
Get:1 http://ppa.launchpad.net/duplicity-team/duplicity-release-git/ubuntu bionic/main amd64 duplicity amd64 0.8.23-ppa202205151528~ubuntu18.04.1 [330 kB]
Fetched 330 kB in 1s (542 kB/s)
(Reading database ... 134021 files and directories currently installed.)
Preparing to unpack .../duplicity_0.8.23-ppa202205151528~ubuntu18.04.1_amd64.deb ...
Unpacking duplicity (0.8.23-ppa202205151528~ubuntu18.04.1) over (0.8.22-ppa202203041847~ubuntu18.04.1) ...
Setting up duplicity (0.8.23-ppa202205151528~ubuntu18.04.1) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
----------------------------------------------
On several cloned instances of this mail server, I have tried:
Remove and re-install Duplicity
Install Boto3 using: sudo python3 -m pip install boto3 or
sudo -H pip install boto3
or
sudo apt install boto3
or
python3 -m pip install boto3
My understanding is that the boto3 module is only used for transfers to Amazon AWS S3. Thus other backup methods should continue to function.
I have one question:
Does anyone have a solution for this?
Note: I changed the backup method from the admin page to backups on the machine running MIAB. I then successfully ran the backup.py script and confirmed full backups were in /home/user-data/backup/encrypted
In the meantime, I will make daily snapshots of the instance. All help is appreciated.
Here is the link to i386 version of duplicity version 0.8.22-ppa202203041847~ubuntu18.04.1, just in case someone is running MIAB on i386 instead of amd64.
Edit:
I ran “sudo management/backup.py” which did not show any error or other messages and return value was also zero.
Many thanks! You instructions were great. I only needed to add “sudo” for the wget line.
I manually ran management/backup.py and S3 had a full backup in minutes.
Solution worked perfectly for me - my backups are back up and working. Thank you very much for sharing.
I’m new to MIAB so I’m just trying to work out what issues this tactical fix could do down the track.
I’m assuming the permanent fix for this will be a new version of MIAB - specifically an updated ~/mailinabox/management/backup.py that works with the latest version of duplicity. When that happens would the steps be that anyone who has applied this tactical fix would need to remove the hold, update to the latest version of duplicity then upgrade MIAB?
The duplicity is not installed from any of the repositories maintained by Ubuntu.
It is installed directly from a repo maintained by Duplicity developers, which is defined in file
AFAIK yes the “unhold” will enable update of duplicity and if boto3 dependency is not fixed, again AFAIK, in MIAB code base, duplicity will not work.
I poked around a bit at that new duplicity site, but didn’t find any built packages there. But I admit I didn’t try all --that-- hard, I will probably just run without backups for a while and hope the 22.04 miab upgrade comes before I encounter a catastrophic crash, and that the 22.04 upgrade fixes things, of course.
/usr/local/lib/python3.6/dist-packages/boto3/compat.py:88: PythonDeprecationWarning: Boto3 will no longer support Python 3.6 starting May 30, 2022. To continue receiving service updates, bug fixes, and security updates please upgrade to Python 3.7 or later. More information can be found here: https://aws.amazon.com/blogs/developer/python-support-policy-updates-for-aws-sdks-and-tools/
warnings.warn(warning, PythonDeprecationWarning)
I’m having this issue as well when I was trying to back up to S3
Based on aws sites
On May 30, 2022, the AWS SDK for Python (Boto3 and Botocore) and the AWS Command Line Interface (AWS CLI) v1 will no longer support Python 3.6.
Exactly. For now, what I did was just moved back to local backups. I installed Python3.7 on my box. Created a simple python script that’s triggered by a cron that will move the local backups over to AWS S3 until I have more time to find a solution.
Update:
I rewrote the backup.py script to work with Python3.7. I only had time to test it twice and seems to be working. I’ll work on it more tonight. If I feel that’s working, I’ll provide the script. Hopefully, when the next MIAB version comes out it will fix the problem and just overwrite the backup.py file.
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.
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.
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.
My Python’s pretty rusty, so I’m sure a proper fix will be better than my quick hack. 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!