Root cause analysis and Woraround for "Error: AttributeError: type object 'Retry' has no attribute 'DEFAULT_METHOD_WHITELIST'&quo...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2023 07:05 AM
Root cause analysis and Woraround for "Error: AttributeError: type object 'Retry' has no attribute 'DEFAULT_METHOD_WHITELIST'"
---------------------------------------------
Problem
- When using databricks-cli, starting with 4th of May this error occurs:
- Error: AttributeError: type object 'Retry' has no attribute 'DEFAULT_METHOD_WHITELIST'
- databricks-cli exits and returns an error
---------------------------------------------
Root cause analysis
databricks-cli depends on requests>=2.17.3
requests depends on urllib3<1.27,>=1.21.1
Collecting urllib3<3,>=1.21.1 (from requests>=2.17.3->databricks-cli)
Downloading urllib3-2.0.2-py3-none-any.whl (123 kB)
Before 4th of May 2023:
Downloading urllib3-1.26.15-py2.py3-none-any.whl (140 kB)
-> There is a new(er) release of urllib3
In urllib3 - 2.0.0 (2023-04-26) we can see:
"...Removed deprecated Retry options method_whitelist, DEFAULT_REDIRECT_HEADERS_BLACKLIST (#2086)..."
And this is causing the error Error: AttributeError: type object 'Retry' has no attribute 'DEFAULT_METHOD_WHITELIST'
---------------------------------------------
Workarounds
Two possible workarounds available until now found:
- No. 1
- add urllib3==1.26.15 to requirements.txt
- No. 2
pip install -U databricks-cli
pip uninstall -y urllib3
pip install urllib3==1.26.15
---------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2023 11:28 PM
Pinning the urllib3 version to "1.26.15" should work fine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2023 05:10 AM
Sure.
That's exactly what I wrote in "Workarounds" 😉
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2023 06:24 AM
For what its worth I can confirm the pinning works. I also pinned the requests package. See my details here as I am using pipelines to handle deployment. I've back linked this issue on the databricks website to this item as well.

