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

ComposeElement.__init__() takes from 2 to 3 positional arguments but 4 were given #6424

Open
bayanlouzi opened this issue Jun 20, 2023 · 6 comments
Labels
Auto-Assign Auto assign by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. ContainerApp customer-reported Issues that are reported by GitHub users external to the Azure organization. Service Attention This issue is responsible by Azure service team.

Comments

@bayanlouzi
Copy link

bayanlouzi commented Jun 20, 2023

Describe the bug

Fix the implementation problem in the Python modules of the Azure CLI, The error message that was generated :

(ComposeElement.init() takes from 2 to 3 positional arguments but 4 were given) refers to a programming problem within the Python modules of the Microsoft Azure CLI.

Related command

az containerapp compose create\
--resource-group Test2ResGrp\
--environment Test2ContEnv\
--location germanywestcentral\
--compose-file-path ./rollout_azure.sh.postgres.yml\
--registry-server testreg\
--registry-username testuserreg\
--registry-password id...p1g

Errors

ERROR: The command failed with an unexpected error. Here is the traceback:
ERROR: ComposeElement.init() takes from 2 to 3 positional arguments but 4 were given
Traceback (most recent call last):
File '/usr/lib/python3.10/site-packages/knack/cli.py', line 233, in invoke
cmd_result = self.invocation.execute(args)
File '/usr/lib/python3.10/site-packages/azure/cli/core/commands/init.py', line 663, in execute
raise ex
File '/usr/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/lib/python3.10/site-packages/azure/cli/core/commands/init.py', line 697, in _run_job
result = cmd_copy(params)
File '/usr/lib/python3.10/site-packages/azure/cli/core/commands/init.py', line 333, in call
return self.handler(*args, **kwargs)
File '/usr/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py', line 121, in handler
return op(**command_args)
File '/home/qrod/.azure/cliextensions/containerapp/azext_containerapp/custom.py', line 5301, in create_containerapps_from_compose
parsed_compose_file = ComposeFile(compose_yaml)
File '/home/qrod/.azure/cliextensions/containerapp/pycomposefile/compose_file.py', line 18, in init
self.services[service] = Service.from_parsed_yaml(
File '/home/qrod/.azure/cliextensions/containerapp/pycomposefile/compose_element/compose_element.py', line 75, in from_parsed_yaml
return cls(config, compose_path)
File '/home/qrod/.azure/cliextensions/containerapp/pycomposefile/compose_element/compose_element.py', line 42, in init
self.set_supported_property_from_config(key, key_config, config_element, compose_path)
File '/home/qrod/.azure/cliextensions/containerapp/pycomposefile/compose_element/compose_element.py', line 56, in set_supported_property_from_config
value = self.transform(value, key, compose_path)
TypeError: ComposeElement.init() takes from 2 to 3 positional arguments but 4 were given

Issue script & Debug output

cli.azure.cli.core.util: Response content:
cli.azure.cli.core.util: {"id":"/subscriptions/XXXXXXXXXXXXXXXx/resourceGroups/ca-session-rg2/providers/Microsoft.App/managedEnvironments/ca-session-env2","name":"ca-session-env2","type":"Microsoft.App/managedEnvironments","location":"East US","systemData":{"createdBy":"XXXXXXXXXXXXXXXx","createdByType":"User","createdAt":"2023-02-13T14:16:30.3861525","lastModifiedBy":"XXXXXXXXXXXXXXXx","lastModifiedByType":"User","lastModifiedAt":"2023-02-16T12:46:01.3234352"},"properties":{"provisioningState":"Succeeded","daprAIInstrumentationKey":null,"daprAIConnectionString":null,"vnetConfiguration":null,"defaultDomain":"wonderfulrock-3e364d43.eastus.azurecontainerapps.io","staticIp":"20.120.126.118","appLogsConfiguration":{"destination":"log-analytics","logAnalyticsConfiguration":{"customerId":"cc2259ab-6cae-46e5-b5a5-44424e39f4c7","sharedKey":null}},"zoneRedundant":false,"kedaConfiguration":{"version":"2.10.0"},"daprConfiguration":{"version":"1.10.7"},"eventStreamEndpoint":"https://eastus.azurecontainerapps.dev/subscriptions/48c2ece5-ded8-4806-8c46-72df34f73606/resourceGroups/ca-session-rg2/managedEnvironments/ca-session-env2/eventstream","customDomainConfiguration":{"customDomainVerificationId":"27451828C7509387ED86B29F850BE20669623FF7DEB55ADFA492D70ACE112A84","dnsSuffix":null,"certificateValue":null,"certificatePassword":null,"thumbprint":null,"subjectName":null,"expirationDate":null},"workloadProfiles":null,"firstPartyConfiguration":null,"infrastructureResourceGroup":null,"peerAuthentication":{"mtls":{"enabled":false}}}}
cli.azure.cli.core.azclierror: Traceback (most recent call last):
File "C:\Users\bayanallouzi.azure\cliextensions\containerapp\azext_containerapp\custom.py", line 152, in load_yaml_file
return yaml.safe_load(stream.read().replace('\x00', ''))
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\yaml/init.py", line 125, in safe_load
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\yaml/init.py", line 81, in load
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\yaml/constructor.py", line 49, in get_single_data
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\yaml/composer.py", line 36, in get_single_node
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\yaml/composer.py", line 55, in compose_document
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\yaml/composer.py", line 84, in compose_node File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\yaml/composer.py", line 133, in compose_mapping_node
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\yaml/composer.py", line 84, in compose_node File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\yaml/composer.py", line 133, in compose_mapping_node
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\yaml/composer.py", line 84, in compose_node File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\yaml/composer.py", line 127, in compose_mapping_node
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\yaml/parser.py", line 98, in check_event
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\yaml/parser.py", line 438, in parse_block_mapping_key
yaml.parser.ParserError: while parsing a block mapping
in "", line 7, column 5:
container_name: postgres # Wi ...
^
expected , but found ''
in "", line 33, column 6:
volumes:
^

The above exception was the direct cause of the following exception:

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 663, in execute
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 726, 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 697, in _run_job
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 333, 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\bayanallouzi.azure\cliextensions\containerapp\azext_containerapp\custom.py", line 5504, in create_containerapps_from_compose
compose_yaml = load_yaml_file(compose_file_path)
File "C:\Users\bayanallouzi.azure\cliextensions\containerapp\azext_containerapp\custom.py", line 158, in load_yaml_file
raise ValidationError('Error parsing {} ({})'.format(file_name, str(ex))) from ex
azure.cli.core.azclierror.ValidationError: Error parsing ./rollout_azure.sh.postgres.yml (while parsing a block mapping
in "", line 7, column 5:
container_name: postgres # Wi ...
^
expected , but found ''
in "", line 33, column 6:
volumes:
^)

cli.azure.cli.core.azclierror: Error parsing ./rollout_azure.sh.postgres.yml (while parsing a block mapping
in "", line 7, column 5:
container_name: postgres # Wi ...
^
expected , but found ''
in "", line 33, column 6:
volumes:
^)
az_command_data_logger: Error parsing ./rollout_azure.sh.postgres.yml (while parsing a block mapping
in "", line 7, column 5:
container_name: postgres # Wi ...
^
expected , but found ''
in "", line 33, column 6:
volumes:
^)
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x03B1A610>]
az_command_data_logger: exit code: 1
cli.main: Command ran in 4.115 seconds (init: 0.682, invoke: 3.432)
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 3886 in cache
telemetry.check: Returns Positive.
telemetry.main: Begin creating telemetry upload process.
telemetry.process: Creating upload process: "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\azure\cli\telemetry_init_.pyc C:\Users\bayanallouzi.azure"
telemetry.process: Return from creating process
telemetry.main: Finish creating telemetry upload process.

