question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Homebrew Installed Azure CLI not working - ValueError: field 6 out of range (need a 48-bit value)

See original GitHub issue

Having 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:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
lordgordoncommented, Feb 21, 2018

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.

  1. download the patched uuid.py from the approved PR: https://raw.githubusercontent.com/bbayles/cpython/d4b98dff3441c79fb7c2af9149b96f819d0c81ab/Lib/uuid.py
  2. go to the proper library folder for your Python 3.6.4 installation. In my case is /usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6;
  3. make a copy of uuid.py: cp uuid.py uuid.py.orig;
  4. substitute the file with the one download: cp /your/download/path/uuid.py ./uuid.py;
  5. profit (az login and other az should now works as expected).
1reaction
derekbekoecommented, Feb 22, 2018

Created a PR that will switch to uuid4 if uuid1 raises the ValueError.

Read more comments on GitHub >

github_iconTop Results From Across the Web

opal-azure-cli 2.0.70 - PyPI
Microsoft Azure Command-Line Tools. ... pip install opal-azure-cli ... Bug fix for 'ValueError: field 6 out of range (need a 48-bit value)' ...
Read more >
Install the Azure CLI on macOS - Microsoft Learn
Learn how to install and run the Azure CLI on macOS using the homebrew package manager. The Azure CLI has been tested on...
Read more >
Install azure cli via brew not working on mac m1 - Stack Overflow
After trying many thing things this worked for me... rm -rf $(brew --repo homebrew/core) brew tap homebrew/core.
Read more >
azure-cli - Homebrew Formulae
azure -cli. Install command: brew install azure-cli. Also known as: az. Microsoft Azure CLI 2.0. https://docs.microsoft.com/cli/azure/overview.
Read more >
Errors using azcopy and azure-cli to copy files ... - Mark Powney
I've been working with an Azure Storage Account to host a static website (this blog) and am interested in implementing an upload process ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found