Skip to content

Bicep CLI 0.23.1 does not work on Apple Silicon (ERROR: [Errno 86] Bad CPU type in executable) #27758

Description

@tjementum

Describe the bug

I just ran az bicep upgrade and now I get this error:
Debug: output = ERROR: [Errno 86] Bad CPU type in executable: '/Users/myuser/.azure/bin/bicep'

I'm pretty sure I've done this before without problems.

I tried to run:
az bicep upgrade --target-platform osx-arm64

But this also fails.

Then I tried:
az bicep install --target-platform osx-arm64

No error, but I still get:
Debug: output = ERROR: [Errno 86] Bad CPU type in executable: '/Users/myuser/.azure/bin/bicep'

Finally tried to reinstall the Azure CLI:
brew uninstall azure-cli
brew install azure-cli

But the problem persists. I'm not able to find a way to roll back to the previous version.

Related command

Errors

Here is the error:

az bicep upgrade --target-platform osx-arm64

The command failed with an unexpected error. Here is the traceback:
[Errno 86] Bad CPU type in executable: '/Users/myuser/.azure/bin/bicep'
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/azure-cli/2.53.0/libexec/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/homebrew/Cellar/azure-cli/2.53.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
    raise ex
  File "/opt/homebrew/Cellar/azure-cli/2.53.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/opt/homebrew/Cellar/azure-cli/2.53.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
    result = cmd_copy(params)
  File "/opt/homebrew/Cellar/azure-cli/2.53.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__
    return self.handler(*args, **kwargs)
  File "/opt/homebrew/Cellar/azure-cli/2.53.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/opt/homebrew/Cellar/azure-cli/2.53.0/libexec/lib/python3.10/site-packages/azure/cli/command_modules/resource/custom.py", line 4292, in upgrade_bicep_cli
    ensure_bicep_installation(cmd.cli_ctx, release_tag=latest_release_tag, target_platform=target_platform)
  File "/opt/homebrew/Cellar/azure-cli/2.53.0/libexec/lib/python3.10/site-packages/azure/cli/command_modules/resource/_bicep.py", line 118, in ensure_bicep_installation
    installed_version = _get_bicep_installed_version(installation_path)
  File "/opt/homebrew/Cellar/azure-cli/2.53.0/libexec/lib/python3.10/site-packages/azure/cli/command_modules/resource/_bicep.py", line 267, in _get_bicep_installed_version
    installed_version_output = _run_command(bicep_executable_path, ["--version"])
  File "/opt/homebrew/Cellar/azure-cli/2.53.0/libexec/lib/python3.10/site-packages/azure/cli/command_modules/resource/_bicep.py", line 305, in _run_command
    process = subprocess.run([rf"{bicep_installation_path}"] + args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  File "/opt/homebrew/Cellar/python@3.10/3.10.13/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 503, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/opt/homebrew/Cellar/python@3.10/3.10.13/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 971, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/opt/homebrew/Cellar/python@3.10/3.10.13/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 1863, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 86] Bad CPU type in executable: '/Users/myuser/.azure/bin/bicep'
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues

Issue script & Debug output

az bicep version

The command failed with an unexpected error. Here is the traceback:
[Errno 86] Bad CPU type in executable: '/Users/myuser/.azure/bin/bicep'
Traceback (most recent call last):
...

Expected behavior

I expect that I can run az bicep upgrade and get the latest version. I expect that I don't need to add the platform (or that the warning that a new version is available has the correct upgrade command).

Environment Summary

az --version
azure-cli                         2.53.1

core                              2.53.1
telemetry                          1.1.0

Dependencies:
msal                            1.24.0b2
azure-mgmt-resource             23.1.0b2

Python location '/opt/homebrew/Cellar/azure-cli/2.53.1/libexec/bin/python'
Extensions directory '/Users/myuser/.azure/cliextensions'

Python (Darwin) 3.10.13 (main, Aug 24 2023, 12:59:26) [Clang 15.0.0 (clang-1500.0.40.1)]

Your CLI is up-to-date.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    ARMaz resource/group/lock/tag/deployment/policy/managementapp/account management-groupAuto-AssignAuto assign by botAuto-ResolveAuto resolve by botPossible-SolutionService AttentionThis issue is responsible by Azure service team.Similar-Issueact-identity-squadbugThis 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.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions