Repository navigation
az postgres flexible-server connect failing #22889
Copy link
Copy link
Closed
Labels
Auto-AssignAuto assign by botAuto assign by botPostgreSQLService AttentionThis issue is responsible by Azure service team.This issue is responsible by Azure service team.bugThis issue requires a change to an existing behavior in the product in order to be resolved.This issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.needs-team-attentionThis issue needs attention from Azure service team or SDK teamThis issue needs attention from Azure service team or SDK team
Description
This is autogenerated. Please review and update as needed.
Describe the bug
Command Name
az postgres flexible-server connect
Errors:
The command failed with an unexpected error. Here is the traceback:
No module named 'psycopg2._psycopg'
Traceback (most recent call last):
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 231, in invoke
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 561, in execute
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/__init__.py", line 515, in load_arguments
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 318, in load_arguments
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/commands.py", line 104, in load_arguments
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 125, in arguments_loader
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 59, in get_op_handler
File "importlib\__init__.py", line 126, in import_module
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "C:\Users\M66445\.azure\cliextensions\rdbms-connect\azext_rdbms_connect\custom.py", line 10, in <module>
import psycopg2
File "C:\Users\M66445\.azure\cliextensions\rdbms-connect\psycopg2\__init__.py", line 51, in <module>
from psycopg2._psycopg import ( # noqa
ModuleNotFoundError: No module named 'psycopg2._psycopg'
To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.
- Put any pre-requisite steps here...
az postgres flexible-server connect -n {} -u {} -d {} --interactive
Expected Behavior
Environment Summary
Windows-10-10.0.19043-SP0
Python 3.10.4
Installer: MSI
azure-cli 2.37.0
Extensions:
rdbms-connect 1.0.2
Dependencies:
msal 1.18.0b1
azure-mgmt-resource 21.1.0b1
Additional Context
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Auto-AssignAuto assign by botAuto assign by botPostgreSQLService AttentionThis issue is responsible by Azure service team.This issue is responsible by Azure service team.bugThis issue requires a change to an existing behavior in the product in order to be resolved.This issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.needs-team-attentionThis issue needs attention from Azure service team or SDK teamThis issue needs attention from Azure service team or SDK team
Activity
yonzhan commentedon Jun 15, 2022
route to CXP team
navba-MSFT commentedon Jun 20, 2022
@azeem2020 Apologies for the late reply. Thanks for reaching out to us and sharing this feedback. We are looking into this issue and we will provide an update.
navba-MSFT commentedon Jun 20, 2022
@azeem2020 Could you please delete the
rdbms-connectfolder n the ~/.azure/cliextensions/ location and install the most recent version of this extension using the below command ?Post this, you can try to run the AzCli command
az postgres flexible-server connectagain and check if you see the issue. Awaiting your reply.muhd-azeem commentedon Jun 20, 2022
navba-MSFT (@navba-MSFT) Still getting the similar error. Can you please suggest the other workaround?
navba-MSFT commentedon Jun 21, 2022
@azeem2020 Thanks for reopenning the issue and reaching out to us. Could you try running the below command and check if that helps ?
navba-MSFT commentedon Jun 23, 2022
@azeem2020 A quick follow-up to check if you have tried the above action plan. Please let me know if you have any update on this.
muhd-azeem commentedon Jun 24, 2022
Apology for late response as I was unavailable. Please see below error for
pip install psycopg-c8 remaining items
muhd-azeem commentedon Jul 4, 2022
I cannot find anything for
pg_configin my local directory to update PATH variable for system or User. The only folder structure for PostgreSQL we have is pgAdmin and Python as shown below and this path already updated.navba-MSFT commentedon Jul 5, 2022
@azeem2020 Thanks for getting back. I am adding Service team to look into this issue.
sunilagarwal, @lfittl-msft, Sridhar Ranganathan (@sr-msft), Nik Larin (@niklarin) Could you please look into this and provide some pointers when you get a chance ? Awaiting your reply.
sr-msft commentedon Jul 5, 2022
navba-MSFT commentedon Jul 5, 2022
Daeun Yim (@DaeunYim) for visibility
sr-msft commentedon Jul 5, 2022
alanenriqueo commentedon Aug 2, 2022
Hi @azeem2020, the MSI installer of azure-cli requires 32-bit version of libpq.dll available in PATH; that's because the MSI installer comes with its own version of 32-bit python. Can we try that?
nachoalonsoportillo commentedon Jun 10, 2024
Yong Zhang (@yonzhan) Can we please close this one. It should have been resolved with Alan's suggestion.
PingvinB commentedon Oct 7, 2025
Does "az postgresl flexible-server" have a dependency on a local installation of pgadmin/pgsql? Where am I supposed to get "libpq.dll" from?