Azure上的wal-e备份推送错误

时间:2017-06-14 21:45:25

标签: azure-storage-blobs wal-e

执行backup-push命令时出现以下错误:

# envdir /etc/wal-e.d/env wal-e backup-push /var/lib/postgresql/9.5/main

 wal_e.main   INFO     MSG: starting WAL-E
    DETAIL: The subcommand is "backup-push".
    STRUCTURED: time=2017-06-14T21:33:56.131389-00 pid=17559
 wal_e.main   CRITICAL MSG: An unprocessed exception has avoided all error handling
    DETAIL: Traceback (most recent call last):
      File "/usr/local/lib/python3.5/dist-packages/wal_e/blobstore/wabs/wabs_util.py", line 27, in <module>
        from azure.storage.blob import BlobService
    ImportError: cannot import name 'BlobService'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/usr/local/lib/python3.5/dist-packages/wal_e/cmd.py", line 589, in main
        backup_cxt = configure_backup_cxt(args)
      File "/usr/local/lib/python3.5/dist-packages/wal_e/cmd.py", line 504, in configure_backup_cxt
        from wal_e.blobstore import wabs
      File "/usr/local/lib/python3.5/dist-packages/wal_e/blobstore/wabs/__init__.py", line 11, in <module>
        from wal_e.blobstore.wabs.wabs_util import do_lzop_get
      File "/usr/local/lib/python3.5/dist-packages/wal_e/blobstore/wabs/wabs_util.py", line 29, in <module>
        from azure.storage import BlobService
    ImportError: cannot import name 'BlobService'

    STRUCTURED: time=2017-06-14T21:33:56.356868-00 pid=17559

我已经尝试过更新的Python和Azure

wal-e版本:1.0.3 SO:Ubuntu Server 16.4.1 LTS

有什么想法吗?

1 个答案:

答案 0 :(得分:1)

我尝试成功重现您的问题,并且我查看了wal-e版本1.0.3的源代码,然后我发现问题是由wal-e版本{{1}引起的实际上要求1.0.3版本低于azure-storage,但在通过0.20.3安装时安装了最新的azure-storage版本0.34.3。请通过pip3 install wal-e[azure]检查您当前的azure-storage版本。

因此,有两种解决方案可以解决问题,如下所示。

  1. 通过pip3 freeze | grep azure-storageazure-storage版本降级为0.20.3
  2. 或者只需将pip3 install azure-storage==0.20.3版本升级到需要最新wal-e版本的1.1.0b1版本,并通过azure-storage与旧版本兼容。
  3. 希望它有所帮助。