Just upgraded my server to Ubuntu 22 and version 60.1. Figured now is a good time to setup S3 backups which I’ve been meaning to do for ages.
I’ve created my S3 bucket, generated my access key with “S3 Full Access” and input all the details into mailinabox on the Backup Status screen, however when I try to save this I get an error:
<!doctype html> 500 Internal Server Error
Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
Relevant extract from syslog attached:
Dec 12 14:58:36 mail01 start[80869]: [2022-12-12 14:58:36,728] ERROR in app: Exception on /system/backup/config [POST]
Dec 12 14:58:36 mail01 start[80869]: Traceback (most recent call last):
Dec 12 14:58:36 mail01 start[80869]: File “/usr/local/lib/mailinabox/env/lib/python3.10/site-packages/flask/app.py”, line 2525, in wsgi_app
Dec 12 14:58:36 mail01 start[80869]: response = self.full_dispatch_request()
Dec 12 14:58:36 mail01 start[80869]: File “/usr/local/lib/mailinabox/env/lib/python3.10/site-packages/flask/app.py”, line 1822, in full_dispatch_request
Dec 12 14:58:36 mail01 start[80869]: rv = self.handle_user_exception(e)
Dec 12 14:58:36 mail01 start[80869]: File “/usr/local/lib/mailinabox/env/lib/python3.10/site-packages/flask/app.py”, line 1820, in full_dispatch_request
Dec 12 14:58:36 mail01 start[80869]: rv = self.dispatch_request()
Dec 12 14:58:36 mail01 start[80869]: File “/usr/local/lib/mailinabox/env/lib/python3.10/site-packages/flask/app.py”, line 1796, in dispatch_request
Dec 12 14:58:36 mail01 start[80869]: return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
Dec 12 14:58:36 mail01 start[80869]: File “/root/mailinabox/management/daemon.py”, line 75, in newview
Dec 12 14:58:36 mail01 start[80869]: return viewfunc(*args, **kwargs)
Dec 12 14:58:36 mail01 start[80869]: File “/root/mailinabox/management/daemon.py”, line 635, in backup_set_custom
Dec 12 14:58:36 mail01 start[80869]: return json_response(backup_set_custom(env,
Dec 12 14:58:36 mail01 start[80869]: File “/root/mailinabox/management/backup.py”, line 515, in backup_set_custom
Dec 12 14:58:36 mail01 start[80869]: list_target_files(config)
Dec 12 14:58:36 mail01 start[80869]: File “/root/mailinabox/management/backup.py”, line 471, in list_target_files
Dec 12 14:58:36 mail01 start[80869]: bucket_objects = s3.list_objects_v2(Bucket=bucket, Prefix=path)[‘Contents’]
Dec 12 14:58:36 mail01 start[80869]: KeyError: ‘Contents’
Dec 12 14:58:36 mail01 Exception on /system/backup/config [POST]#012Traceback (most recent call last):#012 File “/usr/local/lib/mailinabox/env/lib/python3.10/site-packages/flask/app.py”, line 2525, in wsgi_app#012 response = self.full_dispatch_request()#012 File “/usr/local/lib/mailinabox/env/lib/python3.10/site-packages/flask/app.py”, line 1822, in full_dispatch_request#012 rv = self.handle_user_exception(e)#012 File “/usr/local/lib/mailinabox/env/lib/python3.10/site-packages/flask/app.py”, line 1820, in full_dispatch_request#012 rv = self.dispatch_request()#012 File “/usr/local/lib/mailinabox/env/lib/python3.10/site-packages/flask/app.py”, line 1796, in dispatch_request#012 return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)#012 File “/root/mailinabox/management/daemon.py”, line 75, in newview#012 return viewfunc(*args, **kwargs)#012 File “/root/mailinabox/management/daemon.py”, line 635, in backup_set_custom#012 return json_response(backup_set_custom(env,#012 File “/root/mailinabox/management/backup.py”, line 515, in backup_set_custom#012 list_target_files(config)#012 File “/root/mailinabox/management/backup.py”, line 471, in list_target_files#012 bucket_objects = s3.list_objects_v2(Bucket=bucket, Prefix=path)[‘Contents’]#012KeyError: ‘Contents’