Skip to content

az login fails: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa4 in position 0: invalid start byte #7989

@tw0517tw

Description

@tw0517tw

Describe the bug

When I try to az login, azure-cli throws error as below.
My computer name is in Chinese, is this related?

C:\Users\tw0517tw> az login
Exception in thread Thread-1:
Traceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\threading.py", line 916, in _bootstrap_inner
    self.run()
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-e5ce5s7r\azure-cli-core\azure\cli\core\_profile.py", line 1057, in _get_authorization_code_worker
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\socketserver.py", line 453, in __init__
    self.server_bind()
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\http\server.py", line 138, in server_bind
    self.server_name = socket.getfqdn(host)
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\socket.py", line 673, in getfqdn
    hostname, aliases, ipaddrs = gethostbyaddr(name)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa4 in position 0: invalid start byte

Login failed

To Reproduce

Type az login into PowerShell.

Expected behavior

Opens default browser let me login.

Environment summary

Installed using MSI from https://aka.ms/installazurecliwindows
azure-cli (2.0.52)
Windows 10 64bit
PowerShell 6.1.0 64bit

Metadata

Metadata

Assignees

Labels

Accountaz login/account

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions