在 VPS(Contabo)上运行 Ubuntu 22.04.2 LTS,使用 Duplicity 0.8.21 和 Python 3.10.12,我正在备份到 Backblaze B2。完整备份运行良好,但在使用相同选项和目标文件夹运行增量备份时出现 Python 错误。
运行 /root、/home、/opt、/etc、/tmp 和 /var 的完整备份:
duplicity full --progress --exclude-filelist /home/duplicity_exclude / b2://[keyID]:[application key]@[B2 bucket name]
这很好用。
现在,当运行增量备份时,我收到错误:
root@vps:/# duplicity incremental --progress --exclude-filelist /home/duplicity_exclude / b2://[keyID]:[application key]@[B2 bucket name]
Reading globbing filelist /home/duplicity_exclude
Local and Remote metadata are synchronized, no sync needed.
Last full backup date: Fri Sep 1 22:33:41 2023
GnuPG passphrase for decryption:
Retype passphrase for decryption to confirm:
Attempt of get Nr. 1 failed. TypeError: argument should be a str object or an os.PathLike object returning str, not <class 'bytes'>
Attempt of get Nr. 2 failed. TypeError: argument should be a str object or an os.PathLike object returning str, not <class 'bytes'>
Attempt of get Nr. 3 failed. TypeError: argument should be a str object or an os.PathLike object returning str, not <class 'bytes'>
Attempt of get Nr. 4 failed. TypeError: argument should be a str object or an os.PathLike object returning str, not <class 'bytes'>
Giving up after 5 attempts. TypeError: argument should be a str object or an os.PathLike object returning str, not <class 'bytes'>`
到底发生什么事了?
答案1
看起来像这里讨论的错误https://gitlab.com/duplicity/duplicity/-/issues/701#note_1317189517
tl;dr - python b2sdk 模块更改了 API,旧版 duplicity 现在会抛出上述错误。解决它
- 将 b2sdk 模块降级并固定到版本 1.19.0 或更低版本
- 升级到最新的 duplicity 版本 2.1+