Stein CentOS 7 undercloud emits warning: "RequestsDependencyWarning: urllib3 (1.24.1) or chardet (2.2.1) doesn't match a supported version!"

Bug #1829263 reported by Tal Liron
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
In Progress
Medium
yatin

Bug Description

Running "openstack" command will always emit this warning:

   RequestsDependencyWarning: urllib3 (1.24.1) or chardet (2.2.1) doesn't match a supported version!

This comes from package "python2-requests" (from delorean-stein-testing repo):

   /usr/lib/python2.7/site-packages/requests/__init__.py

Which checks for:

   urllib3 >= 1.21.1, <= 1.24, chardet >= 3.0.2, < 3.1.0

The problem is that package "python-chardet" (from base repo, version 2.2.1) is installed instead of "python2-chardet" (from delorean-stein-testing repo, version 3.0.4).

The quick workaround is "yum install python2-chardet" (will replace python-chardet), but I think the dependency should be fixed in the repo.

description: updated
Revision history for this message
Rafael Folco (rafaelfolco) wrote :

please attach some logs or link to the logs. Thanks.

Revision history for this message
Tal Liron (emblem-parade) wrote :
Download full text (3.6 KiB)

I had to rebuild the undercloud for you. :)

[stack@tripleo ~]$ cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)

[stack@tripleo ~]$ openstack
/usr/lib/python2.7/site-packages/requests/__init__.py:91: RequestsDependencyWarning: urllib3 (1.24.1) or chardet (2.2.1) doesn't match a supported version!
  RequestsDependencyWarning)
(openstack) exit

[stack@tripleo ~]$ sudo yum install --assumeyes python2-chardet
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile
 * base: mirror.genesisadaptive.com
 * extras: mirror.genesisadaptive.com
 * updates: mirror.genesisadaptive.com
2 packages excluded due to repository priority protections
Resolving Dependencies
--> Running transaction check
---> Package python-chardet.noarch 0:2.2.1-1.el7_1 will be obsoleted
---> Package python2-chardet.noarch 0:3.0.4-7.el7 will be obsoleting
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================================================================================================
 Package Arch Version Repository Size
========================================================================================================================================================================================================
Installing:
 python2-chardet noarch 3.0.4-7.el7 delorean-stein-testing 185 k
     replacing python-chardet.noarch 2.2.1-1.el7_1

Transaction Summary
========================================================================================================================================================================================================
Install 1 Package

Total download size: 185 k
Downloading packages:
python2-chardet-3.0.4-7.el7.noarch.rpm | 185 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : python2-chardet-3.0.4-7.el7.noarch 1/2
  Erasing : python-chardet-2.2.1-1.el7_1.noarch 2/2
  Verifying : python2-chardet-3.0.4-7.el7.noarch 1/2
  Verifying : python-chardet-2.2.1-1.el7_1.noarch 2/2

Installe...

Read more...

Changed in tripleo:
status: New → Confirmed
importance: Undecided → High
importance: High → Medium
Changed in tripleo:
assignee: nobody → yatin (yatinkarel)
Revision history for this message
yatin (yatinkarel) wrote :

So the issue is with python-requests package, it doesn't impose minimum requirement for chardet and urllib3[1], so if these deps are installed before installing python-requests package, installing python-requests will not get these deps updated. I have proposed a PR[2] to add minimum requirement for urllib3 and chardet package in Fedora python-requests package. Will also get it updated in RDO's requests package[3] as we Fork and build it for CentOS.

Some other things that i explored:-
In TripleO CI we do not see this issue because there "yum update -y" is executed[4] which gets python-chardet updated before installing undercloud. I guess Tal Liron has installed undercloud manually by using steps similar to https://docs.openstack.org/tripleo-docs/latest/install/installation/installing.html, i don't see yum update step in the installation guide. Anyway imho this should be handled in requests package as it imposes minumum requirement to those deps.

