Linux

到 S3 的重複備份:BackendException

  • February 14, 2022

我正在嘗試將我的 Duplicity 安裝配置為備份到 Amazon S3 儲存桶。我不斷收到BackendException錯誤消息,沒有更多詳細資訊。

**編輯:**我已經從這個問題中刪除了我的 Duply 配置,以便更多地隔離問題並切換到一個小目錄(10 MB,34 個文件)上的普通 duplicity 命令。

這是我要執行的命令:

duplicity full ./logs "s3://s3-us-east-1.amazonaws.com/bucketname" -v9

這是輸出:

root@ats:/var/ats# duplicity full ./logs "s3://s3-us-east-1.amazonaws.com/bucketname" -v9

Duplicity 0.6 series is being deprecated:
See http://www.nongnu.org/duplicity/

Using archive dir: /root/.cache/duplicity/876c7d0b54276e675d41f6ea6077d52f
Using backup name: 876c7d0b54276e675d41f6ea6077d52f
Import of duplicity.backends.botobackend Succeeded
Import of duplicity.backends.cfbackend Succeeded
Import of duplicity.backends.dpbxbackend Succeeded
Import of duplicity.backends.ftpbackend Succeeded
Import of duplicity.backends.ftpsbackend Succeeded
Import of duplicity.backends.gdocsbackend Succeeded
Import of duplicity.backends.hsibackend Succeeded
Import of duplicity.backends.imapbackend Succeeded
Import of duplicity.backends.localbackend Succeeded
Import of duplicity.backends.megabackend Succeeded
Import of duplicity.backends.rsyncbackend Succeeded
Import of duplicity.backends.sshbackend Succeeded
Import of duplicity.backends.swiftbackend Succeeded
Import of duplicity.backends.tahoebackend Succeeded
Import of duplicity.backends.webdavbackend Succeeded
Import of duplicity.backends.~par2wrapperbackend Succeeded
Using temporary directory /tmp/duplicity-sQ3sGs-tempdir
Backend error detail: Traceback (most recent call last):
 File "/usr/local/bin/duplicity", line 1509, in <module>
   with_tempdir(main)
 File "/usr/local/bin/duplicity", line 1503, in with_tempdir
   fn()
 File "/usr/local/bin/duplicity", line 1336, in main
   action = commandline.ProcessCommandLine(sys.argv[1:])
 File "/usr/local/lib/python2.7/dist-packages/duplicity/commandline.py", line 1062, in ProcessCommandLine
   backup, local_pathname = set_backend(args[0], args[1])
 File "/usr/local/lib/python2.7/dist-packages/duplicity/commandline.py", line 955, in set_backend
   globals.backend = backend.get_backend(bend)
 File "/usr/local/lib/python2.7/dist-packages/duplicity/backend.py", line 163, in get_backend
   return _backends[pu.scheme](pu)
 File "/usr/local/lib/python2.7/dist-packages/duplicity/backends/_boto_single.py", line 163, in __init__
   self.resetConnection()
 File "/usr/local/lib/python2.7/dist-packages/duplicity/backends/_boto_single.py", line 189, in resetConnection
   raise BackendException(err.message)
BackendException

BackendException:

我已經用這個腳本測試了 Boto(這是 Duplicity 用於 S3 連接的):

root@ats:/var/ats# python
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import boto.s3
>>> conn = boto.s3.connect_to_region("us-east-1")
>>> bucket = conn.get_bucket("bucketname")
>>> for key in bucket.list(): print key, key.storage_class
...
<Key: bucketname,test.txt> STANDARD
>>> exit()

我已經確保我正在執行最新的適當版本的 duplicity 和 python,並且我已經設置了在 Boto 中可以正常工作的 AWS_* 變數。

我錯過了什麼嗎?我該怎麼辦?

我不知道為什麼原始命令不起作用,但最後我發現將 URL 格式從更改s3://s3-us-east-1.amazonaws.com/bucketnames3+http://bucketname解決問題。

減少的工作命令現在是:

duplicity full ./logs "s3+http://bucketname" -v9

如果您仍然無法使用它,請嘗試將:添加 export S3_USE_SIGV4="True" 到您的重複配置文件 conf 文件中。

這在這裡詳細描述並為我工作。

引用自:https://serverfault.com/questions/704442