Expected behavior

running the script, it should work currently, the execution of the statement fails due to the errors within the python modules!

Environment Summary

az --version:

azure-cli 2.49.0

core 2.49.0
telemetry 1.0.8

Extensions:
containerapp 0.3.32

Dependencies:
msal 1.20.0
azure-mgmt-resource 22.0.0

Python location '/usr/bin/python3'
Extensions directory '/home/qrod/.azure/cliextensions'

Python (Linux) 3.10.11 (main, Apr 27 2023, 21:52:36) [GCC]

Additional context

N/A

@bayanlouzi bayanlouzi added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Jun 20, 2023
@ghost ghost added question The issue doesn't require a change to the product in order to be resolved. Most issues start as that customer-reported Issues that are reported by GitHub users external to the Azure organization. labels Jun 20, 2023
@yonzhan
Copy link
Collaborator

yonzhan commented Jun 20, 2023

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

@ghost ghost added Auto-Assign Auto assign by bot ContainerApp CXP Attention This issue is handled by CXP team. labels Jun 20, 2023
@yonzhan yonzhan removed the question The issue doesn't require a change to the product in order to be resolved. Most issues start as that label Jun 20, 2023
@navba-MSFT navba-MSFT added Service Attention This issue is responsible by Azure service team. and removed CXP Attention This issue is handled by CXP team. labels Jun 21, 2023
@ghost
Copy link

ghost commented Jun 21, 2023

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

Issue Details

Describe the bug

Fix the implementation problem in the Python modules of the Azure CLI, The error message that was generated :

(ComposeElement.init() takes from 2 to 3 positional arguments but 4 were given) refers to a programming problem within the Python modules of the Microsoft Azure CLI.

Related command

