question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

OS architecture mismatch when installing Azure Bicep with the `az bicep install` command

See original GitHub issue

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name az bicep version

Errors:

qemu-x86_64: Could not open '/lib64/ld-linux-x86-64.so.2': No such file or directory

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • Run the az bicep install command from any ARM64-based operating system (e.g., Dev Container running locally on M1 Mac)
  • Run the az bicep version command to validate install

Expected Behavior

Environment Summary

Linux-5.15.49-linuxkit-aarch64-with-glibc2.35, Ubuntu 22.04.1 LTS
Python 3.10.6
Installer: PIP

azure-cli 2.42.0

Additional Context

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
navba-MSFTcommented, Dec 9, 2022

@pauldotyu Thanks for your reply. The above PR has been created to address the installation issue on Linux ARM64 machines. Currently it is pending under review. The PR should address the installation issue on Linux ARM64 machines. However, currently we are having issue with signing the osx-arm64 executable in official build, so it won’t run on M1 Mac (this is tracked by Cannot run bicep-osx-arm64 on macOS 12 · Issue #6195 · Azure/bicep (github.com). M1 Mac users would have to use the osx-x64 version for now. Please track the progress of the fix release for M1 Mac for ARM 64 here https://github.com/Azure/bicep/issues/6195

0reactions
pauldotyucommented, Dec 9, 2022

@navba-MSFT here is the debug log when attempting to install inside my Dev Container on my darwin-arm64 system

$ az bicep install --target-platform osx-x64 --debug
cli.knack.cli: Command arguments: ['bicep', 'install', '--target-platform', 'osx-x64', '--debug']
cli.knack.cli: __init__ debug log:
Enable color in terminal.
cli.knack.cli: Event: Cli.PreExecute []
cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0xffffb86a6c20>, <function OutputProducer.on_global_arguments at 0xffffb85a8ca0>, <function CLIQuery.on_global_arguments at 0xffffb85e1ea0>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'bicep': ['azure.cli.command_modules.resource']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name                  Load Time    Groups  Commands
cli.azure.cli.core: resource                  0.005        47       207
cli.azure.cli.core: Total (1)                 0.005        47       207
cli.azure.cli.core: Loaded 47 groups, 207 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command  : bicep install
cli.azure.cli.core: Command table: bicep install
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0xffffb77ab7f0>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/home/vscode/.azure/commands/2022-12-09.03-03-06.bicep_install.952.log'.
az_command_data_logger: command args: bicep install --target-platform {} --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument.<locals>.add_subscription_parameter at 0xffffb77d85e0>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument.<locals>.add_ids_arguments at 0xffffb78031c0>, <function register_cache_arguments.<locals>.add_cache_arguments at 0xffffb78032e0>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0xffffb85a8d30>, <function CLIQuery.handle_query_parameter at 0xffffb85e1f30>, <function register_ids_argument.<locals>.parse_ids_arguments at 0xffffb7803250>]
urllib3.connectionpool: Starting new HTTPS connection (1): aka.ms:443
urllib3.connectionpool: https://aka.ms:443 "GET /BicepLatestRelease HTTP/1.1" 301 0
urllib3.connectionpool: Starting new HTTPS connection (1): api.github.com:443
urllib3.connectionpool: https://api.github.com:443 "GET /repos/Azure/bicep/releases/latest HTTP/1.1" 200 None
Installing Bicep CLI v0.13.1...
Successfully installed Bicep CLI to "/home/vscode/.azure/bin/bicep".
cli.knack.cli: Event: CommandInvoker.OnTransformResult [<function _resource_group_transform at 0xffffb77dbc70>, <function _x509_from_base64_to_hex_transform at 0xffffb77dbd00>]
cli.knack.cli: Event: CommandInvoker.OnFilterResult []
cli.knack.cli: Event: Cli.SuccessfulExecute []
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0xffffb77aba30>]
az_command_data_logger: exit code: 0
cli.__main__: Command ran in 8.523 seconds (init: 0.061, invoke: 8.463)
telemetry.main: Begin splitting cli events and extra events, total events: 1
telemetry.client: Accumulated 0 events. Flush the clients.
telemetry.main: Finish splitting cli events and extra events, cli events: 1
telemetry.save: Save telemetry record of length 3094 in cache
telemetry.check: Negative: The /home/vscode/.azure/telemetry.txt was modified at 2022-12-09 03:01:17.828872, which in less than 600.000000 s

