>我在执行备份推送命令时收到以下错误:
# 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
瓦尔-e版本:1.0.3SO: Ubuntu Server 16.4.1 LTS
知道吗?
我尝试成功重现您的问题,并查看了wal-e
版本的源代码1.0.3
,然后我发现问题是由wal-e
版本引起的1.0.3
实际上需要不到0.20.3
azure-storage
版本,但是在通过pip3 install wal-e[azure]
安装时0.34.3
安装了最新的azure-storage
版本。请通过pip3 freeze | grep azure-storage
检查您当前的azure-storage
版本。
因此,有两种解决方案可以解决此问题,如下所示。
- 通过
pip3 install azure-storage==0.20.3
将azure-storage
版本降级为0.20.3
版本。 - 或者只是通过
pip3 install wal-e==1.1.0b1
将wal-e
版本升级到需要最新azure-storage
版本并与旧版本兼容的1.1.0b1
。
希望对您有所帮助。