Package Details: azure-cli 2.42.0-1

Git Clone URL: https://aur.archlinux.org/azure-cli.git (read-only, click to copy)
Package Base: azure-cli
Description: Command-line tools for Azure.
Upstream URL: https://github.com/Azure/azure-cli
Licenses: MIT
Conflicts: python-azure-cli
Submitter: pallxk
Maintainer: pallxk
Last Packager: pallxk
Votes: 36
Popularity: 1.46
First Submitted: 2019-12-30 09:10 (UTC)
Last Updated: 2022-11-01 06:59 (UTC)

Latest Comments

1 2 3 Next › Last »

boogibugs commented on 2022-08-22 15:09 (UTC) (edited on 2022-08-22 15:53 (UTC) by boogibugs)

I am seeing this error when trying to upgrade from 2.37 to 2.39

I have now removed my working 2.37 and cannot install 2.39 at all.

Any ideas what is causing this? I have done some searching and my python knowledge is limited, it might have something to do with the setup dirs somehow for the virtualenv maybe?

-- Extracting '/tmp/tmprknr3vfp/virtualenv-16.7.11.tar.gz' to '/tmp/tmprknr3vfp'.
-- Executing: ['/usr/bin/python', 'virtualenv.py', '--python', '/usr/bin/python', '/home/username/.cache/paru/clone/azure-cli/src/azure-cli']
Already using interpreter /usr/bin/python
Using base prefix '/usr'
New python executable in /home/username/.cache/paru/clone/azure-cli/src/azure-cli/bin/python
Traceback (most recent call last):
  File "/tmp/tmprknr3vfp/virtualenv-16.7.11/virtualenv.py", line 2644, in <module>
    main()
  File "/tmp/tmprknr3vfp/virtualenv-16.7.11/virtualenv.py", line 859, in main
    create_environment(
  File "/tmp/tmprknr3vfp/virtualenv-16.7.11/virtualenv.py", line 1174, in create_environment
    install_distutils(home_dir)
  File "/tmp/tmprknr3vfp/virtualenv-16.7.11/virtualenv.py", line 1795, in install_distutils
    distutils_path = change_prefix(distutils.__path__[0], home_dir)
  File "/tmp/tmprknr3vfp/virtualenv-16.7.11/virtualenv.py", line 1282, in change_prefix
    raise AssertionError("Filename {} does not start with any of these prefixes: {}".format(filename, prefixes))
AssertionError: Filename /home/username/.local/lib/python3.10/site-packages/setuptools/_distutils does not start with any of these prefixes: ['/usr', '/usr']
Traceback (most recent call last):
  File "/home/username/.cache/paru/clone/azure-cli/src/install-2.39.0.py", line 415, in <module>
    main()
  File "/home/username/.cache/paru/clone/azure-cli/src/install-2.39.0.py", line 399, in main
    create_virtualenv(tmp_dir, install_dir)
  File "/home/username/.cache/paru/clone/azure-cli/src/install-2.39.0.py", line 144, in create_virtualenv
    exec_command(cmd, cwd=working_dir)
  File "/home/username/.cache/paru/clone/azure-cli/src/install-2.39.0.py", line 105, in exec_command
    subprocess.check_call(command_list, cwd=cwd, env=env)
  File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/bin/python', 'virtualenv.py', '--python', '/usr/bin/python', '/home/username/.cache/paru/clone/azure-cli/src/azure-cli']' returned non-zero exit status 1.
==> ERROR: A failure occurred in prepare().
    Aborting...
error: failed to build 'azure-cli-2.39.0-1':
error: packages failed to build: azure-cli-2.39.0-1

Luviz commented on 2022-05-23 17:10 (UTC)

Ok I was able to fix my issue by running the installation in python virtual environment, I don't know if that will case some issue or work fine. However I ran some tests and it looks good so far.

Luviz commented on 2022-05-13 08:51 (UTC)

I'm getting an error very similar to the rapporter error from @patrakov on the 13 of December, however the error below is different:

AssertionError: Filename /home/bardia/.local/lib/python3.10/site-packages/setuptools/_distutils does not start with any of these prefixes: ['/usr', '/usr']

=== Error log ===

===> In what directory would you like to place the install? (leave blank to use '/home/bardia/lib/azure-cli'): -- Creating directory '/home/bardia/.cache/paru/clone/azure-cli/src/azure-cli'.
-- We will install at '/home/bardia/.cache/paru/clone/azure-cli/src/azure-cli'.

===> In what directory would you like to place the 'az' executable? (leave blank to use '/home/bardia/bin'): -- Creating directory '/home/bardia/.cache/paru/clone/azure-cli/src/bin'.
-- The executable will be in '/home/bardia/.cache/paru/clone/azure-cli/src/bin'.
-- Downloading virtualenv package from https://pypi.python.org/packages/source/v/virtualenv/virtualenv-16.7.11.tar.gz.
-- Downloaded virtualenv package to /tmp/tmpm1b72vf5/virtualenv-16.7.11.tar.gz.
-- Checksum of /tmp/tmpm1b72vf5/virtualenv-16.7.11.tar.gz OK.
-- Extracting '/tmp/tmpm1b72vf5/virtualenv-16.7.11.tar.gz' to '/tmp/tmpm1b72vf5'.
-- Executing: ['/usr/bin/python', 'virtualenv.py', '--python', '/usr/bin/python', '/home/bardia/.cache/paru/clone/azure-cli/src/azure-cli']
Already using interpreter /usr/bin/python
Using base prefix '/usr'
New python executable in /home/bardia/.cache/paru/clone/azure-cli/src/azure-cli/bin/python
Traceback (most recent call last):
  File "/tmp/tmpm1b72vf5/virtualenv-16.7.11/virtualenv.py", line 2644, in <module>
    main()
  File "/tmp/tmpm1b72vf5/virtualenv-16.7.11/virtualenv.py", line 859, in main
    create_environment(
  File "/tmp/tmpm1b72vf5/virtualenv-16.7.11/virtualenv.py", line 1174, in create_environment
    install_distutils(home_dir)
  File "/tmp/tmpm1b72vf5/virtualenv-16.7.11/virtualenv.py", line 1795, in install_distutils
    distutils_path = change_prefix(distutils.__path__[0], home_dir)
  File "/tmp/tmpm1b72vf5/virtualenv-16.7.11/virtualenv.py", line 1282, in change_prefix
    raise AssertionError("Filename {} does not start with any of these prefixes: {}".format(filename, prefixes))
AssertionError: Filename /home/bardia/.local/lib/python3.10/site-packages/setuptools/_distutils does not start with any of these prefixes: ['/usr', '/usr']
Traceback (most recent call last):
  File "/home/bardia/.cache/paru/clone/azure-cli/src/install-2.36.0.py", line 415, in <module>
    main()
  File "/home/bardia/.cache/paru/clone/azure-cli/src/install-2.36.0.py", line 399, in main
    create_virtualenv(tmp_dir, install_dir)
  File "/home/bardia/.cache/paru/clone/azure-cli/src/install-2.36.0.py", line 144, in create_virtualenv
    exec_command(cmd, cwd=working_dir)
  File "/home/bardia/.cache/paru/clone/azure-cli/src/install-2.36.0.py", line 105, in exec_command
    subprocess.check_call(command_list, cwd=cwd, env=env)
  File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/bin/python', 'virtualenv.py', '--python', '/usr/bin/python', '/home/bardia/.cache/paru/clone/azure-cli/src/azure-cli']' returned non-zero exit status 1.

Fig commented on 2021-12-29 01:31 (UTC)

I'm getting this error now when I try to run any az command, including az login. Has anyone else run into this?

The command failed with an unexpected error. Here is the traceback:
Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
  File "/opt/azure-cli/lib/python3.10/site-packages/knack/cli.py", line 231, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/azure-cli/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 658, in execute
    raise ex
  File "/opt/azure-cli/lib/python3.10/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/azure-cli/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 692, in _run_job
    result = cmd_copy(params)
  File "/opt/azure-cli/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 328, in __call__
    return self.handler(*args, **kwargs)
  File "/opt/azure-cli/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/opt/azure-cli/lib/python3.10/site-packages/azure/cli/command_modules/profile/custom.py", line 149, in login
    subscriptions = profile.login(
  File "/opt/azure-cli/lib/python3.10/site-packages/azure/cli/core/_profile.py", line 155, in login
    user_identity = identity.login_with_auth_code(scopes=scopes, **kwargs)
  File "/opt/azure-cli/lib/python3.10/site-packages/azure/cli/core/auth/identity.py", line 147, in login_with_auth_code
    result = self._msal_app.acquire_token_interactive(
  File "/opt/azure-cli/lib/python3.10/site-packages/msal/application.py", line 1546, in acquire_token_interactive
    response = _clean_up(self.client.obtain_token_by_browser(
  File "/opt/azure-cli/lib/python3.10/site-packages/msal/oauth2cli/oidc.py", line 280, in obtain_token_by_browser
    return super(Client, self).obtain_token_by_browser(
  File "/opt/azure-cli/lib/python3.10/site-packages/msal/oauth2cli/oauth2.py", line 640, in obtain_token_by_browser
    return self._obtain_token_by_browser(
  File "/opt/azure-cli/lib/python3.10/site-packages/msal/oauth2cli/oauth2.py", line 678, in _obtain_token_by_browser
    return self.obtain_token_by_auth_code_flow(
  File "/opt/azure-cli/lib/python3.10/site-packages/msal/application.py", line 135, in obtain_token_by_auth_code_flow
    return super(_ClientWithCcsRoutingInfo, self).obtain_token_by_auth_code_flow(
  File "/opt/azure-cli/lib/python3.10/site-packages/msal/oauth2cli/oidc.py", line 204, in obtain_token_by_auth_code_flow
    result = super(Client, self).obtain_token_by_auth_code_flow(
  File "/opt/azure-cli/lib/python3.10/site-packages/msal/oauth2cli/oauth2.py", line 548, in obtain_token_by_auth_code_flow
    return self._obtain_token_by_authorization_code(
  File "/opt/azure-cli/lib/python3.10/site-packages/msal/oauth2cli/oauth2.py", line 732, in _obtain_token_by_authorization_code
    return self._obtain_token("authorization_code", data=data, **kwargs)
  File "/opt/azure-cli/lib/python3.10/site-packages/msal/oauth2cli/oidc.py", line 115, in _obtain_token
    ret = super(Client, self)._obtain_token(grant_type, *args, **kwargs)
  File "/opt/azure-cli/lib/python3.10/site-packages/msal/oauth2cli/oauth2.py", line 789, in _obtain_token
    (on_obtaining_tokens or self.on_obtaining_tokens)({
  File "/opt/azure-cli/lib/python3.10/site-packages/msal/application.py", line 581, in <lambda>
    on_obtaining_tokens=lambda event: self.token_cache.add(dict(
  File "/opt/azure-cli/lib/python3.10/site-packages/msal/token_cache.py", line 307, in add
    super(SerializableTokenCache, self).add(event, **kwargs)
  File "/opt/azure-cli/lib/python3.10/site-packages/msal/token_cache.py", line 113, in add
    return self.__add(event, now=now)
  File "/opt/azure-cli/lib/python3.10/site-packages/msal/token_cache.py", line 184, in __add
    self.modify(self.CredentialType.ACCESS_TOKEN, at, at)
  File "/opt/azure-cli/lib/python3.10/site-packages/msal_extensions/token_cache.py", line 67, in modify
    self._reload_if_necessary()
  File "/opt/azure-cli/lib/python3.10/site-packages/msal_extensions/token_cache.py", line 58, in _reload_if_necessary
    self.deserialize(self._persistence.load())
  File "/opt/azure-cli/lib/python3.10/site-packages/msal/token_cache.py", line 319, in deserialize
    self._cache = json.loads(state) if state else {}
  File "/usr/lib64/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/lib64/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib64/python3.10/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

pallxk commented on 2021-12-14 00:55 (UTC) (edited on 2021-12-14 00:56 (UTC) by pallxk)

@gollum23, @armadillo Should work out of the box now.

@kefran Thanks for the fix!

kefran commented on 2021-12-13 18:11 (UTC)

remove "-$pkgver" in the pkgbuild in this line grep -v -E '^===>|^$' install.response | python "$srcdir/install-$pkgver.py" should work for now

gollum23 commented on 2021-12-13 17:16 (UTC)

I got this error when I try to update de package

==> Making package: azure-cli 2.31.0-2 (lun 13 dic 2021 12:14:48)
==> Retrieving sources...
  -> Found install.py
  -> Found install.response
  -> Found az
==> Validating source files with sha256sums...
    install.py ... Passed
    install.response ... Passed
    az ... Passed
==> Making package: azure-cli 2.31.0-2 (lun 13 dic 2021 12:14:49)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found install.py
  -> Found install.response
  -> Found az
==> Validating source files with sha256sums...
    install.py ... Passed
    install.response ... Passed
    az ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
==> Starting prepare()...
python: can't open file '/home/gollum23/.cache/yay/azure-cli/src/install-2.31.0.py': [Errno 2] No such file or directory
==> ERROR: A failure occurred in prepare().
    Aborting...
 -> error making: azure-cli

armadillo commented on 2021-12-13 17:12 (UTC)

Thanks for making the update. However 2.31.0-2 is not currently building for me.

:: (1/1) Parsing SRCINFO: azure-cli
==> Making package: azure-cli 2.31.0-2 (Mon 13 Dec 2021 17:08:44 GMT)
==> Retrieving sources...
  -> Found install.py
  -> Found install.response
  -> Found az
==> Validating source files with sha256sums...
    install.py ... Passed
    install.response ... Passed
    az ... Passed
==> Making package: azure-cli 2.31.0-2 (Mon 13 Dec 2021 17:08:45 GMT)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found install.py
  -> Found install.response
  -> Found az
==> Validating source files with sha256sums...
    install.py ... Passed
    install.response ... Passed
    az ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
==> Starting prepare()...
python: can't open file '/home/username/.cache/yay/azure-cli/src/install-2.31.0.py': [Errno 2] No such file or directory
==> ERROR: A failure occurred in prepare().
    Aborting...
 -> error making: azure-cli

pallxk commented on 2021-12-13 16:48 (UTC)

@patrakov Thanks for reporting! I've just raised an issue upstream https://github.com/Azure/azure-cli/issues/20713, and proposed a fix upstream https://github.com/Azure/azure-cli/pull/20714. For now, I've patched the install.py within AUR, and it should work with python 3.10.

patrakov commented on 2021-12-13 09:30 (UTC) (edited on 2021-12-13 09:30 (UTC) by patrakov)

Python switched to 3.10 today and azure-cli no longer builds:

-- Executing: ['/usr/bin/python', 'virtualenv.py', '--python', '/usr/bin/python', '/home/aep/.cache/pikaur/build/azure-cli/src/azure-cli']
/tmp/tmp7iis0rg4/virtualenv-16.7.7/virtualenv.py:24: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  import distutils.spawn
/tmp/tmp7iis0rg4/virtualenv-16.7.7/virtualenv.py:25: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
  import distutils.sysconfig
Already using interpreter /usr/bin/python
Using base prefix '/usr'
New python executable in /home/aep/.cache/pikaur/build/azure-cli/src/azure-cli/bin/python
Traceback (most recent call last):
  File "/tmp/tmp7iis0rg4/virtualenv-16.7.7/virtualenv.py", line 2628, in <module>
    main()
  File "/tmp/tmp7iis0rg4/virtualenv-16.7.7/virtualenv.py", line 860, in main
    create_environment(
  File "/tmp/tmp7iis0rg4/virtualenv-16.7.7/virtualenv.py", line 1156, in create_environment
    install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages=site_packages, clear=clear, symlink=symlink)
  File "/tmp/tmp7iis0rg4/virtualenv-16.7.7/virtualenv.py", line 1715, in install_python
    fix_local_scheme(home_dir, symlink)
  File "/tmp/tmp7iis0rg4/virtualenv-16.7.7/virtualenv.py", line 1801, in fix_local_scheme
    if sysconfig._get_default_scheme() == "posix_local":
AttributeError: module 'sysconfig' has no attribute '_get_default_scheme'. Did you mean: 'get_default_scheme'?
Traceback (most recent call last):
  File "/home/aep/.cache/pikaur/build/azure-cli/src/install-2.31.0.py", line 415, in <module>
    main()
  File "/home/aep/.cache/pikaur/build/azure-cli/src/install-2.31.0.py", line 399, in main
    create_virtualenv(tmp_dir, install_dir)
  File "/home/aep/.cache/pikaur/build/azure-cli/src/install-2.31.0.py", line 144, in create_virtualenv
    exec_command(cmd, cwd=working_dir)
  File "/home/aep/.cache/pikaur/build/azure-cli/src/install-2.31.0.py", line 105, in exec_command
    subprocess.check_call(command_list, cwd=cwd, env=env)
  File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/bin/python', 'virtualenv.py', '--python', '/usr/bin/python', '/home/aep/.cache/pikaur/build/azure-cli/src/azure-cli']' returned non-zero exit status 1.