azure-cli: Unable to add az extension rdbms-connect in cloud shell

This is autogenerated. Please review and update as needed.

Describe the bug

I am unable to add az extension rdbms-connect from the cloud shell.

Command Name az extension add

Errors:

The command failed with an unexpected error. Here is the traceback:
[Errno 2] No such file or directory: 'sudo'
Traceback (most recent call last):
  File "/opt/az/lib/python3.8/site-packages/knack/cli.py", line 231, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/az/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 658, in execute
    raise ex
  File "/opt/az/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 721, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/opt/az/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 692, in _run_job
    result = cmd_copy(params)
  File "/opt/az/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 328, in __call__
    return self.handler(*args, **kwargs)
  File "/opt/az/lib/python3.8/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/opt/az/lib/python3.8/site-packages/azure/cli/command_modules/extension/custom.py", line 16, in add_extension_cmd
    return add_extension(cli_ctx=cmd.cli_ctx, source=source, extension_name=extension_name, index_url=index_url,
  File "/opt/az/lib/python3.8/site-packages/azure/cli/core/extension/operations.py", line 336, in add_extension
    extension_name = _add_whl_ext(cli_ctx=cmd_cli_ctx, source=source, ext_sha256=ext_sha256,
  File "/opt/az/lib/python3.8/site-packages/azure/cli/core/extension/operations.py", line 115, in _add_whl_ext
    _install_deps_for_psycopg2()
  File "/opt/az/lib/python3.8/site-packages/azure/cli/core/extension/operations.py", line 224, in _install_deps_for_psycopg2
    exit_code = subprocess.call(apt_update_cmd, True)
  File "/opt/az/lib/python3.8/subprocess.py", line 340, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/opt/az/lib/python3.8/subprocess.py", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/opt/az/lib/python3.8/subprocess.py", line 1704, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'sudo'

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 extension add -n rdbms-connect

Expected Behavior

Extension install without failures.

Environment Summary

Linux-5.4.0-1070-azure-x86_64-with-glibc2.28 (Cloud Shell), Common Base Linux Delridge (quinault)
Python 3.8.12
Installer: DEB

azure-cli 2.34.0 *

Extensions:
ai-examples 0.2.5
ssh 1.0.0

Dependencies:
msal 1.16.0
azure-mgmt-resource 20.0.0

Additional Context

I ran into this problem while attempting to automate the DB deployment for a azure postgres flexible server using the command: az postgres flexible-server execute <args>

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 3
  • Comments: 18 (6 by maintainers)

Most upvoted comments

The issue is still present on Windows. image

Has this been resolved? Still very much struggling to retrieve the required extension to connect