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

ERROR: cli.azure.cli.core.azclierror: An error occurred reading file. Could not find a part of the path '/github/workspace/Azure/main.bicep'. #18

Open
LucaOtto opened this issue Jul 4, 2024 · 0 comments

Comments

@LucaOtto
Copy link

LucaOtto commented Jul 4, 2024

I tried to deploy this app on two different Azure subscriptions and getting the same error ( see below).

Run azure/CLI@v2
with:
inlineScript: echo "Creating resources"
az deployment group create --resource-group AzureContAppsDAPR --template-file '/github/workspace/Azure/main.bicep' --debug

azcliversion: agentazcliversion

env:
RESOURCE_GROUP_NAME: AzureContAppsDAPR
REGION: uksouth
STORE_DOCKER: Store/Dockerfile
STORE_IMAGE: store
INVENTORY_DOCKER: Store.InventoryApi/Dockerfile
INVENTORY_IMAGE: inventory
PRODUCTS_DOCKER: Store.ProductApi/Dockerfile
PRODUCTS_IMAGE: products
Starting script execution via docker image mcr.microsoft.com/azure-cli:2.61.0
Creating resources

DEBUG: cli.knack.cli: Command arguments: ['deployment', 'group', 'create', '--resource-group', 'AzureContAppsDAPR', '--template-file', '/github/workspace/Azure/main.bicep', '--debug']
DEBUG: cli.knack.cli: init debug log:
Cannot enable color.
DEBUG: cli.knack.cli: Event: Cli.PreExecute []
DEBUG: cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x7fbe5adef1a0>, <function OutputProducer.on_global_arguments at 0x7fbe5ace28e0>, <function CLIQuery.on_global_arguments at 0x7fbe5aa80400>]
DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
DEBUG: cli.azure.cli.core: Modules found from index for 'deployment': ['azure.cli.command_modules.resource']
DEBUG: cli.azure.cli.core: Loading command modules:
DEBUG: cli.azure.cli.core: Name Load Time Groups Commands
DEBUG: cli.azure.cli.core: resource 0.113 51 231
DEBUG: cli.azure.cli.core: Total (1) 0.113 51 231
DEBUG: cli.azure.cli.core: Loaded 51 groups, 231 commands.
DEBUG: cli.azure.cli.core: Found a match in the command table.
DEBUG: cli.azure.cli.core: Raw command : deployment group create
DEBUG: cli.azure.cli.core: Command table: deployment group create
DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x7fbe59099580>]
DEBUG: cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/root/.azure/commands/2024-07-04.14-34-57.deployment_group_create.7.log'.
INFO: az_command_data_logger: command args: deployment group create --resource-group *** --template-file *** --debug
DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x7fbe590d71a0>]
DEBUG: cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
DEBUG: cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument..add_ids_arguments at 0x7fbe590c1da0>, <function register_cache_arguments..add_cache_arguments at 0x7fbe590c1ee0>]
DEBUG: cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
DEBUG: cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x7fbe5ace2980>, <function CLIQuery.handle_query_parameter at 0x7fbe5aa804a0>, <function register_ids_argument..parse_ids_arguments at 0x7fbe590c1e40>]
DEBUG: cli.azure.cli.command_modules.resource._bicep: Current value of "use_binary_from_path": if_found_in_ci.
DEBUG: cli.azure.cli.command_modules.resource._bicep: Running in a CI environment. Bicep CLI available on PATH: False.
DEBUG: cli.azure.cli.command_modules.resource._bicep: Bicep CLI installation path: /root/.azure/bin/bicep
DEBUG: cli.azure.cli.command_modules.resource._bicep: Bicep CLI installed: False.
DEBUG: urllib3.connectionpool: Starting new HTTPS connection (1): aka.ms:443
DEBUG: urllib3.connectionpool: https://aka.ms:443 "GET /BicepLatestRelease HTTP/1.1" 301 0
DEBUG: urllib3.connectionpool: Starting new HTTPS connection (1): downloads.bicep.azure.com:443
DEBUG: urllib3.connectionpool: https://downloads.bicep.azure.com:443 "GET /releases/latest HTTP/1.1" 200 36994
DEBUG: cli.azure.cli.command_modules.resource._bicep: Generated download URL https://downloads.bicep.azure.com/v0.28.1/bicep-linux-musl-x64. from system Linux, machine x86_64, release tag v0.28.1 and target platform None.
WARNING: cli.azure.cli.command_modules.resource._bicep: The configuration value of bicep.use_binary_from_path has been set to 'false'.
INFO: cli.azure.cli.command_modules.resource._bicep: Successfully installed Bicep CLI to /root/.azure/bin/bicep
DEBUG: cli.azure.cli.core.azclierror: Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/azure/cli/command_modules/resource/_bicep.py", line 334, in _run_command
process.check_returncode()
File "/usr/local/lib/python3.11/subprocess.py", line 502, in check_returncode
raise CalledProcessError(self.returncode, self.args, self.stdout,
subprocess.CalledProcessError: Command '['/root/.azure/bin/bicep', 'build', '--stdout', '/github/workspace/Azure/main.bicep']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 701, in _run_job
result = cmd_copy(params)
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 334, in call
return self.handler(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
return op(**command_args)
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/command_modules/resource/custom.py", line 610, in deploy_arm_template_at_resource_group
return _deploy_arm_template_at_resource_group(cmd=cmd,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/command_modules/resource/custom.py", line 639, in _deploy_arm_template_at_resource_group
deployment_properties = _prepare_deployment_properties_unmodified(cmd, 'resourceGroup', template_file=template_file,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/command_modules/resource/custom.py", line 1161, in _prepare_deployment_properties_unmodified
run_bicep_command(cmd.cli_ctx, ["build", "--stdout", template_file])
File "/usr/local/lib/python3.11/site-packages/azure/cli/command_modules/resource/_bicep.py", line 107, in run_bicep_command
return _run_command(installation_path, args, custom_env)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/command_modules/resource/_bicep.py", line 350, in _run_command
raise UnclassifiedUserFault(error_msg)
azure.cli.core.azclierror.UnclassifiedUserFault: An error occurred reading file. Could not find a part of the path '/github/workspace/Azure/main.bicep'.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/commands/arm.py", line 109, in handle_template_based_exception
raise CLIError(ex.inner_exception.error.message)
^^^^^^^^^^^^^^^^^^
AttributeError: 'UnclassifiedUserFault' object has no attribute 'inner_exception'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 664, in execute
raise ex
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 731, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 723, in _run_job
return cmd_copy.exception_handler(ex)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/azure/cli/core/commands/arm.py", line 114, in handle_template_based_exception
raise CLIError(ex)
knack.util.CLIError: An error occurred reading file. Could not find a part of the path '/github/workspace/Azure/main.bicep'.

ERROR: cli.azure.cli.core.azclierror: An error occurred reading file. Could not find a part of the path '/github/workspace/Azure/main.bicep'.
ERROR: az_command_data_logger: An error occurred reading file. Could not find a part of the path '/github/workspace/Azure/main.bicep'.

DEBUG: cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x7fbe59099800>]
INFO: az_command_data_logger: exit code: 1
INFO: cli.main: Command ran in 2.554 seconds (init: 0.267, invoke: 2.288)
INFO: telemetry.main: Begin splitting cli events and extra events, total events: 1
INFO: telemetry.client: Accumulated 0 events. Flush the clients.
INFO: telemetry.main: Finish splitting cli events and extra events, cli events: 1
INFO: telemetry.save: Save telemetry record of length 3860 in cache
INFO: telemetry.main: Begin creating telemetry upload process.
INFO: telemetry.process: Creating upload process: "/usr/local/bin/python /usr/local/lib/python3.11/site-packages/azure/cli/telemetry/init.py /root/.azure"
INFO: telemetry.process: Return from creating process
INFO: telemetry.main: Finish creating telemetry upload process.
Error: Error: az cli script failed.
cleaning up container...
MICROSOFT_AZURE_CLI_1720103696423_CONTAINER

Error: az cli script failed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant