S3 duplicity 备份有效,但恢复时出现错误

S3 duplicity 备份有效,但恢复时出现错误

在 Ubuntu 22.04 上使用 Duplicity 0.8.21,我可以备份到 S3 OK,但是当我尝试恢复时,我得到:

Traceback (innermost last):
  File "/usr/bin/duplicity", line 92, in <module>
    with_tempdir(main)
  File "/usr/bin/duplicity", line 75, in with_tempdir
    fn()
  File "/usr/lib/python3/dist-packages/duplicity/dup_main.py", line 1555, in main
    action = commandline.ProcessCommandLine(sys.argv[1:])
  File "/usr/lib/python3/dist-packages/duplicity/commandline.py", line 1236, in ProcessCommandLine
    backup, local_pathname = set_backend(args[0], args[1])
  File "/usr/lib/python3/dist-packages/duplicity/commandline.py", line 1107, in set_backend
    config.backend = backend.get_backend(bend)
  File "/usr/lib/python3/dist-packages/duplicity/backend.py", line 223, in get_backend
    obj = get_backend_object(url_string)
  File "/usr/lib/python3/dist-packages/duplicity/backend.py", line 209, in get_backend_object
    return factory(pu)
  File "/usr/lib/python3/dist-packages/duplicity/backends/_boto_single.py", line 174, in __init__
    self.resetConnection()
  File "/usr/lib/python3/dist-packages/duplicity/backends/_boto_single.py", line 199, in resetConnection
    self.bucket = self.conn.create_bucket(self.bucket_name,
  File "/usr/lib/python3/dist-packages/boto/s3/connection.py", line 618, in create_bucket
    response = self.make_request('PUT', bucket_name, headers=headers,
  File "/usr/lib/python3/dist-packages/boto/s3/connection.py", line 667, in make_request
    return super(S3Connection, self).make_request(
  File "/usr/lib/python3/dist-packages/boto/connection.py", line 1070, in make_request
    return self._mexe(http_request, sender, override_num_retries,
  File "/usr/lib/python3/dist-packages/boto/connection.py", line 912, in _mexe
    connection = self.get_http_connection(request.host, request.port,
  File "/usr/lib/python3/dist-packages/boto/connection.py", line 705, in get_http_connection
    return self.new_http_connection(host, port, is_secure)
  File "/usr/lib/python3/dist-packages/boto/connection.py", line 747, in new_http_connection
    connection = self.proxy_ssl(host, is_secure and 443 or 80)
  File "/usr/lib/python3/dist-packages/boto/connection.py", line 796, in proxy_ssl
    sock.sendall("CONNECT %s HTTP/1.0\r\n" % host)
 TypeError: a bytes-like object is required, not 'str'

我认为这可能是代理问题,因为我认为这些错误是相关的:

ERROR     Nov 16 15:42:27.589 [943713]: read_request_line: Client (file descriptor: 8) closed socket before read.
ERROR     Nov 16 15:42:27.591 [943713]: Error reading readable client_fd 8

所以我把它(和出站防火墙)撤掉了,但是现在得到:

Traceback (innermost last):
  File "/usr/bin/duplicity", line 92, in <module>
    with_tempdir(main)
  File "/usr/bin/duplicity", line 75, in with_tempdir
    fn()
  File "/usr/lib/python3/dist-packages/duplicity/dup_main.py", line 1555, in main
    action = commandline.ProcessCommandLine(sys.argv[1:])
  File "/usr/lib/python3/dist-packages/duplicity/commandline.py", line 1236, in ProcessCommandLine
    backup, local_pathname = set_backend(args[0], args[1])
  File "/usr/lib/python3/dist-packages/duplicity/commandline.py", line 1107, in set_backend
    config.backend = backend.get_backend(bend)
  File "/usr/lib/python3/dist-packages/duplicity/backend.py", line 223, in get_backend
    obj = get_backend_object(url_string)
  File "/usr/lib/python3/dist-packages/duplicity/backend.py", line 209, in get_backend_object
    return factory(pu)
  File "/usr/lib/python3/dist-packages/duplicity/backends/_boto_single.py", line 174, in __init__
    self.resetConnection()
  File "/usr/lib/python3/dist-packages/duplicity/backends/_boto_single.py", line 199, in resetConnection
    self.bucket = self.conn.create_bucket(self.bucket_name,
  File "/usr/lib/python3/dist-packages/boto/s3/connection.py", line 618, in create_bucket
    response = self.make_request('PUT', bucket_name, headers=headers,
  File "/usr/lib/python3/dist-packages/boto/s3/connection.py", line 667, in make_request
    return super(S3Connection, self).make_request(
  File "/usr/lib/python3/dist-packages/boto/connection.py", line 1070, in make_request
    return self._mexe(http_request, sender, override_num_retries,
  File "/usr/lib/python3/dist-packages/boto/connection.py", line 912, in _mexe
    connection = self.get_http_connection(request.host, request.port,
  File "/usr/lib/python3/dist-packages/boto/connection.py", line 705, in get_http_connection
    return self.new_http_connection(host, port, is_secure)
  File "/usr/lib/python3/dist-packages/boto/connection.py", line 747, in new_http_connection
    connection = self.proxy_ssl(host, is_secure and 443 or 80)
  File "/usr/lib/python3/dist-packages/boto/connection.py", line 791, in proxy_ssl
    sock = socket.create_connection((self.proxy,
  File "/usr/lib/python3.10/socket.py", line 845, in create_connection
    raise err
  File "/usr/lib/python3.10/socket.py", line 833, in create_connection
    sock.connect(sa)
 ConnectionRefusedError: [Errno 111] Connection refused

当我尝试使用运行完全相同设置的虚拟机进行恢复时,一切正常。有人知道发生了什么吗?这些看起来像是与网络相关的错误。我是否缺少某些模块或什么?

相关内容