Skip to content

[BUG] pkg_resources.DistributionNotFound: The 'urllib3<1.24,>=1.21.1' when python3-urllib3-0:1.25 is installed #59982

Closed

Description

@jamesbernardi

Description
Amazon Linux has updated the python3-urllib3 to 1.25 - this is causing all salt versions to fail after a yum update

Steps to Reproduce the behavior
yum update with python3-urllib3-0:1.25 - any salt version

Versions Report
all salt 300x.x versions

Additional context
work around - lock yum to version python3-urllib3-0:1.23-6.amzn2.noarch
ie:
sudo salt * pkg.install yum-versionlock
sudo salt * cmd.run 'yum versionlock add python3-urllib3-0:1.23-6.amzn2.noarch'

Activity

  1. added
    bug
    on Apr 7, 2021
  2. added
    Packaging
    on Apr 7, 2021
  3. bryceml commented on Apr 7, 2021

    @bryceml
    Contributor

    Looks like I will need to update the python3-requests package and add a python3-certifi package.

  4. added this to the Aluminium milestone on Apr 9, 2021
  5. myii commented on Apr 20, 2021

    @myii
    Contributor

    Been facing verification failures (testing any salt-call command) on the salt-image-builder repo related to this. Will apply the workaround for the time being (thanks for sharing that, @jamesbernardi). Just out of interest, it doesn't affect all of our builds:

    # These work fine and don't require the workaround
    amaz-02.0-tiamat-py3: stable tiamat
    amaz-02.0-master-py3: git    master
    
    # These do
    amaz-02.0-3003.0-py3: stable 3003.0
    amaz-02.0-3002.6-py3: stable 3002.6
    amaz-02.0-3001.7-py3: stable 3001.7
    amaz-02.0-3000.9-py3: stable 3000.9
    
  6. icycle77 commented on Apr 27, 2021

    @icycle77

    I'm also seeing another package conflict after running the suggested workaround and trying to do a yum update:

    To repro, start with a pure, latest Amzn Linux 2 AMI, ran the following commands

    sudo yum install -y yum-versionlock
    sudo rpm --import https://repo.saltproject.io/py3/amazon/2/x86_64/3003/SALTSTACK-GPG-KEY.pub
    curl -fsSL https://repo.saltproject.io/py3/amazon/2/x86_64/3003.repo | sudo tee /etc/yum.repos.d/salt-3003-repo.repo
    sudo yum versionlock add python3-urllib3-0:1.23-6.amzn2.noarch
    curl -o bootstrap-salt.sh -L https://bootstrap.saltproject.io
    sh bootstrap-salt.sh  -x python3 stable
    yum update
    

    The yum update produces:

    # yum update
    Loaded plugins: extras_suggestions, langpacks, priorities, update-motd, versionlock
    Resolving Dependencies
    --> Running transaction check
    ---> Package amazon-ssm-agent.x86_64 0:3.0.161.0-1.amzn2 will be updated
    ---> Package amazon-ssm-agent.x86_64 0:3.0.529.0-1.amzn2 will be an update
    ---> Package aws-cfn-bootstrap.noarch 0:1.4-34.amzn2 will be updated
    ---> Package aws-cfn-bootstrap.noarch 0:2.0-6.amzn2 will be an update
    --> Processing Dependency: python3-pystache for package: aws-cfn-bootstrap-2.0-6.amzn2.noarch
    --> Processing Dependency: python3-daemon for package: aws-cfn-bootstrap-2.0-6.amzn2.noarch
    ---> Package ec2-instance-connect.noarch 0:1.1-13.amzn2 will be updated
    ---> Package ec2-instance-connect.noarch 0:1.1-14.amzn2 will be an update
    ---> Package ec2-net-utils.noarch 0:1.4-43.amzn2 will be obsoleted
    ---> Package ec2-net-utils.noarch 0:1.5-2.amzn2 will be obsoleting
    ---> Package glibc.x86_64 0:2.26-43.amzn2 will be updated
    ---> Package glibc.x86_64 0:2.26-44.amzn2 will be an update
    ---> Package glibc-all-langpacks.x86_64 0:2.26-43.amzn2 will be updated
    ---> Package glibc-all-langpacks.x86_64 0:2.26-44.amzn2 will be an update
    ---> Package glibc-common.x86_64 0:2.26-43.amzn2 will be updated
    ---> Package glibc-common.x86_64 0:2.26-44.amzn2 will be an update
    ---> Package glibc-locale-source.x86_64 0:2.26-43.amzn2 will be updated
    ---> Package glibc-locale-source.x86_64 0:2.26-44.amzn2 will be an update
    ---> Package glibc-minimal-langpack.x86_64 0:2.26-43.amzn2 will be updated
    ---> Package glibc-minimal-langpack.x86_64 0:2.26-44.amzn2 will be an update
    ---> Package irqbalance.x86_64 2:1.5.0-4.amzn2.0.1 will be updated
    ---> Package irqbalance.x86_64 2:1.7.0-4.amzn2.0.1 will be an update
    ---> Package kernel.x86_64 0:4.14.231-173.360.amzn2 will be installed
    ---> Package libcrypt.x86_64 0:2.26-43.amzn2 will be updated
    ---> Package libcrypt.x86_64 0:2.26-44.amzn2 will be an update
    ---> Package openssh.x86_64 0:7.4p1-21.amzn2.0.1 will be updated
    ---> Package openssh.x86_64 0:7.4p1-21.amzn2.0.3 will be an update
    ---> Package openssh-clients.x86_64 0:7.4p1-21.amzn2.0.1 will be updated
    ---> Package openssh-clients.x86_64 0:7.4p1-21.amzn2.0.3 will be an update
    ---> Package openssh-server.x86_64 0:7.4p1-21.amzn2.0.1 will be updated
    ---> Package openssh-server.x86_64 0:7.4p1-21.amzn2.0.3 will be an update
    ---> Package python3-psutil.x86_64 0:5.4.3-9.amzn2 will be updated
    --> Processing Dependency: python37-psutil for package: salt-3003-1.amzn2.noarch
    ---> Package python3-psutil.x86_64 0:5.6.7-1.amzn2.0.2 will be an update
    --> Running transaction check
    ---> Package python3-daemon.noarch 0:2.2.3-8.amzn2.0.2 will be installed
    --> Processing Dependency: python3-lockfile for package: python3-daemon-2.2.3-8.amzn2.0.2.noarch
    --> Processing Dependency: python3-docutils for package: python3-daemon-2.2.3-8.amzn2.0.2.noarch
    ---> Package python3-psutil.x86_64 0:5.4.3-9.amzn2 will be updated
    --> Processing Dependency: python37-psutil for package: salt-3003-1.amzn2.noarch
    ---> Package python3-pystache.noarch 0:0.5.4-12.amzn2.0.1 will be installed
    --> Processing Dependency: python3-simplejson for package: python3-pystache-0.5.4-12.amzn2.0.1.noarch
    --> Running transaction check
    ---> Package python3-docutils.noarch 0:0.14-1.amzn2.0.2 will be installed
    ---> Package python3-lockfile.noarch 1:0.11.0-17.amzn2.0.2 will be installed
    ---> Package python3-psutil.x86_64 0:5.4.3-9.amzn2 will be updated
    --> Processing Dependency: python37-psutil for package: salt-3003-1.amzn2.noarch
    ---> Package python3-simplejson.x86_64 0:3.16.0-3.amzn2 will be installed
    --> Finished Dependency Resolution
    Error: Package: salt-3003-1.amzn2.noarch (@salt-3003-repo)
               Requires: python37-psutil
               Removing: python3-psutil-5.4.3-9.amzn2.x86_64 (@salt-3003-repo)
                   python37-psutil = 5.4.3-9.amzn2
               Updated By: python3-psutil-5.6.7-1.amzn2.0.2.x86_64 (amzn2-core)
                  ~python3-psutil = 5.6.7-1.amzn2.0.2
     You could try using --skip-broken to work around the problem
     You could try running: rpm -Va --nofiles --nodigest
    

    Adding a version lock for python3-psutil works around this issue as well:

    sudo yum versionlock add python3-psutil-5.4.3-9.amzn2.x86_64
    

    and allows the yum update to complete successfully:

    Install   2 Packages (+5 Dependent packages)
    Upgrade  13 Packages
    
  7. bryceml commented on May 26, 2021

    @bryceml
    Contributor

    For the 3003.1 release we're no longer providing python3-reqeusts or python3-urllib3 from the salt repos as amazonlinux 2 provides those now. It is preferable to downgrade python3-requests rather than python3-urllib3 going forward for salt 3003 or older so that a future upgrade goes smoothly.

    yum versionlock add python3-requests-2.14.2-2.amzn2.0.2.noarch
    

    If you don't want to do pinning, you can just yum downgrade python3-requests after upgrading to salt version 3003.1 or newer.

    3003.1 and forward should work installing fresh out of the box without any pinning.

    Also, because amazon now provides dependencies for python3-psutil you now must

    yum install python3-psutil
    

    before installing salt if you have epel enabled. This is an issue between epel and the amazonlinux 2 repos in general and is an upstream issue we can't really fix properly. It's something either amazon or epel will have to fix.

  8. added
    Aluminium
    on May 26, 2021
  9. ring-pete commented on Jun 5, 2021

    @ring-pete

    Hey there - when I checked the release notes for salt-3003.1* I didn't see a mention of this fix. I also notice the Latest** yum repo also still contains python3-requests, so I assume work is still underway to get this fix pushed out. Will the Latest repo pickup these changes once they are released?
    Thanks!

    *https://docs.saltproject.io/en/master/topics/releases/3003.1.html
    **https://repo.saltproject.io/py3/amazon/2/x86_64/latest/

  10. bryceml commented on Jun 7, 2021

    @bryceml
    Contributor

    Yes, latest will pick up those changes when 3003.1 is released since latest is a symlink to whatever the latest release is.

    3003.1 isn't tagged yet. @sagetherage should we throw that in the release notes before we tag? https://github.com/saltstack/salt-pack-py3/commit/c2c71c8b9cf33a9cf7360ec72e12c532d1a64adf is the commit associated with the dependency fixes on amazon linux 2.

  11. 8 remaining items

  12. bryceml commented on Jun 23, 2021

    @bryceml
    Contributor

    3003.1 has been released, closing issue.

  13. myii commented on Jun 23, 2021

    @myii
    Contributor

    Thanks, the fix is working fine for 3003.1.

    Just mentioning -- for our image builder, we still need to keep the workaround for versions less than that, such as 3002.6, 3001.7 and 3000.9.

  14. bryceml commented on Jun 23, 2021

    @bryceml
    Contributor

    with some quick testing, it appears that setting priority=20 rather than priority=10 in the .repo file before install fixes it for old versions like 3000.9, 3001.7, 3002.6. It would mean it would always prefer amazon's packages instead of ours if both exist for a given package.

    we would just have to change the .repo files on repo.saltproject.io and change the template in the bootstrap script.

    @dmurphy18 thoughts on doing that? would there be any downsides? wondering what would be better if amazon releases more python dependencies in the future.

  15. dmurphy18 commented on Jun 23, 2021

    @dmurphy18
    Contributor

    I would think favor theirs since they have an interest in keeping things up to date, and also tend to roll out new stuff. Problem I see, is if we have to make a fix for something which their version will override.

  16. bryceml commented on Jun 24, 2021

    @bryceml
    Contributor

    it appears doing priority=20 would also result in older packages of some of them:

    python3-coverage 3.6 instead of 4.5.1
    python3-jinja2 2.7.2 instead of 2.10
    python3-markupsafe 0.11 instead of 1.0
    python3-py 1.4.32 instead of 1.5.4
    python3-pycurl 7.43.0 instead of 7.43.0.2
    python3-pytest 2.9.2 instead of 3.6.4
    python3-simplejson 3.2.0 instead of 3.16.0
    

    it appears only python3-jinja2, python3-markupsafe, and python3-pycurl get installed with a yum install salt-*

    We should find out if an older version of any of these poses a problem.

  17. bryceml commented on Jun 25, 2021

    @bryceml
    Contributor

    Looks like at a minimum, we need a newer version of python3-markupsafe based on some tests with those requirements. We therefore can't change the priority as we would break stuff in salt.

    I've tested, and everything seems to work fine if I just delete the python3-requests from the old repos. I'll make that change, and let @frogunder test it, if he gives the go ahead, we can push that out, probably next week if all goes well.

  18. bryceml commented on Jun 30, 2021

    @bryceml
    Contributor

    @myii We've updated the repos for 3000.9, 3001.7, and 3002.6 so this should be fixed for those as well now.

  19. myii commented on Jun 30, 2021

    @myii
    Contributor

    @myii We've updated the repos for 3000.9, 3001.7, and 3002.6 so this should be fixed for those as well now.

    @bryceml Thanks for the heads-up. Just tried it out and it's looking good:

    Will merge that in to that repo shortly.

  20. added a commit that references this issue on Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

AluminiumPackagingbugpoint-release

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions