Azure / azure-cli

Azure Command-Line Interface
MIT License
3.92k stars 2.89k forks source link

Docker compose create inevitable crash. #29318

Closed tmprokill closed 1 week ago

tmprokill commented 1 week ago

Describe the bug

Keep on getting crash during the process of creating docker compose file.

Related command

az containerapp compose create -g name--environment env --compose-file-path ./docker-compose.yml

Errors

The command failed with an unexpected error. Here is the traceback: too many values to unpack (expected 2) Traceback (most recent call last): File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 664, in execute File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 731, in _run_jobs_serially File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 701, in _run_job File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 334, in call File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler File "C:\Users\Artem.azure\cliextensions\containerapp\azext_containerapp\custom.py", line 1471, in create_containerapps_from_compose parsed_compose_file = ComposeFile(compose_yaml) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\pycomposefile/compose_file.py", line 18, in init File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\pycomposefile/compose_element/compose_element.py", line 71, in from_parsed_yaml File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\pycomposefile/compose_element/compose_element.py", line 42, in init File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\pycomposefile/compose_element/compose_element.py", line 58, in set_supported_property_from_config File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\pycomposefile/compose_element/compose_list_or_map.py", line 50, in init File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\pycomposefile/compose_element/compose_list_or_map.py", line 23, in evaluate_from_list File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\pycomposefile/compose_element/compose_list_or_map.py", line 18, in evaluate_from_string ValueError: too many values to unpack (expected 2)

Issue script & Debug output

cli.azure.cli.core.azclierror: Traceback (most recent call last): File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 664, in execute File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 731, in _run_jobs_serially File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 701, in _run_job File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 334, in call File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler File "C:\Users\Artem.azure\cliextensions\containerapp\azext_containerapp\custom.py", line 1471, in create_containerapps_from_compose parsed_compose_file = ComposeFile(compose_yaml) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\pycomposefile/compose_file.py", line 18, in init File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\pycomposefile/compose_element/compose_element.py", line 71, in from_parsed_yaml File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\pycomposefile/compose_element/compose_element.py", line 42, in init File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\pycomposefile/compose_element/compose_element.py", line 58, in set_supported_property_from_config File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\pycomposefile/compose_element/compose_list_or_map.py", line 50, in init File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\pycomposefile/compose_element/compose_list_or_map.py", line 23, in evaluate_from_list File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\pycomposefile/compose_element/compose_list_or_map.py", line 18, in evaluate_from_string ValueError: too many values to unpack (expected 2)

cli.azure.cli.core.azclierror: The command failed with an unexpected error. Here is the traceback: az_command_data_logger: The command failed with an unexpected error. Here is the traceback: cli.azure.cli.core.azclierror: too many values to unpack (expected 2) Traceback (most recent call last): File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 664, in execute File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 731, in _run_jobs_serially File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 701, in _run_job File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 334, in call File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler File "C:\Users\Artem.azure\cliextensions\containerapp\azext_containerapp\custom.py", line 1471, in create_containerapps_from_compose parsed_compose_file = ComposeFile(compose_yaml) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\pycomposefile/compose_file.py", line 18, in init File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\pycomposefile/compose_element/compose_element.py", line 71, in from_parsed_yaml File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\pycomposefile/compose_element/compose_element.py", line 42, in init File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\pycomposefile/compose_element/compose_element.py", line 58, in set_supported_property_from_config File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\pycomposefile/compose_element/compose_list_or_map.py", line 50, in init File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\pycomposefile/compose_element/compose_list_or_map.py", line 23, in evaluate_from_list File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\pycomposefile/compose_element/compose_list_or_map.py", line 18, in evaluate_from_string ValueError: too many values to unpack (expected 2) az_command_data_logger: too many values to unpack (expected 2) Traceback (most recent call last): File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 664, in execute File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 731, in _run_jobs_serially File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 701, in _run_job File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 334, in call File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler File "C:\Users\Artem.azure\cliextensions\containerapp\azext_containerapp\custom.py", line 1471, in create_containerapps_from_compose parsed_compose_file = ComposeFile(compose_yaml) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\pycomposefile/compose_file.py", line 18, in init File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\pycomposefile/compose_element/compose_element.py", line 71, in from_parsed_yaml File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\pycomposefile/compose_element/compose_element.py", line 42, in init File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\pycomposefile/compose_element/compose_element.py", line 58, in set_supported_property_from_config File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\pycomposefile/compose_element/compose_list_or_map.py", line 50, in init File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\pycomposefile/compose_element/compose_list_or_map.py", line 23, in evaluate_from_list File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\pycomposefile/compose_element/compose_list_or_map.py", line 18, in evaluate_from_string ValueError: too many values to unpack (expected 2) To check existing issues, please visit: https://github.com/Azure/azure-cli/issues cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x000002B5ED17E5C0>] az_command_data_logger: exit code: 1 cli.main: Command ran in 2.194 seconds (init: 0.261, invoke: 1.934) 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 7823 in cache telemetry.main: Begin creating telemetry upload process. telemetry.process: Creating upload process: "C:\Program Files\Microsoft SDKs\Azure\CLI2\python.exe C:\Program Files\Microsoft SDKs\Azure\CLI2\Lib\site-packages\azure\cli\telemetry__init__.pyc C:\Users\a.azure" telemetry.process: Return from creating process telemetry.main: Finish creating telemetry upload process.

Expected behavior

Deploying of the compose docker file to azure.

Environment Summary

azure-cli 2.61.0

core 2.61.0 telemetry 1.1.0

Extensions: account 0.2.5 containerapp 0.3.53

Dependencies: msal 1.28.0 azure-mgmt-resource 23.1.1

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

Python (Windows) 3.11.8 (tags/v3.11.8:db85d51, Feb 6 2024, 22:03:32) [MSC v.1937 64 bit (AMD64)]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Additional context

No response

azure-client-tools-bot-prd[bot] commented 1 week ago
Hi @tmprokill Find similar issue https://github.com/Azure/azure-cli/issues/11552.
Issue title Error configuration function app with powershell object for --settings
Create time 2019-12-11
Comment number 7

Possible solution: The error message "too many values to unpack (expected 2)" indicates that there is an issue with the format of the compose file. One possible solution is to check the structure of the compose file to ensure it has the correct schema. You can also try using the json format inside your json file and run the command az containerapp compose create -g name--environment env --compose-file-path ./docker-compose.yml with the following content of the json file:

[ { "name": "Setting1", "slotSetting": false, "value": "Setting1value" }, { "name": "Setting2", "slotSetting": false, "value": "Setting2value" } ]

Make sure that the reference to the json file is the correct path and the name of the json file matches the name given to the --settings parameter.


Please confirm if this resolves your issue.

yonzhan commented 1 week ago

Thank you for opening this issue, we will look into it.

microsoft-github-policy-service[bot] commented 1 week ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @calvinsID.

Greedygre commented 1 week ago

Hi @tmprokill

Can you show more detail about how to repro this issue? Thanks.