Open pckilgore opened 2 years ago
Yep. This was reported on the forum. I'd appreciate anyone's help making a concise fix to the code.
I started down this path and ended up realizing, it's not simple!
Surprised no libraries existed so made one: https://github.com/pckilgore/s3_endpoint_parse
What's your feeling on dependencies? The entire lib is one file, I could also just inline it /shrug.
Mail-in-a-Box forms the URL from the options the user gives in the control panel (at https://github.com/mail-in-a-box/mailinabox/blob/main/management/templates/system-backup.html#L297), and we no longer pass the URL directly to duplicity, so we're not actually dealing with "S3 URLs" anywhere. We only have to support the URLs that our application has constructed, which happens to be the Path Style for S3.
My non-AWS S3 backups abruptly broke for apparently this reason when I upgraded from Mail-in-a-Box v56 (I think?) to v57a, with repeated error emails reading not enough values to unpack (expected 2, got 1)
First I regenerated my access keys and re-entered all of my S3 bucket's information, and Mail-in-a-Box gave me a popup reading "OK", but then it immediately gave me another popup reading not enough values to unpack (expected 2, got 1)
again. Adding a trailing slash to the "S3 Path" field did, in fact, fix the problem.
As an aside, when I was re-entering the S3 bucket's information, and I initially didn't re-enter all of the fields, the error message that popped up was (a) not particularly helpful, and (b) displayed escaped HTML markup, like so:
This is only tangentially related, so I should probably open a separate issue, but idk.
Just dropped in to say I'm having the same issue and @pckilgore's suggestion to add a /
to the bucket name (in the web UI) fixes the not enough values to unpack (expected 2, got 1)
error for me.
This line:
https://github.com/mail-in-a-box/mailinabox/blob/99474b348f0dd2632057c18c6a8c4e6464962878/management/backup.py#L211
Causes an exception when attempting to unpack a two-tuple that's actually a single value where the S3 URL does not contain an object path for the backups (or a trailing "/").
Worked around it by adding the "/" to my config.
Works
Fails
(Crashes admin page)