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

wal-e backup-push error on Azure

我在执行备份推送命令时遇到以下错误:

# 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

电子钱包版本:1.0.3 所以:Ubuntu 服务器 16.4.1 LTS

有什么想法吗?

我尝试重现了你的问题,查看了wal-e版本1.0.3的源代码,发现问题是由wal-e版本[=]引起的11=] 实际上需要 azure-storage 版本低于 0.20.3,但是当您通过 pip3 install wal-e[azure] 安装时安装了最新的 azure-storage 版本 0.34.3。请通过 pip3 freeze | grep azure-storage.

检查您当前的 azure-storage 版本

所以有两种方法可以解决这个问题,如下所示。

  1. 通过 pip3 install azure-storage==0.20.3.
  2. azure-storage 版本降级到 0.20.3
  3. 或者只需将 wal-e 版本升级到 1.1.0b1,这需要最新的 azure-storage 版本并通过 pip3 install wal-e==1.1.0b1.[=37= 与旧版本兼容]

希望对您有所帮助。