Azure / azure-cli

Azure Command-Line Interface
MIT License
3.91k stars 2.87k forks source link

"az devops invoke" fails with unexpected error #26594

Open kcsudeep opened 1 year ago

kcsudeep commented 1 year ago

Describe the bug

Following command fails with "unexpected error" when executed in Azure DevOps (classic release pipeline)

az devops invoke --area release --resource environments --route-parameters project='playground' releaseId=$output.id environmentId=$e.id --org 'https://dev.azure.com/xxxxxxxx/' --http-method PATCH --api-version 7.0 --in-file payload.txt -o json

Related command

echo $(System.AccessToken) | az devops login --organization https://dev.azure.com/xxxxx/

az pipelines release create --organization 'https://dev.azure.com/xxxxx/' --project 'playground' --definition-name 'MYAPP1' | ConvertFrom-Json

New-Item -Path . -Name payload.txt -ItemType File -Value '{"status":"inProgress"}'

az devops invoke --area release --resource environments --route-parameters project='playground' releaseId=?? environmentId=?? --org 'https://dev.azure.com/xxxxx/' --http-method PATCH --api-version 7.0 --in-file payload.txt -o json

Errors

2023-06-02T17:04:43.2063514Z ERROR: The command failed with an unexpected error. Here is the traceback: 2023-06-02T17:04:43.2064938Z ERROR: 'artifacts=System' 2023-06-02T17:04:43.2068284Z Traceback (most recent call last): 2023-06-02T17:04:43.2069081Z File "/opt/az/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke 2023-06-02T17:04:43.2070196Z cmd_result = self.invocation.execute(args) 2023-06-02T17:04:43.2070870Z File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 663, in execute 2023-06-02T17:04:43.2071332Z raise ex 2023-06-02T17:04:43.2072040Z File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 726, in _run_jobs_serially 2023-06-02T17:04:43.2074139Z results.append(self._run_job(expanded_arg, cmd_copy)) 2023-06-02T17:04:43.2179060Z File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 718, in _run_job 2023-06-02T17:04:43.2179396Z return cmd_copy.exception_handler(ex) 2023-06-02T17:04:43.2179840Z File "/opt/az/azcliextensions/azure-devops/azext_devops/dev/common/exception_handler.py", line 31, in azure_devops_exception_handler 2023-06-02T17:04:43.2180112Z reraise(sys.exc_info()) 2023-06-02T17:04:43.2180435Z File "/opt/az/lib/python3.10/site-packages/six.py", line 719, in reraise 2023-06-02T17:04:43.2180666Z raise value 2023-06-02T17:04:43.2181004Z File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 697, in _run_job 2023-06-02T17:04:43.2181251Z result = cmd_copy(params) 2023-06-02T17:04:43.2181619Z File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 333, in call 2023-06-02T17:04:43.2181859Z return self.handler(args, kwargs) 2023-06-02T17:04:43.2182257Z File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler 2023-06-02T17:04:43.2182499Z return op(command_args) 2023-06-02T17:04:43.2182836Z File "/opt/az/azcliextensions/azure-devops/azext_devops/dev/team/invoke.py", line 101, in invoke 2023-06-02T17:04:43.2183430Z response = client._send(http_method=http_method, 2023-06-02T17:04:43.2183799Z File "/opt/az/azcliextensions/azure-devops/azext_devops/devops_sdk/client.py", line 60, in _send 2023-06-02T17:04:43.2184067Z request = self._create_request_message(http_method=http_method, 2023-06-02T17:04:43.2184491Z File "/opt/az/azcliextensions/azure-devops/azext_devops/devops_sdk/client.py", line 117, in _create_request_message 2023-06-02T17:04:43.2184774Z request = ClientRequest(method=http_method, url=self._client.format_url(url)) 2023-06-02T17:04:43.2185174Z File "/opt/az/lib/python3.10/site-packages/msrest/service_client.py", line 151, in format_url 2023-06-02T17:04:43.2185413Z url = url.format(**kwargs) 2023-06-02T17:04:43.2185627Z KeyError: 'artifacts=System' 2023-06-02T17:04:43.2185957Z To check existing issues, please visit: https://github.com/Azure/azure-cli/issues 2023-06-02T17:04:43.2186201Z To open a new issue, please run az feedback 2023-06-02T17:04:43.3924068Z 2023-06-02T17:04:43.5973669Z ##[error]PowerShell exited with code '1'.

Issue script & Debug output

