Skip to content

az login throws an error: json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) #23805

@Yakuza-UA

Description

@Yakuza-UA

This is autogenerated. Please review and update as needed.

Describe the bug

az login --use-device-code throws an error after timeout. Once executed it halts for a while with no visible progress, then exists with the error below.

Command Name
az login

Errors:

The command failed with an unexpected error. Here is the traceback:
Expecting value: line 1 column 1 (char 0)
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 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/lib/python3.10/site-packages/azure/cli/command_modules/profile/custom.py", line 139, in login
    subscriptions = profile.login(
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/_profile.py", line 152, in login
    user_identity = identity.login_with_device_code(scopes=scopes, **kwargs)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/auth/identity.py", line 148, in login_with_device_code
    flow = self._msal_app.initiate_device_flow(scopes, **kwargs)
  File "/opt/az/lib/python3.10/site-packages/msal/application.py", line 1641, in initiate_device_flow
    flow = self.client.initiate_device_flow(
  File "/opt/az/lib/python3.10/site-packages/msal/oauth2cli/oauth2.py", line 328, in initiate_device_flow
    flow = json.loads(resp.text)
  File "/opt/az/lib/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/opt/az/lib/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/opt/az/lib/python3.10/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

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...
  • az login --use-device-code

Expected Behavior

Environment Summary

Linux-4.15.0-20-generic-x86_64-with-glibc2.27, Ubuntu 18.04.6 LTS
Python 3.10.5
Installer: DEB

azure-cli 2.40.0

Extensions:
azure-firewall 0.14.1

Dependencies:
msal 1.18.0b1
azure-mgmt-resource 21.1.0b1

Additional Context

Metadata

Metadata

Assignees

Labels

Accountaz login/accountAuto-AssignAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamOKR CandidateThis label is used to track how many GitHub issues we have resolved for OKR purpose.customer-reportedIssues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions