Azure / Azure/azure-cli

'rg' is not a valid value for '--output'

Open
#28,198 4 comments 0 reactions 0 assignees View on GitHub
act-platform-engineering-squad Auto-Assign bug customer-reported DevOps Service Attention
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 10h
Merged PRs (30d)
64

Description

### Describe the bug

I'm trying to interact with Azure DevOps using the azure-devops extension but every command returns the same error.

`'rg' is not a valid value for '--output'. Allowed values: json, jsonc, yaml, yamlc, table, tsv, none.`

### Related command

`az repos show -org https://dev.azure.com/[redacted]/ -r [redacted] --output json`

### Errors

ERROR: az repos show: 'rg' is not a valid value for '--output'. Allowed values: json, jsonc, yaml, yamlc, table, tsv, none.

### Issue script & Debug output

cli.knack.cli: Command arguments: ['repos', 'show', '-org', 'https://dev.azure.com/[redacted]/', '-r', '[redacted]', '--output', 'json', '--debug']
cli.knack.cli: __init__ debug log:
Enable color in terminal.
Enable VT mode.
cli.knack.cli: Event: Cli.PreExecute []
cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [, , ]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'repos': ['azext_devops']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name Load Time Groups Commands
cli.azure.cli.core: Total (0) 0.000 0 0
cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_ai_examples', 'azext_next']
cli.azure.cli.core: Loading extensions:
cli.azure.cli.core: Name Load Time Groups Commands Directory
cli.azure.cli.core: azure-devops 0.159 60 192 C:\Users\[redacted]\.azure\cliextensions\azure-devops
cli.azure.cli.core: Total (1) 0.159 60 192
cli.azure.cli.core: Loaded 60 groups, 192 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command : repos show
cli.azure.cli.core: Command table: repos show
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate []
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to 'C:\Users\[redacted]\.azure\commands\2024-01-16.10-51-52.repos_show.24704.log'.
az_command_data_logger: command args: repos show -o{} {} -r {} --output {} --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [.add_subscription_parameter at 0x03DAAC58>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [.add_ids_arguments at 0x03DDD348>, .add_cache_arguments at 0x03DDD398>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
urllib3.connectionpool: Starting new HTTPS connection (1): app.aladdin.microsoft.com:443
urllib3.connectionpool: https://app.aladdin.microsoft.com:443 "GET /api/v1.0/suggestions?query=%7B%22command%22%3A+%22repos+show%22%2C+%22parameters%22%3A+%22--output%2C--repository%22%7D&clientType=AzureCli&context=%7B%22versionNumber%22%3A+%222.56.0%22%2C+%22errorType%22%3A+%22InvalidOutputType%22%2C+%22correlationId%22%3A+%222b954980-fe1f-417e-8d0f-50a0526c521b%22%2C+%22subscriptionId%22%3A+%229e6d9ba4-38b6-4fa4-a1e6-3c4c7dcd68d8%22%2C+%22eventId%22%3A+%22105a377f-6f3a-4a30-93f6-5ec0a6f226d6%22%7D HTTP/1.1" 200 None
cli.azure.cli.core.azclierror: NoneType: None

cli.azure.cli.core.azclierror: az repos show: 'rg' is not a valid value for '--output'. Allowed values: json, jsonc, yaml, yamlc, table, tsv, none.
az_command_data_logger: az repos show: 'rg' is not a valid value for '--output'. Allowed values: json, jsonc, yaml, yamlc, table, tsv, none.

Examples from AI knowledge base:
https://aka.ms/cli_ref
Read more about the command in reference docs
cli.knack.cli: Event: Cli.PostExecute []
az_command_data_logger: exit code: 2
cli.__main__: Command ran in 2.220 seconds (init: 0.554, invoke: 1.666)
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 3557 in cache
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\[redacted]\.azure"
telemetry.process: Return from creating process
telemetry.main: Finish creating telemetry upload process.

### Expected behavior

The command returns the repo details.

### Environment Summary

azure-cli 2.56.0

core 2.56.0
telemetry 1.1.0

Extensions:
azure-devops 0.26.0

Dependencies:
msal 1.24.0b2
azure-mgmt-resource 23.1.0b2

Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\[redacted]\.azure\cliextensions'

Python (Windows) 3.11.5 (tags/v3.11.5:cce6ba9, Aug 24 2023, 14:21:31) [MSC v.1936 32 bit (Intel)]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

### Additional context

The error occurs both with and without the `--output` parameter.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing `az repos show` with and without `--output` using the reported Azure CLI 2.56.0 and azure-devops extension 0.26.0, then inspect the command's argument parsing and debug output. Done means the command returns repository details and accepts the documented output values without reporting `rg`.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, python
Domain
cli, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.