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

error az consumption usage list #30749

Open
scorpionukr opened this issue Feb 3, 2025 · 4 comments
Open

error az consumption usage list #30749

scorpionukr opened this issue Feb 3, 2025 · 4 comments
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. consumption customer-reported Issues that are reported by GitHub users external to the Azure organization. Service Attention This issue is responsible by Azure service team. Similar-Issue

Comments

@scorpionukr
Copy link

Describe the bug

Command "az consumption usage list" return an error

Related command

az consumption usage list --start-date "2025-02-02T00:00:00Z" --end-date "2025-02-02T23:59:59Z" --output json > usage.json

Errors

ERROR: The command failed with an unexpected error. Here is the traceback:
ERROR: 'usageStart'
Traceback (most recent call last):
  File "/opt/az/lib/python3.12/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 666, in execute
    raise ex
  File "/opt/az/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 734, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 716, in _run_job
    result = list(result)
             ^^^^^^^^^^^^
  File "/opt/az/lib/python3.12/site-packages/azure/cli/core/aaz/_paging.py", line 87, in __next__
    return next(self._page_iterator)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.12/site-packages/azure/cli/core/aaz/_paging.py", line 46, in __next__
    curr_page, self._next_link = self._extract_result()
                                 ^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.12/site-packages/azure/cli/command_modules/consumption/custom.py", line 85, in _output
    result = list([transform_usage_output(item) for item in result])
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.12/site-packages/azure/cli/command_modules/consumption/custom.py", line 95, in transform_usage_output
    usageStart = parser.parse(result['usageStart'])
                              ~~~~~~^^^^^^^^^^^^^^
KeyError: 'usageStart'

Issue script & Debug output

DEBUG: cli.azure.cli.core.azclierror: Traceback (most recent call last):
  File "/opt/az/lib/python3.12/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 666, in execute
    raise ex
  File "/opt/az/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 734, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 716, in _run_job
    result = list(result)
             ^^^^^^^^^^^^
  File "/opt/az/lib/python3.12/site-packages/azure/cli/core/aaz/_paging.py", line 87, in __next__
    return next(self._page_iterator)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.12/site-packages/azure/cli/core/aaz/_paging.py", line 46, in __next__
    curr_page, self._next_link = self._extract_result()
                                 ^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.12/site-packages/azure/cli/command_modules/consumption/custom.py", line 85, in _output
    result = list([transform_usage_output(item) for item in result])
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.12/site-packages/azure/cli/command_modules/consumption/custom.py", line 95, in transform_usage_output
    usageStart = parser.parse(result['usageStart'])
                              ~~~~~~^^^^^^^^^^^^^^
KeyError: 'usageStart'

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: 'usageStart'
Traceback (most recent call last):
  File "/opt/az/lib/python3.12/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 666, in execute
    raise ex
  File "/opt/az/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 734, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 716, in _run_job
    result = list(result)
             ^^^^^^^^^^^^
  File "/opt/az/lib/python3.12/site-packages/azure/cli/core/aaz/_paging.py", line 87, in __next__
    return next(self._page_iterator)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.12/site-packages/azure/cli/core/aaz/_paging.py", line 46, in __next__
    curr_page, self._next_link = self._extract_result()
                                 ^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.12/site-packages/azure/cli/command_modules/consumption/custom.py", line 85, in _output
    result = list([transform_usage_output(item) for item in result])
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.12/site-packages/azure/cli/command_modules/consumption/custom.py", line 95, in transform_usage_output
    usageStart = parser.parse(result['usageStart'])
                              ~~~~~~^^^^^^^^^^^^^^
KeyError: 'usageStart'
ERROR: az_command_data_logger: 'usageStart'
Traceback (most recent call last):
  File "/opt/az/lib/python3.12/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 666, in execute
    raise ex
  File "/opt/az/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 734, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 716, in _run_job
    result = list(result)
             ^^^^^^^^^^^^
  File "/opt/az/lib/python3.12/site-packages/azure/cli/core/aaz/_paging.py", line 87, in __next__
    return next(self._page_iterator)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.12/site-packages/azure/cli/core/aaz/_paging.py", line 46, in __next__
    curr_page, self._next_link = self._extract_result()
                                 ^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.12/site-packages/azure/cli/command_modules/consumption/custom.py", line 85, in _output
    result = list([transform_usage_output(item) for item in result])
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.12/site-packages/azure/cli/command_modules/consumption/custom.py", line 95, in transform_usage_output
    usageStart = parser.parse(result['usageStart'])
                              ~~~~~~^^^^^^^^^^^^^^
KeyError: 'usageStart'
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues
DEBUG: cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x7f69c0b1afc0>]
INFO: az_command_data_logger: exit code: 1
INFO: cli.__main__: Command ran in 5.931 seconds (init: 0.111, invoke: 5.820)
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 7905 in cache file under /root/.azure/telemetry/20250203143000227
INFO: telemetry.main: Begin creating telemetry upload process.
INFO: telemetry.process: Creating upload process: "/opt/az/bin/python3 /opt/az/lib/python3.12/site-packages/azure/cli/telemetry/__init__.py /root/.azure /root/.azure/telemetry/20250203143000227"
INFO: telemetry.process: Return from creating process 4613
INFO: telemetry.main: Finish creating telemetry upload process.

Expected behavior

normal json

Environment Summary

azure-cli 2.68.0

core 2.68.0
telemetry 1.1.0

Extensions:
costmanagement 1.0.0

Dependencies:
msal 1.31.1
azure-mgmt-resource 23.1.1

Python location '/opt/az/bin/python3'
Extensions directory '/root/.azure/cliextensions'

Python (Linux) 3.12.8 (main, Jan 8 2025, 03:38:16) [GCC 13.3.0]

Additional context

No response

@scorpionukr scorpionukr added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Feb 3, 2025
@yonzhan
Copy link
Collaborator

yonzhan commented Feb 3, 2025

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

Copy link

github-actions bot commented Feb 3, 2025

Here are some similar issues that might help you. Please check if they can solve your problem.

@microsoft-github-policy-service microsoft-github-policy-service bot added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Feb 3, 2025
@yonzhan yonzhan added consumption Service Attention This issue is responsible by Azure service team. labels Feb 3, 2025
Copy link
Contributor

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

@nick-crain
Copy link

We're actually coming up on an almost one year anniversary of this bug, and no fix has been issued: #28323

Has development on this module been abandoned?

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

No branches or pull requests

3 participants