[1] https://src.fedoraproject.org/rpms/python-requests/blob/master/f/python-requests.spec#_66
[2] https://src.fedoraproject.org/rpms/python-requests/pull-request/4
[3] https://github.com/rdo-common/python-requests/blob/stein-rdo/python-requests.spec#L65-L66
[4] https://github.com/rdo-common/python-requests/blob/stein-rdo/python-requests.spec#L65-L66

Revision history for this message
Tal Liron (emblem-parade) wrote :

yatin, you are correct that I installed "manually". However, I also did a "yum update" before installing. So perhaps I have a different set of repositories than you. I would be happy to send you anything you need to help you understand my environment. Basically, I started with the latest CentOS 7 minimal image and added EPEL and the TripleO repositories. If there's something I can do to simulate your proposed fix we can test that it actually works, because if you assume I did not do a "yum update" then that is incorrect.

It's generally unfortunate that CI doesn't follow the actual documentation for installation. ;)

Revision history for this message
yatin (yatinkarel) wrote :

@Tal, so yum update is required after setting up TripleO repos to workaround the issue, if you had ran yum update after setting up TripleO repos(sudo -E tripleo-repos -b stein current), then u should not have faced that issue.

Revision history for this message
yatin (yatinkarel) wrote :

Updated python-requests package in RDO with [1], adding new build to Stein and Train testing repos with [2].

[1] https://github.com/rdo-common/python-requests/commit/e9830cb
[2] https://review.rdoproject.org/r/#/c/21096/

Changed in tripleo:
status: Confirmed → In Progress
Revision history for this message
Tal Liron (emblem-parade) wrote :

@yatin, please see my reply. I do a full upgrade. Snippet from my script to prove it:

 sudo tripleo-repos \
  -b stein \
  -d centos7 \
  current ceph

 sudo yum upgrade --assumeyes

 # "python2-chardet" is workaround for: https://bugs.launchpad.net/tripleo/+bug/1829263
 sudo yum install --assumeyes \
  python2-tripleoclient python2-chardet \
  ceph-ansible

Revision history for this message
yatin (yatinkarel) wrote :

<<< sudo yum upgrade --assumeyes
so at this stage python-chardet should be updated to version provided by stein(assuming python-chardet is already installed from base, rpm -qa|grep chardet), if not can u share complete output of below command.
rpm -qa|grep chardet
sudo yum repolist
sudo yum upgrade --assumeyes

 # "python2-chardet" is workaround for: https://bugs.launchpad.net/tripleo/+bug/1829263
 sudo yum install --assumeyes \
  python2-tripleoclient python2-chardet \
  ceph-ansible

Revision history for this message
Alfredo Moralejo (amoralej) wrote :

"Basically, I started with the latest CentOS 7 minimal image and added EPEL and the TripleO repositories"

AFAIK, EPEL should not be needed and in fact there may be incompatibilities with RDO, does the tripleo doc ask to enable EPEL?

Revision history for this message
Tal Liron (emblem-parade) wrote :

My mistake, EPEL was not added in my case. The snippet above is exact. If you remove the installation of "python2-chardet" then the bug appears.

Revision history for this message
yatin (yatinkarel) wrote :

python2-requests fixed build is now available in stein-testing repo:- https://trunk.rdoproject.org/centos7-stein/deps/latest/noarch/python2-requests-2.21.0-3.el7.noarch.rpm, @Tal can u check now if it fixes the issue u reported.

Revision history for this message
Tal Liron (emblem-parade) wrote :

Thanks, I rebuilt the undercloud and it looks like the issue is gone. And it seems to be using your fix:

sudo yum info python2-requests
...
2 packages excluded due to repository priority protections
Installed Packages
Name : python2-requests
Arch : noarch
Version : 2.21.0
Release : 3.el7
Size : 396 k
Repo : installed
From repo : delorean-stein-testing
Summary : HTTP library, written in Python, for human beings
URL : https://pypi.io/project/requests
License : ASL 2.0
Description : Most existing Python modules for sending HTTP requests are extremely verbose and
            : cumbersome. Python’s built-in urllib2 module provides most of the HTTP
            : capabilities you should need, but the API is thoroughly broken. This library is
            : designed to make HTTP requests easy for developers.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.