Swift backend crash with KeyError: 'headers' (0.8.20 regression)
I have:
-
searched https://gitlab.com/duplicity/duplicity/-/issues for similar issues. If you find a similar issue and the issue is still open, add a comment to the existing issue instead of opening a new one. If you find a Closed issue that seems like it is the same thing that you're experiencing, open a new issue and include a link to the original issue in the body of your new one. -
searched https://bugs.launchpad.net/duplicity for similar issues. If you find a similar issue, open a new issue on here and include a link to the original issue in the body of your new one. -
tested that this issue still occurs on the latest stable snap (install instructions: https://snapcraft.io/duplicity), please include the snap version ( snap info duplicity | grep installed
) output:installed: x.xx.xx (xx)
-
ideally, tested that this issue still occurs on the latest edge snap, if you can test without risking your data. Please include the snap version output: installed: x.xx.xx (xx)
Summary
Swift backend upload crash since 0.8.20 release with KeyError: 'headers'
.
Regression introduced by ff191987
Environment
OS X 11.4 (Big Sur)
duplicity 0.8.20
Python 3.9.6
python-swiftclient 3.12.0
export SWIFT_AUTHURL=https://auth.cloud.ovh.net/v3
export SWIFT_TENANTNAME=xxxxx
export SWIFT_USERNAME=xxxx
export SWIFT_PASSWORD=xxxx
export SWIFT_AUTHVERSION=3
export SWIFT_REGIONNAME=GRA
/usr/local/Cellar/duplicity/0.8.20/libexec/bin/duplicity \
--full-if-older-than 30D --progress --verbosity info \
--name home --asynchronous-upload --volsize 20 \
--log-file /Users/colin/.backup/log/duplicity.log \
--exclude-filelist /Users/colin/bin/backup_duplicity/exclude-list-home.txt \
/Users/colin swift://home
Darwin MacBook-Pro-de-XXX.local 20.5.0 Darwin Kernel Version 20.5.0: Sat May 8 05:10:33 PDT 2021; root:xnu-7195.121.3~9/RELEASE_X86_64 x86_64 i386.
/usr/local/Cellar/duplicity/0.8.20/libexec/bin/python3.9 3.9.6 (default, Jun 29 2021, 05:25:02)
[Clang 12.0.5 (clang-1205.0.22.9)]
Steps to reproduce
Just run the command line above.
What is the current bug behaviour?
Usual backup script fail to upload since 0.8.20 release with the command line above. I'm getting the following backtrace with --verbosity debug
Main action: inc
...
Writing duplicity-inc.20210707T130927Z.vol1.difftar.gpg
AsyncScheduler: instantiating at concurrency 1
AsyncScheduler: scheduling task for asynchronous execution
0.0KB 00:00:03 [0.0KB/s] [> ] 0% ETA 3sec
Backtrace of previous error: Traceback (innermost last):
File "/usr/local/Cellar/duplicity/0.8.20/libexec/lib/python3.9/site-packages/duplicity/backend.py", line 384, in inner_retry
return fn(self, *args)
File "/usr/local/Cellar/duplicity/0.8.20/libexec/lib/python3.9/site-packages/duplicity/backend.py", line 681, in _do_query
raise e
File "/usr/local/Cellar/duplicity/0.8.20/libexec/lib/python3.9/site-packages/duplicity/backend.py", line 675, in _do_query
return self.backend._query(filename)
File "/usr/local/Cellar/duplicity/0.8.20/libexec/lib/python3.9/site-packages/duplicity/backends/swiftbackend.py", line 197, in _query
return {u'size': int(sobject[u'headers'][u'content-length'])}
KeyError: 'headers'
Attempt 1 failed. KeyError: headers