Homebrew Installed Azure CLI not working - ValueError: field 6 out of range (need a 48-bit value)
See original GitHub issueHaving installed azure-cli via homebrew I get the following python errors whenever I try and run a command. e.g. if I perform az login, or az --help, or other commands I get the following errors:-
$ az login field 6 out of range (need a 48-bit value) Traceback (most recent call last): File “/usr/local/Cellar/azure-cli/2.0.23/libexec/lib/python3.6/site-packages/azure/cli/main.py”, line 36, in main cmd_result = APPLICATION.execute(args) File “/usr/local/Cellar/azure-cli/2.0.23/libexec/lib/python3.6/site-packages/azure/cli/core/application.py”, line 141, in execute self.refresh_request_id() File “/usr/local/Cellar/azure-cli/2.0.23/libexec/lib/python3.6/site-packages/azure/cli/core/application.py”, line 269, in refresh_request_id self.session[‘headers’][‘x-ms-client-request-id’] = str(uuid.uuid1()) File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/uuid.py”, line 606, in uuid1 clock_seq_hi_variant, clock_seq_low, node), version=1) File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/uuid.py”, line 168, in init raise ValueError(‘field 6 out of range (need a 48-bit value)’) ValueError: field 6 out of range (need a 48-bit value)
Environment summary
Install Method (e.g. pip, interactive script, apt-get, Docker, MSI, edge build) / CLI version (az --version
) / OS version / Shell Type (e.g. bash, cmd.exe, Bash on Windows)
I installed via home-brew, having initially tried to install using the curl method, however this failed to build. The home-brew version installed fine, but just doesn’t work.
$ az --version azure-cli (2.0.23)
acr (2.0.17) acs (2.0.22) advisor (0.1.0) appservice (0.1.22) backup (1.0.3) batch (3.1.7) batchai (0.1.3) billing (0.1.6) cdn (0.0.10) cloud (2.0.10) cognitiveservices (0.1.9) command-modules-nspkg (2.0.1) configure (2.0.12) consumption (0.2.0) container (0.1.15) core (2.0.23) cosmosdb (0.1.15) dla (0.0.15) dls (0.0.18) eventgrid (0.1.5) extension (0.0.6) feedback (2.0.6) find (0.2.7) interactive (0.3.11) iot (0.1.15) keyvault (2.0.15) lab (0.0.13) monitor (0.0.13) network (2.0.19) nspkg (3.0.1) profile (2.0.16) rdbms (0.0.9) redis (0.2.10) reservations (0.1.0) resource (2.0.19) role (2.0.15) servicefabric (0.0.7) sql (2.0.17) storage (2.0.21) vm (2.0.20)
Python location ‘/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6’ Extensions directory ‘/Users/markread/.azure/cliextensions’
Python (Darwin) 3.6.4 (v3.6.4:d48ecebad5, Dec 18 2017, 21:07:28) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]
Legal docs and information: aka.ms/AzureCliLegal
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:9 (2 by maintainers)
Top GitHub Comments
Currently the upstream Python issue has been fixed and merged (1). Unfortunately a new 3.6 release (3.6.5) is not due until the end of March 2018 (2).
Workaround for Python 3.6.4
A risky workaround is possible manually substituting the
uuid.py
module in your local installation of Python 3.6.4.uuid.py
from the approved PR: https://raw.githubusercontent.com/bbayles/cpython/d4b98dff3441c79fb7c2af9149b96f819d0c81ab/Lib/uuid.py/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6
;uuid.py
:cp uuid.py uuid.py.orig
;cp /your/download/path/uuid.py ./uuid.py
;az login
and otheraz
should now works as expected).Created a PR that will switch to uuid4 if uuid1 raises the ValueError.