DEBUG: cli.knack.cli: Command arguments: ['devops', 'invoke', '--area', 'release', '--resource', 'environments', '--route-parameters', 'project=playground', 'releaseId=@{artifacts=System.Object[]; comment=; createdBy=; createdFor=; createdOn=06/02/2023 17:15:53; definitionSnapshotRevision=1; description=; environments=System.Object[]; id=112; keepForever=False; logsContainerUrl=https://vsrm.dev.azure.com/XXXXXXXX/6a7b4a59-6c07-4da9-9ca6-608baacc69f9/_apis/Release/releases/112/logs; modifiedBy=; modifiedOn=06/02/2023 17:15:53; name=Release-46; poolName=; projectReference=; properties=; reason=manual; releaseDefinition=; releaseDefinitionRevision=35; releaseNameFormat=Release-$(rev:r); status=active; tags=System.Object[]; triggeringArtifactAlias=; url=https://vsrm.dev.azure.com/XXXXXXXX/6a7b4a59-6c07-4da9-9ca6-608baacc69f9/_apis/Release/releases/112; variableGroups=System.Object[]; variables=}.id', 'environmentId=@{conditions=System.Object[]; createdOn=; definitionEnvironmentId=2; demands=System.Object[]; deployPhasesSnapshot=System.Object[]; deploySteps=System.Object[]; environmentOptions=; id=170; modifiedOn=; name=Deploy INT; nextScheduledUtcTime=; owner=; postApprovalsSnapshot=; postDeployApprovals=System.Object[]; postDeploymentGatesSnapshot=; preApprovalsSnapshot=; preDeployApprovals=System.Object[]; preDeploymentGatesSnapshot=; processParameters=; queueId=; rank=2; release=; releaseCreatedBy=; releaseDefinition=; releaseDescription=; releaseId=112; scheduledDeploymentTime=; schedules=System.Object[]; status=notStarted; timeToDeploy=; triggerReason=Manual; variableGroups=System.Object[]; variables=; workflowTasks=System.Object[]}.id', '--org', 'https://dev.azure.com/XXXXXXXX/', '--http-method', 'PATCH', '--api-version', '7.0', '--in-file', 'payload.txt', '-o', 'json', '--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 0x7f2eba0893f0>, <function OutputProducer.on_global_arguments at 0x7f2eb9fa0040>, <function CLIQuery.on_global_arguments at 0x7f2eb9fd5240>] DEBUG: cli.azure.cli.core.commands: Failed to load '@{artifacts=System.Object[]; comment=; createdBy=; createdFor=; createdOn=06/02/2023 17:15:53; definitionSnapshotRevision=1; description=; environments=System.Object[]; id=112; keepForever=False; logsContainerUrl=https://vsrm.dev.azure.com/XXXXXXXX/6a7b4a59-6c07-4da9-9ca6-608baacc69f9/_apis/Release/releases/112/logs; modifiedBy=; modifiedOn=06/02/2023 17:15:53; name=Release-46; poolName=; projectReference=; properties=; reason=manual; releaseDefinition=; releaseDefinitionRevision=35; releaseNameFormat=Release-$(rev:r); status=active; tags=System.Object[]; triggeringArtifactAlias=; url=https://vsrm.dev.azure.com/XXXXXXXX/6a7b4a59-6c07-4da9-9ca6-608baacc69f9/_apis/Release/releases/112; variableGroups=System.Object[]; variables=}.id', assume not a file DEBUG: cli.azure.cli.core.commands: Failed to load '@{conditions=System.Object[]; createdOn=; definitionEnvironmentId=2; demands=System.Object[]; deployPhasesSnapshot=System.Object[]; deploySteps=System.Object[]; environmentOptions=; id=170; modifiedOn=; name=Deploy INT; nextScheduledUtcTime=; owner=; postApprovalsSnapshot=; postDeployApprovals=System.Object[]; postDeploymentGatesSnapshot=; preApprovalsSnapshot=; preDeployApprovals=System.Object[]; preDeploymentGatesSnapshot=; processParameters=; queueId=; rank=2; release=; releaseCreatedBy=; releaseDefinition=; releaseDescription=; releaseId=112; scheduledDeploymentTime=; schedules=System.Object[]; status=notStarted; timeToDeploy=; triggerReason=Manual; variableGroups=System.Object[]; variables=; workflowTasks=System.Object[]}.id', assume not a file DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate [] DEBUG: cli.azure.cli.core: Modules found from index for 'devops': ['azext_devops'] DEBUG: cli.azure.cli.core: Loading command modules: DEBUG: cli.azure.cli.core: Name Load Time Groups Commands DEBUG: cli.azure.cli.core: Total (0) 0.000 0 0 DEBUG: cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_ai_examples', 'azext_next'] DEBUG: cli.azure.cli.core: Loading extensions: DEBUG: cli.azure.cli.core: Name Load Time Groups Commands Directory DEBUG: cli.azure.cli.core: azure-devops 0.074 60 192 /opt/az/azcliextensions/azure-devops DEBUG: cli.azure.cli.core: Total (1) 0.074 60 192
DEBUG: cli.azure.cli.core: Loaded 60 groups, 192 commands. DEBUG: cli.azure.cli.core: Found a match in the command table. DEBUG: cli.azure.cli.core: Raw command : devops invoke DEBUG: cli.azure.cli.core: Command table: devops invoke DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x7f2eb8e3ac20>] DEBUG: cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/home/vsts/.azure/commands/2023-06-02.17-15-54.devops_invoke.1890.log'. INFO: az_command_data_logger: command args: devops invoke --area {} --resource {} --route-parameters {} {} {} --org {} --http-method {} --api-version {} --in-file {} -o {} --debug DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x7f2eb8e53760>] DEBUG: cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad [] DEBUG: cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument..add_ids_arguments at 0x7f2eb8e956c0>, <function register_cache_arguments..add_cache_arguments at 0x7f2eb8e957e0>] 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 0x7f2eb9fa00d0>, <function CLIQuery.handle_query_parameter at 0x7f2eb9fd52d0>, <function register_ids_argument..parse_ids_arguments at 0x7f2eb8e95750>, <function DevCommandsLoader.post_parse_args at 0x7f2eb8cd7130>] INFO: az_command_data_logger: extension name: azure-devops INFO: az_command_data_logger: extension version: 0.26.0 INFO: cli.azext_devops.dev.team.invoke: route_parameter received is ['project=playground', 'releaseId=@{artifacts=System.Object[]; comment=; createdBy=; createdFor=; createdOn=06/02/2023 17:15:53; definitionSnapshotRevision=1; description=; environments=System.Object[]; id=112; keepForever=False; logsContainerUrl=https://vsrm.dev.azure.com/XXXXXXXX/6a7b4a59-6c07-4da9-9ca6-608baacc69f9/_apis/Release/releases/112/logs; modifiedBy=; modifiedOn=06/02/2023 17:15:53; name=Release-46; poolName=; projectReference=; properties=; reason=manual; releaseDefinition=; releaseDefinitionRevision=35; releaseNameFormat=Release-$(rev:r); status=active; tags=System.Object[]; triggeringArtifactAlias=; url=https://vsrm.dev.azure.com/XXXXXXXX/6a7b4a59-6c07-4da9-9ca6-608baacc69f9/_apis/Release/releases/112; variableGroups=System.Object[]; variables=}.id', 'environmentId=@{conditions=System.Object[]; createdOn=; definitionEnvironmentId=2; demands=System.Object[]; deployPhasesSnapshot=System.Object[]; deploySteps=System.Object[]; environmentOptions=; id=170; modifiedOn=; name=Deploy INT; nextScheduledUtcTime=; owner=; postApprovalsSnapshot=; postDeployApprovals=System.Object[]; postDeploymentGatesSnapshot=; preApprovalsSnapshot=; preDeployApprovals=System.Object[]; preDeploymentGatesSnapshot=; processParameters=; queueId=; rank=2; release=; releaseCreatedBy=; releaseDefinition=; releaseDescription=; releaseId=112; scheduledDeploymentTime=; schedules=System.Object[]; status=notStarted; timeToDeploy=; triggerReason=Manual; variableGroups=System.Object[]; variables=; workflowTasks=System.Object[]}.id'] DEBUG: cli.azext_devops.dev.common._credentials: Getting credential: azdevops-cli:https://dev.azure.com/XXXXXXXX INFO: keyring.backend: Loading KWallet INFO: keyring.backend: Loading SecretService INFO: keyring.backend: Loading Windows INFO: keyring.backend: Loading chainer INFO: keyring.backend: Loading macOS DEBUG: cli.azext_devops.dev.common.credential_store: Keyring backend : keyring.backends.fail.Keyring (priority: 0) DEBUG: cli.azext_devops.dev.common.credential_store: Keyring not configured properly or package not found.Looking for credentials with key:azdevops-cli:https://dev.azure.com/XXXXXXXX in the file: /home/vsts/.azure/azuredevops/personalAccessTokens DEBUG: cli.azext_devops.dev.common.services: PAT is present which can be used against this instance DEBUG: cli.azure.cli.core: Current cloud config: AzureCloud DEBUG: cli.azext_devops.dev.common.services: az login is not present DEBUG: cli.azext_devops.dev.common.services: There are no active accounts. Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/azure/cli/core/_profile.py", line 537, in get_current_account_user active_account = self.get_subscription() File "/opt/az/lib/python3.10/site-packages/azure/cli/core/_profile.py", line 546, in get_subscription raise CLIError(_AZ_LOGIN_MESSAGE) knack.util.CLIError: Please run 'az login' to setup account.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/az/azcliextensions/azure-devops/azext_devops/dev/common/services.py", line 61, in _get_credentials token_from_az_login = get_token_from_az_logins(organization, pat_token_present) File "/opt/az/azcliextensions/azure-devops/azext_devops/dev/common/services.py", line 118, in get_token_from_az_logins dummy_user = profile.get_current_account_user() # noqa: F841 File "/opt/az/lib/python3.10/site-packages/azure/cli/core/_profile.py", line 539, in get_current_account_user raise CLIError('There are no active accounts.') knack.util.CLIError: There are no active accounts. DEBUG: cli.azext_devops.dev.common._credentials: Getting credential: azdevops-cli:https://dev.azure.com/XXXXXXXX DEBUG: cli.azext_devops.dev.common.credential_store: Keyring backend : keyring.backends.fail.Keyring (priority: 0) DEBUG: cli.azext_devops.dev.common.credential_store: Keyring not configured properly or package not found.Looking for credentials with key:azdevops-cli:https://dev.azure.com/XXXXXXXX in the file: /home/vsts/.azure/azuredevops/personalAccessTokens INFO: cli.azext_devops.dev.common.services: Creating connection with personal access token. DEBUG: msrest.universal_http.requests: Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90 DEBUG: cli.azext_devops.dev.common.telemetry: Azure devops telemetry enabled. DEBUG: cli.azext_devops.dev.common.telemetry: Logging telemetry to azure devops server. DEBUG: msrest.universal_http.requests: Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90 DEBUG: cli.azext_devops.dev.common.utils: inside read_file_content_ver3 DEBUG: msrest.universal_http.requests: Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90 DEBUG: azext_devops.devops_sdk._file_cache: Loading cache file: /home/vsts/.azure-devops/python-sdk/cache/options.json DEBUG: azext_devops.devops_sdk._file_cache: attempting to read file /home/vsts/.azure-devops/python-sdk/cache/options.json as utf-8-sig DEBUG: azext_devops.devops_sdk.client: File cache hit for options on: https://dev.azure.com/XXXXXXXX DEBUG: azext_devops.devops_sdk._file_cache: Loading cache file: /home/vsts/.azure-devops/python-sdk/cache/options.json DEBUG: azext_devops.devops_sdk._file_cache: attempting to read file /home/vsts/.azure-devops/python-sdk/cache/options.json as utf-8-sig DEBUG: azext_devops.devops_sdk.client: File cache hit for options on: https://dev.azure.com/XXXXXXXX DEBUG: azext_devops.devops_sdk.client: Route template: _apis/{resource}/{areaId} DEBUG: azext_devops.devops_sdk.client: Api version '5.0-preview.1' DEBUG: azext_devops.devops_sdk.client: GET https://dev.azure.com/XXXXXXXX/_apis/ResourceAreas DEBUG: azext_devops.devops_sdk.client: Request content: None DEBUG: msrest.universal_http: Configuring redirects: allow=True, max=30 DEBUG: msrest.universal_http: Configuring request: timeout=100, verify=True, cert=None DEBUG: msrest.universal_http: Configuring proxies: '' DEBUG: msrest.universal_http: Evaluate proxies against ENV settings: True DEBUG: urllib3.connectionpool: Starting new HTTPS connection (1): dev.azure.com:443 DEBUG: azext_devops.devops_sdk.client: Route template: _apis/{area}/{resource} DEBUG: azext_devops.devops_sdk.client: Api version '5.0-preview.1' DEBUG: azext_devops.devops_sdk.client: POST https://dev.azure.com/XXXXXXXX/_apis/CustomerIntelligence/Events DEBUG: azext_devops.devops_sdk.client: Request content: [{'area': 'AzureDevopsCli', 'feature': 'devops', 'properties': {'Command': 'invoke', 'Args': 'area resource api_version http_method in_file encoding media_type accept_media_type organization', 'ShellType': None, 'IsInteractive': 'False', 'OutputType': 'json', 'OrgPresentInCommand': True, 'ProjectPresentInCommand': False, 'RepoPresentInCommand': False}}] DEBUG: msrest.universal_http: Configuring redirects: allow=True, max=30 DEBUG: msrest.universal_http: Configuring request: timeout=100, verify=True, cert=None DEBUG: msrest.universal_http: Configuring proxies: '' DEBUG: msrest.universal_http: Evaluate proxies against ENV settings: True DEBUG: urllib3.connectionpool: Starting new HTTPS connection (1): dev.azure.com:443 DEBUG: urllib3.connectionpool: https://dev.azure.com:443 "GET /XXXXXXXX/_apis/ResourceAreas HTTP/1.1" 200 9423 DEBUG: azext_devops.devops_sdk.client: Response content: b'XXXXXXXXXXX - TRIMMED - XXXXXXXx' DEBUG: azext_devops.devops_sdk._file_cache: Loading cache file: /home/vsts/.azure-devops/python-sdk/cache/resources.json DEBUG: azext_devops.devops_sdk._file_cache: attempting to read file /home/vsts/.azure-devops/python-sdk/cache/resources.json as utf-8-sig DEBUG: msrest.universal_http.requests: Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90 DEBUG: azext_devops.devops_sdk.client: File cache miss for options on: https://vsrm.dev.azure.com/XXXXXXXX DEBUG: azext_devops.devops_sdk.client: OPTIONS https://vsrm.dev.azure.com/XXXXXXXX/_apis?allHostTypes=True DEBUG: msrest.universal_http: Configuring redirects: allow=True, max=30 DEBUG: msrest.universal_http: Configuring request: timeout=100, verify=True, cert=None DEBUG: msrest.universal_http: Configuring proxies: '' DEBUG: msrest.universal_http: Evaluate proxies against ENV settings: True DEBUG: urllib3.connectionpool: Starting new HTTPS connection (1): vsrm.dev.azure.com:443 DEBUG: urllib3.connectionpool: https://dev.azure.com:443 "POST /XXXXXXXX/_apis/CustomerIntelligence/Events HTTP/1.1" 204 0 DEBUG: urllib3.connectionpool: https://vsrm.dev.azure.com:443 "OPTIONS /XXXXXXXX/_apis?allHostTypes=True HTTP/1.1" 200 11850 DEBUG: azext_devops.devops_sdk.client: Response content: b'XXXXXXXXXXX - TRIMMED - XXXXXXXx' DEBUG: azext_devops.devops_sdk.client: File cache hit for options on: https://vsrm.dev.azure.com/XXXXXXXX DEBUG: azext_devops.devops_sdk.client: Route template: {project}/_apis/Release/releases/{releaseId}/{resource}/{environmentId} DEBUG: cli.azext_devops.dev.common.exception_handler: handling generic error DEBUG: cli.azure.cli.core.azclierror: Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke cmd_result = self.invocation.execute(args) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 663, in execute raise ex File "/opt/az/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 "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 718, in _run_job return cmd_copy.exception_handler(ex) File "/opt/az/azcliextensions/azure-devops/azext_devops/dev/common/exception_handler.py", line 31, in azure_devops_exception_handler reraise(sys.exc_info()) File "/opt/az/lib/python3.10/site-packages/six.py", line 719, in reraise raise value File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 697, in _run_job result = cmd_copy(params) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 333, in call return self.handler(args, kwargs) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler return op(command_args) File "/opt/az/azcliextensions/azure-devops/azext_devops/dev/team/invoke.py", line 101, in invoke response = client._send(http_method=http_method, File "/opt/az/azcliextensions/azure-devops/azext_devops/devops_sdk/client.py", line 60, in _send request = self._create_request_message(http_method=http_method, File "/opt/az/azcliextensions/azure-devops/azext_devops/devops_sdk/client.py", line 117, in _create_request_message request = ClientRequest(method=http_method, url=self._client.format_url(url)) File "/opt/az/lib/python3.10/site-packages/msrest/service_client.py", line 151, in format_url url = url.format(**kwargs) KeyError: 'artifacts=System'

ERROR: cli.azure.cli.core.azclierror: The command failed with an unexpected error. Here is the traceback: ERROR: az_command_data_logger: The command failed with an unexpected error. Here is the traceback: ERROR: cli.azure.cli.core.azclierror: 'artifacts=System' Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke cmd_result = self.invocation.execute(args) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 663, in execute raise ex File "/opt/az/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 "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 718, in _run_job return cmd_copy.exception_handler(ex) File "/opt/az/azcliextensions/azure-devops/azext_devops/dev/common/exception_handler.py", line 31, in azure_devops_exception_handler reraise(sys.exc_info()) File "/opt/az/lib/python3.10/site-packages/six.py", line 719, in reraise raise value File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 697, in _run_job result = cmd_copy(params) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 333, in call return self.handler(args, kwargs) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler return op(command_args) File "/opt/az/azcliextensions/azure-devops/azext_devops/dev/team/invoke.py", line 101, in invoke response = client._send(http_method=http_method, File "/opt/az/azcliextensions/azure-devops/azext_devops/devops_sdk/client.py", line 60, in _send request = self._create_request_message(http_method=http_method, File "/opt/az/azcliextensions/azure-devops/azext_devops/devops_sdk/client.py", line 117, in _create_request_message request = ClientRequest(method=http_method, url=self._client.format_url(url)) File "/opt/az/lib/python3.10/site-packages/msrest/service_client.py", line 151, in format_url url = url.format(kwargs) KeyError: 'artifacts=System' ERROR: az_command_data_logger: 'artifacts=System' Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke cmd_result = self.invocation.execute(args) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 663, in execute raise ex File "/opt/az/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 "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 718, in _run_job return cmd_copy.exception_handler(ex) File "/opt/az/azcliextensions/azure-devops/azext_devops/dev/common/exception_handler.py", line 31, in azure_devops_exception_handler reraise(sys.exc_info()) File "/opt/az/lib/python3.10/site-packages/six.py", line 719, in reraise raise value File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 697, in _run_job result = cmd_copy(params) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 333, in call return self.handler(args, kwargs) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler return op(command_args) File "/opt/az/azcliextensions/azure-devops/azext_devops/dev/team/invoke.py", line 101, in invoke response = client._send(http_method=http_method, File "/opt/az/azcliextensions/azure-devops/azext_devops/devops_sdk/client.py", line 60, in _send request = self._create_request_message(http_method=http_method, File "/opt/az/azcliextensions/azure-devops/azext_devops/devops_sdk/client.py", line 117, in _create_request_message request = ClientRequest(method=http_method, url=self._client.format_url(url)) File "/opt/az/lib/python3.10/site-packages/msrest/service_client.py", line 151, in format_url url = url.format(kwargs) KeyError: 'artifacts=System' To check existing issues, please visit: https://github.com/Azure/azure-cli/issues To open a new issue, please run az feedback DEBUG: cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x7f2eb8e3ae60>] INFO: az_command_data_logger: exit code: 1 INFO: cli.main: Command ran in 1.344 seconds (init: 0.215, invoke: 1.129) 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 6967 in cache WARNING: telemetry.check: Negative: The /home/vsts/.azure/telemetry.txt was modified at 2023-06-02 17:15:38.224130, which in less than 600.000000 s

[error]PowerShell exited with code '1'.

Expected behavior

Command should complete without error

Environment Summary

azure-cli 2.48.1 *

core 2.48.1 * telemetry 1.0.8

Extensions: azure-devops 0.26.0

Dependencies: msal 1.20.0 azure-mgmt-resource 22.0.0

Python location '/opt/az/bin/python3' Extensions directory '/opt/az/azcliextensions'

Python (Linux) 3.10.10 (main, Apr 25 2023, 04:23:10) [GCC 11.3.0]

Additional context

No response

azure-client-tools-bot-prd[bot] commented 1 year ago

Hi @kcsudeep,

2.48.1 is not the latest Azure CLI(2.49.0).

Please upgrade to the latest Azure CLI version by following https://learn.microsoft.com/en-us/cli/azure/update-azure-cli.

yonzhan commented 1 year ago

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

kcsudeep commented 1 year ago

I am able to invoke following API in same context

$Params = @{
          ContentType = "application/json"
          Method = "PATCH"
          Uri = "https://vsrm.dev.azure.com/$varDevOpsOrganization/$varDevOpsProject/_apis/Release/releases/$releaseId/environments/$envId?api-version=7.0"
        }

        $data = @{status = "inProgress"} | ConvertTo-Json

        Invoke-RestMethod @Params -Headers @{Authorization = "Bearer $env:SYSTEM_ACCESSTOKEN"} -Body ($data)
ghost commented 1 year ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @v-anvashist, @V-hmusukula.

Issue Details
### Describe the bug Following command fails with "unexpected error" when executed in Azure DevOps (classic release pipeline) az devops invoke --area release --resource environments --route-parameters project='playground' releaseId=$output.id environmentId=$e.id --org 'https://dev.azure.com/xxxxxxxx/' --http-method PATCH --api-version 7.0 --in-file payload.txt -o json ### Related command echo $(System.AccessToken) | az devops login --organization https://dev.azure.com/xxxxx/ az pipelines release create --organization 'https://dev.azure.com/xxxxx/' --project 'playground' --definition-name 'MYAPP1' | ConvertFrom-Json New-Item -Path . -Name payload.txt -ItemType File -Value '{"status":"inProgress"}' az devops invoke --area release --resource environments --route-parameters project='playground' releaseId=?? environmentId=?? --org 'https://dev.azure.com/xxxxx/' --http-method PATCH --api-version 7.0 --in-file payload.txt -o json ### Errors 2023-06-02T17:04:43.2063514Z ERROR: The command failed with an unexpected error. Here is the traceback: 2023-06-02T17:04:43.2064938Z ERROR: 'artifacts=System' 2023-06-02T17:04:43.2068284Z Traceback (most recent call last): 2023-06-02T17:04:43.2069081Z File "/opt/az/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke 2023-06-02T17:04:43.2070196Z cmd_result = self.invocation.execute(args) 2023-06-02T17:04:43.2070870Z File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute 2023-06-02T17:04:43.2071332Z raise ex 2023-06-02T17:04:43.2072040Z File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially 2023-06-02T17:04:43.2074139Z results.append(self._run_job(expanded_arg, cmd_copy)) 2023-06-02T17:04:43.2179060Z File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 718, in _run_job 2023-06-02T17:04:43.2179396Z return cmd_copy.exception_handler(ex) 2023-06-02T17:04:43.2179840Z File "/opt/az/azcliextensions/azure-devops/azext_devops/dev/common/exception_handler.py", line 31, in azure_devops_exception_handler 2023-06-02T17:04:43.2180112Z reraise(*sys.exc_info()) 2023-06-02T17:04:43.2180435Z File "/opt/az/lib/python3.10/site-packages/six.py", line 719, in reraise 2023-06-02T17:04:43.2180666Z raise value 2023-06-02T17:04:43.2181004Z File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job 2023-06-02T17:04:43.2181251Z result = cmd_copy(params) 2023-06-02T17:04:43.2181619Z File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__ 2023-06-02T17:04:43.2181859Z return self.handler(*args, **kwargs) 2023-06-02T17:04:43.2182257Z File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler 2023-06-02T17:04:43.2182499Z return op(**command_args) 2023-06-02T17:04:43.2182836Z File "/opt/az/azcliextensions/azure-devops/azext_devops/dev/team/invoke.py", line 101, in invoke 2023-06-02T17:04:43.2183430Z response = client._send(http_method=http_method, 2023-06-02T17:04:43.2183799Z File "/opt/az/azcliextensions/azure-devops/azext_devops/devops_sdk/client.py", line 60, in _send 2023-06-02T17:04:43.2184067Z request = self._create_request_message(http_method=http_method, 2023-06-02T17:04:43.2184491Z File "/opt/az/azcliextensions/azure-devops/azext_devops/devops_sdk/client.py", line 117, in _create_request_message 2023-06-02T17:04:43.2184774Z request = ClientRequest(method=http_method, url=self._client.format_url(url)) 2023-06-02T17:04:43.2185174Z File "/opt/az/lib/python3.10/site-packages/msrest/service_client.py", line 151, in format_url 2023-06-02T17:04:43.2185413Z url = url.format(**kwargs) 2023-06-02T17:04:43.2185627Z KeyError: 'artifacts=System' 2023-06-02T17:04:43.2185957Z To check existing issues, please visit: https://github.com/Azure/azure-cli/issues 2023-06-02T17:04:43.2186201Z To open a new issue, please run `az feedback` 2023-06-02T17:04:43.3924068Z 2023-06-02T17:04:43.5973669Z ##[error]PowerShell exited with code '1'. ### Issue script & Debug output DEBUG: cli.knack.cli: Command arguments: ['devops', 'invoke', '--area', 'release', '--resource', 'environments', '--route-parameters', 'project=playground', 'releaseId=@{artifacts=System.Object[]; comment=; createdBy=; createdFor=; createdOn=06/02/2023 17:15:53; definitionSnapshotRevision=1; description=; environments=System.Object[]; id=112; keepForever=False; logsContainerUrl=https://vsrm.dev.azure.com/XXXXXXXX/6a7b4a59-6c07-4da9-9ca6-608baacc69f9/_apis/Release/releases/112/logs; modifiedBy=; modifiedOn=06/02/2023 17:15:53; name=Release-46; poolName=; projectReference=; properties=; reason=manual; releaseDefinition=; releaseDefinitionRevision=35; releaseNameFormat=Release-$(rev:r); status=active; tags=System.Object[]; triggeringArtifactAlias=; url=https://vsrm.dev.azure.com/XXXXXXXX/6a7b4a59-6c07-4da9-9ca6-608baacc69f9/_apis/Release/releases/112; variableGroups=System.Object[]; variables=}.id', 'environmentId=@{conditions=System.Object[]; createdOn=; definitionEnvironmentId=2; demands=System.Object[]; deployPhasesSnapshot=System.Object[]; deploySteps=System.Object[]; environmentOptions=; id=170; modifiedOn=; name=Deploy INT; nextScheduledUtcTime=; owner=; postApprovalsSnapshot=; postDeployApprovals=System.Object[]; postDeploymentGatesSnapshot=; preApprovalsSnapshot=; preDeployApprovals=System.Object[]; preDeploymentGatesSnapshot=; processParameters=; queueId=; rank=2; release=; releaseCreatedBy=; releaseDefinition=; releaseDescription=; releaseId=112; scheduledDeploymentTime=; schedules=System.Object[]; status=notStarted; timeToDeploy=; triggerReason=Manual; variableGroups=System.Object[]; variables=; workflowTasks=System.Object[]}.id', '--org', 'https://dev.azure.com/XXXXXXXX/', '--http-method', 'PATCH', '--api-version', '7.0', '--in-file', 'payload.txt', '-o', 'json', '--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 [, , ] DEBUG: cli.azure.cli.core.commands: Failed to load '@{artifacts=System.Object[]; comment=; createdBy=; createdFor=; createdOn=06/02/2023 17:15:53; definitionSnapshotRevision=1; description=; environments=System.Object[]; id=112; keepForever=False; logsContainerUrl=https://vsrm.dev.azure.com/XXXXXXXX/6a7b4a59-6c07-4da9-9ca6-608baacc69f9/_apis/Release/releases/112/logs; modifiedBy=; modifiedOn=06/02/2023 17:15:53; name=Release-46; poolName=; projectReference=; properties=; reason=manual; releaseDefinition=; releaseDefinitionRevision=35; releaseNameFormat=Release-$(rev:r); status=active; tags=System.Object[]; triggeringArtifactAlias=; url=https://vsrm.dev.azure.com/XXXXXXXX/6a7b4a59-6c07-4da9-9ca6-608baacc69f9/_apis/Release/releases/112; variableGroups=System.Object[]; variables=}.id', assume not a file DEBUG: cli.azure.cli.core.commands: Failed to load '@{conditions=System.Object[]; createdOn=; definitionEnvironmentId=2; demands=System.Object[]; deployPhasesSnapshot=System.Object[]; deploySteps=System.Object[]; environmentOptions=; id=170; modifiedOn=; name=Deploy INT; nextScheduledUtcTime=; owner=; postApprovalsSnapshot=; postDeployApprovals=System.Object[]; postDeploymentGatesSnapshot=; preApprovalsSnapshot=; preDeployApprovals=System.Object[]; preDeploymentGatesSnapshot=; processParameters=; queueId=; rank=2; release=; releaseCreatedBy=; releaseDefinition=; releaseDescription=; releaseId=112; scheduledDeploymentTime=; schedules=System.Object[]; status=notStarted; timeToDeploy=; triggerReason=Manual; variableGroups=System.Object[]; variables=; workflowTasks=System.Object[]}.id', assume not a file DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate [] DEBUG: cli.azure.cli.core: Modules found from index for 'devops': ['azext_devops'] DEBUG: cli.azure.cli.core: Loading command modules: DEBUG: cli.azure.cli.core: Name Load Time Groups Commands DEBUG: cli.azure.cli.core: Total (0) 0.000 0 0 DEBUG: cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_ai_examples', 'azext_next'] DEBUG: cli.azure.cli.core: Loading extensions: DEBUG: cli.azure.cli.core: Name Load Time Groups Commands Directory DEBUG: cli.azure.cli.core: azure-devops 0.074 60 192 /opt/az/azcliextensions/azure-devops DEBUG: cli.azure.cli.core: Total (1) 0.074 60 192 DEBUG: cli.azure.cli.core: Loaded 60 groups, 192 commands. DEBUG: cli.azure.cli.core: Found a match in the command table. DEBUG: cli.azure.cli.core: Raw command : devops invoke DEBUG: cli.azure.cli.core: Command table: devops invoke DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [] DEBUG: cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/home/vsts/.azure/commands/2023-06-02.17-15-54.devops_invoke.1890.log'. INFO: az_command_data_logger: command args: devops invoke --area {} --resource {} --route-parameters {} {} {} --org {} --http-method {} --api-version {} --in-file {} -o {} --debug DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [.add_subscription_parameter at 0x7f2eb8e53760>] DEBUG: cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad [] DEBUG: cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [.add_ids_arguments at 0x7f2eb8e956c0>, .add_cache_arguments at 0x7f2eb8e957e0>] DEBUG: cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded [] DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreParseArgs [] DEBUG: cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [, , .parse_ids_arguments at 0x7f2eb8e95750>, ] INFO: az_command_data_logger: extension name: azure-devops INFO: az_command_data_logger: extension version: 0.26.0 INFO: cli.azext_devops.dev.team.invoke: route_parameter received is ['project=playground', 'releaseId=@{artifacts=System.Object[]; comment=; createdBy=; createdFor=; createdOn=06/02/2023 17:15:53; definitionSnapshotRevision=1; description=; environments=System.Object[]; id=112; keepForever=False; logsContainerUrl=https://vsrm.dev.azure.com/XXXXXXXX/6a7b4a59-6c07-4da9-9ca6-608baacc69f9/_apis/Release/releases/112/logs; modifiedBy=; modifiedOn=06/02/2023 17:15:53; name=Release-46; poolName=; projectReference=; properties=; reason=manual; releaseDefinition=; releaseDefinitionRevision=35; releaseNameFormat=Release-$(rev:r); status=active; tags=System.Object[]; triggeringArtifactAlias=; url=https://vsrm.dev.azure.com/XXXXXXXX/6a7b4a59-6c07-4da9-9ca6-608baacc69f9/_apis/Release/releases/112; variableGroups=System.Object[]; variables=}.id', 'environmentId=@{conditions=System.Object[]; createdOn=; definitionEnvironmentId=2; demands=System.Object[]; deployPhasesSnapshot=System.Object[]; deploySteps=System.Object[]; environmentOptions=; id=170; modifiedOn=; name=Deploy INT; nextScheduledUtcTime=; owner=; postApprovalsSnapshot=; postDeployApprovals=System.Object[]; postDeploymentGatesSnapshot=; preApprovalsSnapshot=; preDeployApprovals=System.Object[]; preDeploymentGatesSnapshot=; processParameters=; queueId=; rank=2; release=; releaseCreatedBy=; releaseDefinition=; releaseDescription=; releaseId=112; scheduledDeploymentTime=; schedules=System.Object[]; status=notStarted; timeToDeploy=; triggerReason=Manual; variableGroups=System.Object[]; variables=; workflowTasks=System.Object[]}.id'] DEBUG: cli.azext_devops.dev.common._credentials: Getting credential: azdevops-cli:https://dev.azure.com/XXXXXXXX INFO: keyring.backend: Loading KWallet INFO: keyring.backend: Loading SecretService INFO: keyring.backend: Loading Windows INFO: keyring.backend: Loading chainer INFO: keyring.backend: Loading macOS DEBUG: cli.azext_devops.dev.common.credential_store: Keyring backend : keyring.backends.fail.Keyring (priority: 0) DEBUG: cli.azext_devops.dev.common.credential_store: Keyring not configured properly or package not found.Looking for credentials with key:azdevops-cli:https://dev.azure.com/XXXXXXXX in the file: /home/vsts/.azure/azuredevops/personalAccessTokens DEBUG: cli.azext_devops.dev.common.services: PAT is present which can be used against this instance DEBUG: cli.azure.cli.core: Current cloud config: AzureCloud DEBUG: cli.azext_devops.dev.common.services: az login is not present DEBUG: cli.azext_devops.dev.common.services: There are no active accounts. Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/azure/cli/core/_profile.py", line 537, in get_current_account_user active_account = self.get_subscription() File "/opt/az/lib/python3.10/site-packages/azure/cli/core/_profile.py", line 546, in get_subscription raise CLIError(_AZ_LOGIN_MESSAGE) knack.util.CLIError: Please run 'az login' to setup account. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/opt/az/azcliextensions/azure-devops/azext_devops/dev/common/services.py", line 61, in _get_credentials token_from_az_login = get_token_from_az_logins(organization, pat_token_present) File "/opt/az/azcliextensions/azure-devops/azext_devops/dev/common/services.py", line 118, in get_token_from_az_logins dummy_user = profile.get_current_account_user() # noqa: F841 File "/opt/az/lib/python3.10/site-packages/azure/cli/core/_profile.py", line 539, in get_current_account_user raise CLIError('There are no active accounts.') knack.util.CLIError: There are no active accounts. DEBUG: cli.azext_devops.dev.common._credentials: Getting credential: azdevops-cli:https://dev.azure.com/XXXXXXXX DEBUG: cli.azext_devops.dev.common.credential_store: Keyring backend : keyring.backends.fail.Keyring (priority: 0) DEBUG: cli.azext_devops.dev.common.credential_store: Keyring not configured properly or package not found.Looking for credentials with key:azdevops-cli:https://dev.azure.com/XXXXXXXX in the file: /home/vsts/.azure/azuredevops/personalAccessTokens INFO: cli.azext_devops.dev.common.services: Creating connection with personal access token. DEBUG: msrest.universal_http.requests: Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90 DEBUG: cli.azext_devops.dev.common.telemetry: Azure devops telemetry enabled. DEBUG: cli.azext_devops.dev.common.telemetry: Logging telemetry to azure devops server. DEBUG: msrest.universal_http.requests: Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90 DEBUG: cli.azext_devops.dev.common.utils: inside read_file_content_ver3 DEBUG: msrest.universal_http.requests: Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90 DEBUG: azext_devops.devops_sdk._file_cache: Loading cache file: /home/vsts/.azure-devops/python-sdk/cache/options.json DEBUG: azext_devops.devops_sdk._file_cache: attempting to read file /home/vsts/.azure-devops/python-sdk/cache/options.json as utf-8-sig DEBUG: azext_devops.devops_sdk.client: File cache hit for options on: https://dev.azure.com/XXXXXXXX DEBUG: azext_devops.devops_sdk._file_cache: Loading cache file: /home/vsts/.azure-devops/python-sdk/cache/options.json DEBUG: azext_devops.devops_sdk._file_cache: attempting to read file /home/vsts/.azure-devops/python-sdk/cache/options.json as utf-8-sig DEBUG: azext_devops.devops_sdk.client: File cache hit for options on: https://dev.azure.com/XXXXXXXX DEBUG: azext_devops.devops_sdk.client: Route template: _apis/{resource}/{areaId} DEBUG: azext_devops.devops_sdk.client: Api version '5.0-preview.1' DEBUG: azext_devops.devops_sdk.client: GET https://dev.azure.com/XXXXXXXX/_apis/ResourceAreas DEBUG: azext_devops.devops_sdk.client: Request content: None DEBUG: msrest.universal_http: Configuring redirects: allow=True, max=30 DEBUG: msrest.universal_http: Configuring request: timeout=100, verify=True, cert=None DEBUG: msrest.universal_http: Configuring proxies: '' DEBUG: msrest.universal_http: Evaluate proxies against ENV settings: True DEBUG: urllib3.connectionpool: Starting new HTTPS connection (1): dev.azure.com:443 DEBUG: azext_devops.devops_sdk.client: Route template: _apis/{area}/{resource} DEBUG: azext_devops.devops_sdk.client: Api version '5.0-preview.1' DEBUG: azext_devops.devops_sdk.client: POST https://dev.azure.com/XXXXXXXX/_apis/CustomerIntelligence/Events DEBUG: azext_devops.devops_sdk.client: Request content: [{'area': 'AzureDevopsCli', 'feature': 'devops', 'properties': {'Command': 'invoke', 'Args': 'area resource api_version http_method in_file encoding media_type accept_media_type organization', 'ShellType': None, 'IsInteractive': 'False', 'OutputType': 'json', 'OrgPresentInCommand': True, 'ProjectPresentInCommand': False, 'RepoPresentInCommand': False}}] DEBUG: msrest.universal_http: Configuring redirects: allow=True, max=30 DEBUG: msrest.universal_http: Configuring request: timeout=100, verify=True, cert=None DEBUG: msrest.universal_http: Configuring proxies: '' DEBUG: msrest.universal_http: Evaluate proxies against ENV settings: True DEBUG: urllib3.connectionpool: Starting new HTTPS connection (1): dev.azure.com:443 DEBUG: urllib3.connectionpool: https://dev.azure.com:443 "GET /XXXXXXXX/_apis/ResourceAreas HTTP/1.1" 200 9423 DEBUG: azext_devops.devops_sdk.client: Response content: b'XXXXXXXXXXX - TRIMMED - XXXXXXXx' DEBUG: azext_devops.devops_sdk._file_cache: Loading cache file: /home/vsts/.azure-devops/python-sdk/cache/resources.json DEBUG: azext_devops.devops_sdk._file_cache: attempting to read file /home/vsts/.azure-devops/python-sdk/cache/resources.json as utf-8-sig DEBUG: msrest.universal_http.requests: Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90 DEBUG: azext_devops.devops_sdk.client: File cache miss for options on: https://vsrm.dev.azure.com/XXXXXXXX DEBUG: azext_devops.devops_sdk.client: OPTIONS https://vsrm.dev.azure.com/XXXXXXXX/_apis?allHostTypes=True DEBUG: msrest.universal_http: Configuring redirects: allow=True, max=30 DEBUG: msrest.universal_http: Configuring request: timeout=100, verify=True, cert=None DEBUG: msrest.universal_http: Configuring proxies: '' DEBUG: msrest.universal_http: Evaluate proxies against ENV settings: True DEBUG: urllib3.connectionpool: Starting new HTTPS connection (1): vsrm.dev.azure.com:443 DEBUG: urllib3.connectionpool: https://dev.azure.com:443 "POST /XXXXXXXX/_apis/CustomerIntelligence/Events HTTP/1.1" 204 0 DEBUG: urllib3.connectionpool: https://vsrm.dev.azure.com:443 "OPTIONS /XXXXXXXX/_apis?allHostTypes=True HTTP/1.1" 200 11850 DEBUG: azext_devops.devops_sdk.client: Response content: b'XXXXXXXXXXX - TRIMMED - XXXXXXXx' DEBUG: azext_devops.devops_sdk.client: File cache hit for options on: https://vsrm.dev.azure.com/XXXXXXXX DEBUG: azext_devops.devops_sdk.client: Route template: {project}/_apis/Release/releases/{releaseId}/{resource}/{environmentId} DEBUG: cli.azext_devops.dev.common.exception_handler: handling generic error DEBUG: cli.azure.cli.core.azclierror: Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke cmd_result = self.invocation.execute(args) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute raise ex File "/opt/az/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 "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 718, in _run_job return cmd_copy.exception_handler(ex) File "/opt/az/azcliextensions/azure-devops/azext_devops/dev/common/exception_handler.py", line 31, in azure_devops_exception_handler reraise(*sys.exc_info()) File "/opt/az/lib/python3.10/site-packages/six.py", line 719, in reraise raise value File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job result = cmd_copy(params) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__ return self.handler(*args, **kwargs) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler return op(**command_args) File "/opt/az/azcliextensions/azure-devops/azext_devops/dev/team/invoke.py", line 101, in invoke response = client._send(http_method=http_method, File "/opt/az/azcliextensions/azure-devops/azext_devops/devops_sdk/client.py", line 60, in _send request = self._create_request_message(http_method=http_method, File "/opt/az/azcliextensions/azure-devops/azext_devops/devops_sdk/client.py", line 117, in _create_request_message request = ClientRequest(method=http_method, url=self._client.format_url(url)) File "/opt/az/lib/python3.10/site-packages/msrest/service_client.py", line 151, in format_url url = url.format(**kwargs) KeyError: 'artifacts=System' ERROR: cli.azure.cli.core.azclierror: The command failed with an unexpected error. Here is the traceback: ERROR: az_command_data_logger: The command failed with an unexpected error. Here is the traceback: ERROR: cli.azure.cli.core.azclierror: 'artifacts=System' Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke cmd_result = self.invocation.execute(args) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute raise ex File "/opt/az/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 "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 718, in _run_job return cmd_copy.exception_handler(ex) File "/opt/az/azcliextensions/azure-devops/azext_devops/dev/common/exception_handler.py", line 31, in azure_devops_exception_handler reraise(*sys.exc_info()) File "/opt/az/lib/python3.10/site-packages/six.py", line 719, in reraise raise value File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job result = cmd_copy(params) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__ return self.handler(*args, **kwargs) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler return op(**command_args) File "/opt/az/azcliextensions/azure-devops/azext_devops/dev/team/invoke.py", line 101, in invoke response = client._send(http_method=http_method, File "/opt/az/azcliextensions/azure-devops/azext_devops/devops_sdk/client.py", line 60, in _send request = self._create_request_message(http_method=http_method, File "/opt/az/azcliextensions/azure-devops/azext_devops/devops_sdk/client.py", line 117, in _create_request_message request = ClientRequest(method=http_method, url=self._client.format_url(url)) File "/opt/az/lib/python3.10/site-packages/msrest/service_client.py", line 151, in format_url url = url.format(**kwargs) KeyError: 'artifacts=System' ERROR: az_command_data_logger: 'artifacts=System' Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke cmd_result = self.invocation.execute(args) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute raise ex File "/opt/az/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 "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 718, in _run_job return cmd_copy.exception_handler(ex) File "/opt/az/azcliextensions/azure-devops/azext_devops/dev/common/exception_handler.py", line 31, in azure_devops_exception_handler reraise(*sys.exc_info()) File "/opt/az/lib/python3.10/site-packages/six.py", line 719, in reraise raise value File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job result = cmd_copy(params) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__ return self.handler(*args, **kwargs) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler return op(**command_args) File "/opt/az/azcliextensions/azure-devops/azext_devops/dev/team/invoke.py", line 101, in invoke response = client._send(http_method=http_method, File "/opt/az/azcliextensions/azure-devops/azext_devops/devops_sdk/client.py", line 60, in _send request = self._create_request_message(http_method=http_method, File "/opt/az/azcliextensions/azure-devops/azext_devops/devops_sdk/client.py", line 117, in _create_request_message request = ClientRequest(method=http_method, url=self._client.format_url(url)) File "/opt/az/lib/python3.10/site-packages/msrest/service_client.py", line 151, in format_url url = url.format(**kwargs) KeyError: 'artifacts=System' To check existing issues, please visit: https://github.com/Azure/azure-cli/issues To open a new issue, please run `az feedback` DEBUG: cli.knack.cli: Event: Cli.PostExecute [] INFO: az_command_data_logger: exit code: 1 INFO: cli.__main__: Command ran in 1.344 seconds (init: 0.215, invoke: 1.129) 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 6967 in cache WARNING: telemetry.check: Negative: The /home/vsts/.azure/telemetry.txt was modified at 2023-06-02 17:15:38.224130, which in less than 600.000000 s ##[error]PowerShell exited with code '1'. ### Expected behavior Command should complete without error ### Environment Summary azure-cli 2.48.1 * core 2.48.1 * telemetry 1.0.8 Extensions: azure-devops 0.26.0 Dependencies: msal 1.20.0 azure-mgmt-resource 22.0.0 Python location '/opt/az/bin/python3' Extensions directory '/opt/az/azcliextensions' Python (Linux) 3.10.10 (main, Apr 25 2023, 04:23:10) [GCC 11.3.0] ### Additional context _No response_
Author: kcsudeep
Assignees: -
Labels: `bug`, `Service Attention`, `customer-reported`, `DevOps`, `Pipelines`, `Auto-Assign`, `Auto-Resolve`
Milestone: Backlog