You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Azure CLI创建PostgreSQL Flexible Server报AttributeError错误求助

解决AZ CLI创建PostgreSQL Flexible Server时的AttributeError问题

问题原因

该错误AttributeError: 'FlexibleServerCapability' object has no attribute 'supported_features'通常源于AZ CLI的postgres扩展版本与核心CLI版本不兼容,或是扩展本身存在bug。

解决方案

1. 更新/重装PostgreSQL扩展

先查看当前postgres扩展版本:

az extension show --name postgres

执行更新操作:

az extension update --name postgres

若更新后问题仍存在,卸载并重新安装扩展:

az extension remove --name postgres
az extension add --name postgres

2. 降级AZ CLI版本

最新版AZ CLI 2.71.0可能与postgres扩展存在兼容性问题,可尝试降级至稳定版本2.70.0:

  • 卸载当前AZ CLI:
sudo zypper remove azure-cli
  • 安装指定版本:
sudo zypper install https://packages.microsoft.com/sles/15/prod/azure-cli-2.70.0-1.sles15.x86_64.rpm

3. 临时使用Azure Portal创建

若CLI问题无法快速解决,可通过Azure Portal完成创建:

  • 登录Azure Portal,搜索并进入「Azure Database for PostgreSQL 灵活服务器」
  • 按照向导填写与CLI命令一致的配置(资源组、服务器名、区域、PostgreSQL版本、SKU等),完成服务器创建。

4. 检查本地Python环境

AZ CLI依赖Python 3.7+,确认版本符合要求且依赖无损坏:

python3 --version
az --version

若依赖异常,重新安装AZ CLI依赖:

pip3 install --upgrade azure-cli

内容的提问来源于stack exchange,提问作者Manohar Amkem

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.13 12:02:34