Here is the error I get when attempting to run az bicep version post install

$ az bicep version
The command failed with an unexpected error. Here is the traceback:
[Errno 8] Exec format error: '/home/vscode/.azure/bin/bicep'
Traceback (most recent call last):
  File "/usr/local/pipx/venvs/azure-cli/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
  File "/usr/local/pipx/venvs/azure-cli/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
    raise ex
  File "/usr/local/pipx/venvs/azure-cli/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 "/usr/local/pipx/venvs/azure-cli/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
    result = cmd_copy(params)
  File "/usr/local/pipx/venvs/azure-cli/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__
    return self.handler(*args, **kwargs)
  File "/usr/local/pipx/venvs/azure-cli/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/usr/local/pipx/venvs/azure-cli/lib/python3.10/site-packages/azure/cli/command_modules/resource/custom.py", line 3708, in show_bicep_cli_version
    print(run_bicep_command(["--version"], auto_install=False))
  File "/usr/local/pipx/venvs/azure-cli/lib/python3.10/site-packages/azure/cli/command_modules/resource/_bicep.py", line 75, in run_bicep_command
    installed_version = _get_bicep_installed_version(installation_path)
  File "/usr/local/pipx/venvs/azure-cli/lib/python3.10/site-packages/azure/cli/command_modules/resource/_bicep.py", line 203, in _get_bicep_installed_version
    installed_version_output = _run_command(bicep_executable_path, ["--version"])
  File "/usr/local/pipx/venvs/azure-cli/lib/python3.10/site-packages/azure/cli/command_modules/resource/_bicep.py", line 241, in _run_command
    process = subprocess.run([rf"{bicep_installation_path}"] + args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  File "/usr/lib/python3.10/subprocess.py", line 501, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib/python3.10/subprocess.py", line 969, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.10/subprocess.py", line 1845, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 8] Exec format error: '/home/vscode/.azure/bin/bicep'
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues
To open a new issue, please run `az feedback`

Note the error above states “OSError: [Errno 8] Exec format error:”

Also, since I am on a darwin arm64 system, I’d expect to be able to run the az bicep install command with a --target-platform value of osx-arm64 but the enum for the parameter does not support that value yet.

Here is what I get when attempting to install for a target platform that is not supported.

$ az bicep install --target-platform osx-arm64
az bicep install: 'osx-arm64' is not a valid value for '--target-platform'. Allowed values: win-x64, linux-musl-x64, linux-x64, osx-x64.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot Bicep installation - Azure - Microsoft Learn
First, open your command prompt (not PowerShell), and run where bicep . This command returns the locations of your Bicep installations. If you' ......
Read more >
Migrating Azure ARM templates to Bicep - Rick Roché
You may need to fix warnings and errors in the generated bicep file(s), or decompilation may fail entirely if an accurate conversion is...
Read more >
Getting Started with Azure Bicep (Step-by-Step)
Before attempting to install the Bicep CLI, first check to see if it's already installed. Depending on the version of the Azure CLI...
Read more >
Gijs Reijn - 5 best practices for using Azure Bicep
You already have your software installed locally, like Visual Studio Code, the Bicep extension and the Azure CLI.
Read more >
Get Started With Azure Bicep - Alternative To ARM Templates
On Windows machines, Azure Bicep can be installed using PowerShell ... .bicep files into ARM Template JSON with a single command, such as:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found