question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Organization parameter is confusing and has poor error messages on invalid input

See original GitHub issue

Is your feature request related to a problem? Please describe. It was difficult to discover how to use az artifacts universal and I had to look at docs. The error messages were cryptic and unhelpful.

Describe the solution you’d like

  • path parameter does not seem to accept relative paths
  • The parameter set should be improved. organization does not need to be a full URL, it would make more sense to accept just the organization name (without the https://dev.azure.com/ prefix)
  • I received an “index out of range” or similar exception using one of the parameters. I think this is from an internal parsing error. This error should be caught and friendly

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
chriskuechcommented, Jun 10, 2019

Also seems that the “packages” tag should be removed from this issue, as it occurs agnostic of “packages”

2reactions
chriskuechcommented, Jun 10, 2019

I think this issue should be reopened. The original issue is that specifying an improperly formatted --org parameter throws a cryptic error. I just updated and attempted to use a different command but faced the same issue. The error is uninformative and the solution is unintuitive, so it is very difficult to debug. I definitely think this error needs to be handled better, such as specifying that the issue is with --org and how to properly format the values.

C:\Repos> az boards query --org msazure --project FinOps --wiql "select * from workitems"
The command failed with an unexpected error. Here is the traceback:

list index out of range
Traceback (most recent call last):
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-qvpg2q31\knack\knack\cli.py", line 206, in invoke
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-qvpg2q31\azure-cli-core\azure\cli\core\commands\__init__.py", line 351, in execute
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-qvpg2q31\azure-cli-core\azure\cli\core\commands\__init__.py", line 409, in _run_jobs_serially
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-qvpg2q31\azure-cli-core\azure\cli\core\commands\__init__.py", line 400, in _run_job
  File "C:\Users\chkuech\.azure\cliextensions\azure-devops\azext_devops\dev\common\exception_handler.py", line 26, in azure_devops_exception_handler
    reraise(*sys.exc_info())
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-qvpg2q31\six\six.py", line 693, in reraise
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-qvpg2q31\azure-cli-core\azure\cli\core\commands\__init__.py", line 379, in _run_job
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-qvpg2q31\azure-cli-core\azure\cli\core\commands\__init__.py", line 171, in __call__
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-qvpg2q31\azure-cli-core\azure\cli\core\__init__.py", line 451, in default_command_handler
  File "C:\Users\chkuech\.azure\cliextensions\azure-devops\azext_devops\dev\boards\work_item.py", line 237, in query_work_items
    client = get_work_item_tracking_client(organization)
  File "C:\Users\chkuech\.azure\cliextensions\azure-devops\azext_devops\dev\common\services.py", line 273, in get_work_item_tracking_client
    connection = get_connection(organization)
  File "C:\Users\chkuech\.azure\cliextensions\azure-devops\azext_devops\dev\common\services.py", line 43, in get_connection
    credentials = _get_credentials(organization)
  File "C:\Users\chkuech\.azure\cliextensions\azure-devops\azext_devops\dev\common\services.py", line 56, in _get_credentials
    if PAT_ENV_VARIABLE_NAME in os.environ or get_credential(organization) is not None:
  File "C:\Users\chkuech\.azure\cliextensions\azure-devops\azext_devops\dev\common\_credentials.py", line 17, in get_credential
    token = _get_credential(organization)
  File "C:\Users\chkuech\.azure\cliextensions\azure-devops\azext_devops\dev\common\_credentials.py", line 24, in _get_credential
    key = _get_service_name(organization)
  File "C:\Users\chkuech\.azure\cliextensions\azure-devops\azext_devops\dev\common\_credentials.py", line 76, in _get_service_name
    return 'azdevops-cli:' + normalize_url_for_key(organization)
  File "C:\Users\chkuech\.azure\cliextensions\azure-devops\azext_devops\dev\common\_credentials.py", line 85, in normalize_url_for_key
    organization_name = organization_name.split('/')[1]
IndexError: list index out of range

To open an issue, please visit: https://aka.ms/azcli/ext/issues
Read more comments on GitHub >

github_iconTop Results From Across the Web

java - Which exception to throw for invalid input which is valid ...
The question is is throwing illegal argument exception the right thing to do? It depends on how you want / need to "frame"...
Read more >
CWE-20: Improper Input Validation (4.9) - MITRE
The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required...
Read more >
Email Distribution Error Messages - Qualtrics
Qualtrics has built in messages to let you know what you need to do to ... getting an error message that says my...
Read more >
Video: Input and error messages - Microsoft Support
Input and error messages · Select the cells that you want to create a message for, and click Data Validation. · On the...
Read more >
How to Fix a 400 Bad Request Error (Causes and Fixes) - Kinsta
The 400 Bad Request error indicates that the server cannot or process the request due to a client error. Read about the common...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found