az containerapp compose create\
--resource-group Test2ResGrp\
--environment Test2ContEnv\
--location germanywestcentral\
--compose-file-path ./rollout_azure.sh.postgres.yml\
--registry-server testreg\
--registry-username testuserreg\
--registry-password id...p1g

Errors

ERROR: The command failed with an unexpected error. Here is the traceback:
ERROR: ComposeElement.init() takes from 2 to 3 positional arguments but 4 were given
Traceback (most recent call last):
File '/usr/lib/python3.10/site-packages/knack/cli.py', line 233, in invoke
cmd_result = self.invocation.execute(args)
File '/usr/lib/python3.10/site-packages/azure/cli/core/commands/init.py', line 663, in execute
raise ex
File '/usr/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/lib/python3.10/site-packages/azure/cli/core/commands/init.py', line 697, in _run_job
result = cmd_copy(params)
File '/usr/lib/python3.10/site-packages/azure/cli/core/commands/init.py', line 333, in call
return self.handler(*args, **kwargs)
File '/usr/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py', line 121, in handler
return op(**command_args)
File '/home/qrod/.azure/cliextensions/containerapp/azext_containerapp/custom.py', line 5301, in create_containerapps_from_compose
parsed_compose_file = ComposeFile(compose_yaml)
File '/home/qrod/.azure/cliextensions/containerapp/pycomposefile/compose_file.py', line 18, in init
self.services[service] = Service.from_parsed_yaml(
File '/home/qrod/.azure/cliextensions/containerapp/pycomposefile/compose_element/compose_element.py', line 75, in from_parsed_yaml
return cls(config, compose_path)
File '/home/qrod/.azure/cliextensions/containerapp/pycomposefile/compose_element/compose_element.py', line 42, in init
self.set_supported_property_from_config(key, key_config, config_element, compose_path)
File '/home/qrod/.azure/cliextensions/containerapp/pycomposefile/compose_element/compose_element.py', line 56, in set_supported_property_from_config
value = self.transform(value, key, compose_path)
TypeError: ComposeElement.init() takes from 2 to 3 positional arguments but 4 were given

Issue script & Debug output

cli.azure.cli.core.util: Response content:
cli.azure.cli.core.util: {"id":"/subscriptions/XXXXXXXXXXXXXXXx/resourceGroups/ca-session-rg2/providers/Microsoft.App/managedEnvironments/ca-session-env2","name":"ca-session-env2","type":"Microsoft.App/managedEnvironments","location":"East US","systemData":{"createdBy":"[email protected]","createdByType":"User","createdAt":"2023-02-13T14:16:30.3861525","lastModifiedBy":"[email protected]","lastModifiedByType":"User","lastModifiedAt":"2023-02-16T12:46:01.3234352"},"properties":{"provisioningState":"Succeeded","daprAIInstrumentationKey":null,"daprAIConnectionString":null,"vnetConfiguration":null,"defaultDomain":"wonderfulrock-3e364d43.eastus.azurecontainerapps.io","staticIp":"20.120.126.118","appLogsConfiguration":{"destination":"log-analytics","logAnalyticsConfiguration":{"customerId":"cc2259ab-6cae-46e5-b5a5-44424e39f4c7","sharedKey":null}},"zoneRedundant":false,"kedaConfiguration":{"version":"2.10.0"},"daprConfiguration":{"version":"1.10.7"},"eventStreamEndpoint":"https://eastus.azurecontainerapps.dev/subscriptions/48c2ece5-ded8-4806-8c46-72df34f73606/resourceGroups/ca-session-rg2/managedEnvironments/ca-session-env2/eventstream","customDomainConfiguration":{"customDomainVerificationId":"27451828C7509387ED86B29F850BE20669623FF7DEB55ADFA492D70ACE112A84","dnsSuffix":null,"certificateValue":null,"certificatePassword":null,"thumbprint":null,"subjectName":null,"expirationDate":null},"workloadProfiles":null,"firstPartyConfiguration":null,"infrastructureResourceGroup":null,"peerAuthentication":{"mtls":{"enabled":false}}}}
cli.azure.cli.core.azclierror: Traceback (most recent call last):
File "C:\Users\bayanallouzi.azure\cliextensions\containerapp\azext_containerapp\custom.py", line 152, in load_yaml_file
return yaml.safe_load(stream.read().replace('\x00', ''))
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\yaml/init.py", line 125, in safe_load
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\yaml/init.py", line 81, in load
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\yaml/constructor.py", line 49, in get_single_data
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\yaml/composer.py", line 36, in get_single_node
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\yaml/composer.py", line 55, in compose_document
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\yaml/composer.py", line 84, in compose_node File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\yaml/composer.py", line 133, in compose_mapping_node
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\yaml/composer.py", line 84, in compose_node File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\yaml/composer.py", line 133, in compose_mapping_node
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\yaml/composer.py", line 84, in compose_node File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\yaml/composer.py", line 127, in compose_mapping_node
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\yaml/parser.py", line 98, in check_event
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\yaml/parser.py", line 438, in parse_block_mapping_key
yaml.parser.ParserError: while parsing a block mapping
in "", line 7, column 5:
container_name: postgres # Wi ...
^
expected , but found ''
in "", line 33, column 6:
volumes:
^

The above exception was the direct cause of the following exception:

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 663, in execute
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 726, 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 697, in _run_job
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 333, 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\bayanallouzi.azure\cliextensions\containerapp\azext_containerapp\custom.py", line 5504, in create_containerapps_from_compose
compose_yaml = load_yaml_file(compose_file_path)
File "C:\Users\bayanallouzi.azure\cliextensions\containerapp\azext_containerapp\custom.py", line 158, in load_yaml_file
raise ValidationError('Error parsing {} ({})'.format(file_name, str(ex))) from ex
azure.cli.core.azclierror.ValidationError: Error parsing ./rollout_azure.sh.postgres.yml (while parsing a block mapping
in "", line 7, column 5:
container_name: postgres # Wi ...
^
expected , but found ''
in "", line 33, column 6:
volumes:
^)

cli.azure.cli.core.azclierror: Error parsing ./rollout_azure.sh.postgres.yml (while parsing a block mapping
in "", line 7, column 5:
container_name: postgres # Wi ...
^
expected , but found ''
in "", line 33, column 6:
volumes:
^)
az_command_data_logger: Error parsing ./rollout_azure.sh.postgres.yml (while parsing a block mapping
in "", line 7, column 5:
container_name: postgres # Wi ...
^
expected , but found ''
in "", line 33, column 6:
volumes:
^)
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x03B1A610>]
az_command_data_logger: exit code: 1
cli.main: Command ran in 4.115 seconds (init: 0.682, invoke: 3.432)
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 3886 in cache
telemetry.check: Returns Positive.
telemetry.main: Begin creating telemetry upload process.
telemetry.process: Creating upload process: "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\azure\cli\telemetry_init_.pyc C:\Users\bayanallouzi.azure"
telemetry.process: Return from creating process
telemetry.main: Finish creating telemetry upload process.

