Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WinError 193] %1 is not a valid Win32 application #2364

Closed
BartoszDopke opened this issue Apr 22, 2021 · 3 comments
Closed

[WinError 193] %1 is not a valid Win32 application #2364

BartoszDopke opened this issue Apr 22, 2021 · 3 comments
Labels
Needs: Author Feedback Awaiting feedback from the author of the issue

Comments

@BartoszDopke
Copy link

Bicep version
bicep --version

Bicep CLI version 0.3.126 (a5e4c2e567)

Azure CLI version
az --version

azure-cli                         2.22.1

core                              2.22.1
telemetry                          1.0.6

Extensions:
azure-firewall                     0.9.0

Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\barte\.azure\cliextensions'

Python (Windows) 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Describe the bug
I get an error
[WinError 193] %1 is not a valid Win32 application
while running
az deployment group create -f ./main.bicep -g my-rg

To Reproduce
az deployment group create -f ./main.bicep -g my-rg

Additional context

cli.knack.cli: Command arguments: ['deployment', 'group', 'create', '-f', './main.bicep', '-g', 'my-rg', '--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 0x03996DF8>, <function OutputProducer.on_global_arguments at 0x03A31348>, <function CLIQuery.on_global_arguments at 0x03A4B270>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'deployment': ['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.023        37       176
cli.azure.cli.core: Total (1)                 0.023        37       176
cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_ai_examples', 'azext_next']
cli.azure.cli.core: Loading extensions:
cli.azure.cli.core: Name                  Load Time    Groups  Commands  Directory
cli.azure.cli.core: Total (0)                 0.000         0         0  
cli.azure.cli.core: Loaded 37 groups, 176 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command  : deployment group create
cli.azure.cli.core: Command table: deployment group create
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x03D27C90>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to 'C:\Users\barte\.azure\commands\2021-04-22.15-20-43.deployment_group_create.9884.log'.
az_command_data_logger: command args: deployment group create -f {} -g {} --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument.<locals>.add_subscription_parameter at 0x03D742B8>, <function register_global_query_examples_argument.<locals>.register_query_examples at 0x03D74A08>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument.<locals>.add_ids_arguments at 0x03D74A50>, <function register_cache_arguments.<locals>.add_cache_arguments at 0x03D74AE0>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x03A31390>, <function CLIQuery.handle_query_parameter at 0x03A4B2B8>, <function register_global_query_examples_argument.<locals>.handle_example_parameter at 0x03D749C0>, <function register_ids_argument.<locals>.parse_ids_arguments at 0x03D74A98>]
cli.azure.cli.core.util: azure.cli.core.util.handle_exception is called with an exception:
cli.azure.cli.core.util: Traceback (most recent call last):
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 691, in _run_job
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 328, in __call__
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/__init__.py", line 807, in default_command_handler
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/resource/custom.py", line 544, in deploy_arm_template_at_resource_group
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/resource/custom.py", line 571, in _deploy_arm_template_at_resource_group
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/resource/custom.py", line 900, in _prepare_deployment_properties_unmodified
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/resource/_bicep.py", line 69, in run_bicep_command
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/resource/_bicep.py", line 171, in _get_bicep_installed_version
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/resource/_bicep.py", line 205, in _run_command
  File "subprocess.py", line 729, in __init__
OSError: [WinError 193] %1 is not a valid Win32 application

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/arm.py", line 102, in handle_template_based_exception
AttributeError: 'OSError' object has no attribute 'inner_exception'

During handling of the above exception, another exception occurred:

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 657, in execute
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 720, in _run_jobs_serially
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 712, in _run_job
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/arm.py", line 104, in handle_template_based_exception
knack.util.CLIError: [WinError 193] %1 is not a valid Win32 application

cli.azure.cli.core.azclierror: [WinError 193] %1 is not a valid Win32 application
az_command_data_logger: [WinError 193] %1 is not a valid Win32 application
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x03D27DB0>]
@ghost ghost added the Needs: Triage 🔍 label Apr 22, 2021
@shenglol
Copy link
Contributor

Hi @BartoszDopke, could you try running %USERPROFILE\.azure\bin\bicep.exe --version and see if it works? It seems the bicep executable that Azure CLI installed is broken.

@shenglol
Copy link
Contributor

If it doesn't work you can clean up the %USERPROFILE\.azure\bin folder and run az bicep install to reinstall Bicep for Azure CLI.

@BartoszDopke
Copy link
Author

It finally works!

Steps done:

  1. re-installing Azure CLI
  2. re-installing Azure Bicep

Thank you very much for support, ticket is resolved.

image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Needs: Author Feedback Awaiting feedback from the author of the issue
Projects
None yet
Development

No branches or pull requests

3 participants