执行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
有什么想法吗?
答案 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
版本。
因此,有两种解决方案可以解决问题,如下所示。
pip3 freeze | grep azure-storage
将azure-storage
版本降级为0.20.3
。pip3 install azure-storage==0.20.3
版本升级到需要最新wal-e
版本的1.1.0b1
版本,并通过azure-storage
与旧版本兼容。希望它有所帮助。