Expected behavior

running the script, it should work currently, the execution of the statement fails due to the errors within the python modules!

Environment Summary

az --version:

azure-cli 2.49.0

core 2.49.0
telemetry 1.0.8

Extensions:
containerapp 0.3.32

Dependencies:
msal 1.20.0
azure-mgmt-resource 22.0.0

Python location '/usr/bin/python3'
Extensions directory '/home/qrod/.azure/cliextensions'

Python (Linux) 3.10.11 (main, Apr 27 2023, 21:52:36) [GCC]

Additional context

N/A

Author: bayanlouzi
Assignees: -
Labels:

bug, customer-reported, Service Attention, Auto-Assign, ContainerApp

Milestone: -

@navba-MSFT
Copy link
Contributor

Adding Service team to look into this.

@bayanlouzi
Copy link
Author

Hello Team , any update on this issue ?

@hkelley
Copy link

hkelley commented Mar 8, 2024

We see a similar exception when trying to create a container via docker compose file with "=" (equals sign) in an environment setting:

    environment:
      - bhe_database_connection="user=bloodhound"
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 663, in execute
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 726, 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 697, in _run_job
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 333, 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\xxxx\.azure\cliextensions\containerapp\azext_containerapp\custom.py", line 1233, 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)

@DiaAWAY
Copy link

DiaAWAY commented Mar 14, 2024

Just encountered the same error, the container environment location is in norwayeast.

I have tried removing all environment settings to test if we got hit by the error @hkelley mentioned, but no difference in behaviour was observed.

Related command

az containerapp compose create --environment "askmeifyouwantit" --resource-group "askmeifyouwantit"

This was executed in a folder containing a docker-compose.yml that I have verified working with docker compose.

Errors

The command failed with an unexpected error. Here is the traceback:
ComposeElement.__init__() takes from 2 to 3 positional arguments but 4 were given
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 "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/containerapp/custom.py", line 4807, in create_containerapps_from_compose
  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 56, in set_supported_property_from_config
TypeError: ComposeElement.__init__() takes from 2 to 3 positional arguments but 4 were given

Environment Summary

az --version
azure-cli 2.58.0

core 2.58.0
telemetry 1.1.0

Dependencies:
msal 1.26.0
azure-mgmt-resource 23.1.0b2

Python location 'C:\Program Files\Microsoft SDKs\Azure\CLI2\python.exe'
Python (Windows) 3.11.7 (tags/v3.11.7:fa7a6f2, Dec 4 2023, 19:24:49) [MSC v.1937 64 bit (AMD64)]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. ContainerApp customer-reported Issues that are reported by GitHub users external to the Azure organization. Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

5 participants