I now get this error after upgrading to 2.0.63-1 on Ubuntu 19.04 installed via apt using disco repository:
/opt/az/lib/python3.6/site-packages/requests/__init__.py:91: RequestsDependencyWarning: urllib3 (1.25.2) or chardet (3.0.4) doesn't match a supported version!
RequestsDependencyWarning)
I am able to perform the first couple of basic queries that I could think of without issue. However I get this error every time.
Related to https://github.com/kennethreitz/requests/pull/5063
Looks like all we need to do is pin urllib3 to a version that requests finds acceptable. I'm going to try to sneak this into the 2.0.64 release before //build. At the moment this is only impacting Ubunutu:Disco users, but if 2.0.64 were to go out this would repro everywhere.
@marstr you mentioned that this only impacts Ubuntu:Disco users, but I can confirm it is an issue on the latest version of MacOS. An excerpt from my install logs below for your reference:
$ curl -L https://aka.ms/InstallAzureCli | bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 1369 100 1369 0 0 982 0 0:00:01 0:00:01 --:--:-- 1631
Downloading Azure CLI install script from https://azurecliprod.blob.core.windows.net/install.py to /var/folders/bl/hqlkvbvd075cvghtcv1vfvtc0000gn/T/azure_cli_install_tmp_XXXXXX.Wcqm4H2f.
######################################################################## 100.0%
/var/folders/bl/hqlkvbvd075cvghtcv1vfvtc0000gn/T/azure_cli_install_tmp_XXXXXX.Wcqm4H2f: OK
Running install script.
-- Verifying Python version.
-- Python version 2.7.10 okay.
... snip ...
Successfully built vsts-cd-manager azure-functions-devops-build sshtunnel pyyaml psutil tabulate pyperclip antlr4-python2-runtime vsts pycparser scandir
ERROR: requests 2.21.0 has requirement urllib3<1.25,>=1.21.1, but you'll have urllib3 1.25.2 which is incompatible.
ERROR: azure-cli-appservice 0.2.18 has requirement cryptography<2.5, but you'll have cryptography 2.6.1 which is incompatible.
... snip ...
Using cached https://files.pythonhosted.org/packages/a1/6e/464d039ec6184234b188d6a9d199e658cce86b38afe4db0e8edd1629f3f6/azure_mgmt_nspkg-3.0.2-py2-none-any.whl
ERROR: azure-cli-appservice 0.2.18 has requirement cryptography<2.5, but you'll have cryptography 2.6.1 which is incompatible.
Installing collected packages: azure-nspkg, azure-mgmt-nspkg
Also, the warning when attempting az login
:
$ az login
/Users/me/lib/azure-cli/lib/python2.7/site-packages/requests/__init__.py:91: RequestsDependencyWarning: urllib3 (1.25.2) or chardet (3.0.4) doesn't match a supported version!
RequestsDependencyWarning)
It appears as if I've logged in successfully, but the real issue is apparent when I attempt to terraform plan
:
$ tf plan -var-file=environment/dev.tfvars
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.
------------------------------------------------------------------------
Error: Error running plan: 1 error(s) occurred:
* provider.azurerm: Error obtaining Authorization Token from the Azure CLI: Error retrieving access token from Azure CLI: /Users/me/lib/azure-cli/lib/python2.7/site-packages/requests/__init__.py:91: RequestsDependencyWarning: urllib3 (1.25.2) or chardet (3.0.4) doesn't match a supported version!
RequestsDependencyWarning)
@marstr I can confirm it is an issue on script installs in several Ubuntu variants, not just a packaged Disco variant. We run a 60 day patching schedule on our tooling automation and ran into this issue.
Successfully built psutil tabulate pyyaml antlr4-python3-runtime pyperclip pydocumentdb vsts-cd-manager sshtunnel pycparser
ERROR: requests 2.21.0 has requirement urllib3<1.25,>=1.21.1, but you'll have urllib3 1.25.2 which is incompatible.
Installing collected packages: six, isodate, idna, pycparser, cffi, asn1crypto, cryptography, pyopenssl, certifi, urllib3
$ az --help
<>/lib/azure-cli/lib/python3.6/site-packages/requests/__init__.py:91: RequestsDependencyWarning: urllib3 (1.25.2) or chardet (3.0.4) doesn't match a supported version!
RequestsDependencyWarning)
pip install requests
when I reinstall requests this problem solved
Thanks for chiming in and alerting me to the broader nature of this problem @nagytech and @codyrat. This brings attention to a longstanding problem that we have: We attempt to support people running pip install azure-cli
outside of a virtualenv without unduly munging any existing version of a dependency we require.
Some of our install mechanism will not feel the effect of this, as we lock or vendor our dependencies. For example, this should not repro for people using brew
on MacOS or installing on Windows with out MSI. However, this issue is doing a great job of demonstrating the need for all of our installers to lock our dependencies.
As @2i18ns points out, the work around for people experiencing this issue is to reinstall requests in the Python environment that hosts your CLI install. The mechanism of doing that will vary depending on how you installed. The solution to this problem, which will easily be done in tandem with #8592, is to lock our dependencies across all of our recommended installers.
In Windows
edit "_ _ init _ _.py" file
C:\Users\XXXXXXXXXX\AppData\Local\Programs\Python\Python37\Lib\site-packages\requests
line 63 and change minor value from 24 to 25
assert minor <= 25
pip install requests
when I reinstall requests this problem solved
Thank you for the tip. Is working!
With the new requirements.txt files in place, this category of issues should fall away! At very least, the levers we need to pull are simpler. I'm going to close this issue out as resolved.
Most helpful comment
when I reinstall requests this problem solved