Skip to content

Az identity component not parsing null expiresOn in token  #4076

@hendrytl

Description

@hendrytl

This is autogenerated. Please review and update as needed.

Describe the bug

Either expiresOn is no longer populated when using Azure Cloud Shell, or the component below is not handling null correctly any longer.

This worked on 11/2.
Command Name
az ml endpoint list Extension Name: ml. Version: 0.0.8.

Errors:

The command failed with an unexpected error. Here is the traceback:
strptime() argument 1 must be str, not None
Traceback (most recent call last):
  File "/opt/az/lib/python3.6/site-packages/knack/cli.py", line 231, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 657, in execute
    raise ex
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 720, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 704, in _run_job
    result = list(result)
  File "/opt/az/lib/python3.6/site-packages/azure/core/paging.py", line 129, in __next__
    return next(self._page_iterator)
  File "/opt/az/lib/python3.6/site-packages/azure/core/paging.py", line 76, in __next__
    self._response = self._get_next(self.continuation_token)
  File "/home/todd/.azure/cliextensions/ml/azure/ml/_restclient/machinelearningservices/operations/_online_endpoints_operations.py", line 155, in get_next
    pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
  File "/opt/az/lib/python3.6/site-packages/azure/core/pipeline/_base.py", line 211, in run
    return first_node.send(pipeline_request)  # type: ignore
  File "/opt/az/lib/python3.6/site-packages/azure/core/pipeline/_base.py", line 71, in send
    response = self.next.send(request)
  File "/opt/az/lib/python3.6/site-packages/azure/core/pipeline/_base.py", line 71, in send
    response = self.next.send(request)
  File "/opt/az/lib/python3.6/site-packages/azure/core/pipeline/_base.py", line 71, in send
    response = self.next.send(request)
  [Previous line repeated 2 more times]
  File "/opt/az/lib/python3.6/site-packages/azure/mgmt/core/policies/_base.py", line 47, in send
    response = self.next.send(request)
  File "/opt/az/lib/python3.6/site-packages/azure/core/pipeline/policies/_redirect.py", line 158, in send
    response = self.next.send(request)
  File "/opt/az/lib/python3.6/site-packages/azure/core/pipeline/policies/_retry.py", line 445, in send
    response = self.next.send(request)
  File "/opt/az/lib/python3.6/site-packages/azure/core/pipeline/policies/_authentication.py", line 117, in send
    self.on_request(request)
  File "/opt/az/lib/python3.6/site-packages/azure/core/pipeline/policies/_authentication.py", line 94, in on_request
    self._token = self._credential.get_token(*self._scopes)
  File "/opt/az/lib/python3.6/site-packages/azure/identity/_internal/decorators.py", line 27, in wrapper
    token = fn(*args, **kwargs)
  File "/opt/az/lib/python3.6/site-packages/azure/identity/_credentials/azure_cli.py", line 59, in get_token
    token = parse_token(output)
  File "/opt/az/lib/python3.6/site-packages/azure/identity/_credentials/azure_cli.py", line 75, in parse_token
    dt = datetime.strptime(token["expiresOn"], "%Y-%m-%d %H:%M:%S.%f")
TypeError: strptime() argument 1 must be str, not None

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • Put any pre-requisite steps here...
  • Use azure cloud shell
  • az ml endpoint list

Expected Behavior

Environment Summary

Linux-5.4.0-1062-azure-x86_64-with-debian-10.2 (Cloud Shell), Common Base Linux Delridge (quinault)
Python 3.6.10
Installer: DEB

azure-cli 2.30.0

Extensions:
ml 0.0.8
ai-examples 0.2.5
ssh 0.1.8

Additional Context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions