-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Comments
Thank you for opening this issue, we will look into it. |
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @calvinsID. Issue DetailsDescribe the bugFix 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 commandaz containerapp compose create\ ErrorsERROR: The command failed with an unexpected error. Here is the traceback: Issue script & Debug outputcli.azure.cli.core.util: Response content: The above exception was the direct cause of the following exception: Traceback (most recent call last): cli.azure.cli.core.azclierror: Error parsing ./rollout_azure.sh.postgres.yml (while parsing a block mapping Expected behaviorrunning the script, it should work currently, the execution of the statement fails due to the errors within the python modules! Environment Summaryaz --version: azure-cli 2.49.0 core 2.49.0 Extensions: Dependencies: Python location '/usr/bin/python3' Python (Linux) 3.10.11 (main, Apr 27 2023, 21:52:36) [GCC] Additional contextN/A
|
Adding Service team to look into this. |
Hello Team , any update on this issue ? |
We see a similar exception when trying to create a container via docker compose file with "=" (equals sign) in an environment setting:
|
Just encountered the same error, the container environment location is in 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
This was executed in a folder containing a docker-compose.yml that I have verified working with docker compose. Errors
Environment Summaryaz --version core 2.58.0 Dependencies: Python location 'C:\Program Files\Microsoft SDKs\Azure\CLI2\python.exe' |
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
The text was updated successfully, but these errors were encountered: