saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Install Salt from the Salt package repositories here:
https://docs.saltproject.io/salt/install-guide/en/latest/
Apache License 2.0
14.18k stars 5.48k forks source link

[BUG] RH7/CentOS7 repo for 3002.6 has broken dependencies - cannot install #59887

Closed dfidler closed 3 years ago

dfidler commented 3 years ago

Description

The salt-minion requires packages named "python3-xyz" but those don't exist in CentOS - they must be "python36-xyz".

Also, I'm getting an error

Setup

I already have 3002.5 installed.

# cat /etc/redhat-release
CentOS Linux release 7.7.1908 (Core)
# cat /etc/yum.repos.d/salt.repo
[salt-latest-repo]
name=Salt repo for RHEL/CentOS 7 PY3
baseurl=https://repo.saltproject.io/py3/redhat/7/x86_64/latest
skip_if_unavailable=True
failovermethod=priority
enabled=1
enabled_metadata=1
gpgcheck=1
gpgkey=https://repo.saltproject.io/py3/redhat/7/x86_64/latest/SALTSTACK-GPG-KEY.pub, https://repo.saltproject.io/py3/redhat/7/x86_64/latest/base/RPM-GPG-KEY-CentOS-7

Steps to Reproduce the behavior

# yum install salt-minion
....
---> Package salt-master.noarch 0:3002.6-1.el8 will be an update
--> Processing Dependency: python3-systemd for package: salt-master-3002.6-1.el8.noarch
--> Finished Dependency Resolution
Error: Package: salt-3002.6-1.el8.noarch (salt-latest-repo)
           Requires: python3-jinja2
Error: Package: salt-3002.6-1.el8.noarch (salt-latest-repo)
           Requires: python3-six
Error: Package: salt-3002.6-1.el8.noarch (salt-latest-repo)
           Requires: python3-markupsafe
Error: Package: salt-master-3002.6-1.el8.noarch (salt-latest-repo)
           Requires: python3-systemd
Error: Package: salt-3002.6-1.el8.noarch (salt-latest-repo)
           Requires: python3-pyyaml
Error: Package: salt-3002.6-1.el8.noarch (salt-latest-repo)
           Requires: python3.6dist(markupsafe)
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
# yum install salt-minion --skip-broken
.....
--> Processing Dependency: python3-jinja2 for package: salt-3002.6-1.el8.noarch
--> Processing Dependency: python3-markupsafe for package: salt-3002.6-1.el8.noarch
--> Processing Dependency: python3-pyyaml for package: salt-3002.6-1.el8.noarch
--> Processing Dependency: python3-six for package: salt-3002.6-1.el8.noarch
--> Processing Dependency: python3.6dist(markupsafe) for package: salt-3002.6-1.el8.noarch
---> Package salt-master.noarch 0:3002.6-1.el8 will be an update
--> Processing Dependency: python3-systemd for package: salt-master-3002.6-1.el8.noarch
https://repo.saltproject.io/py3/redhat/7/x86_64/latest/repodata/c0ed73856393dad743a7fd1a56fc28309e9cec242ce74cffdc547e9a7ff44004-filelists.sqlite.bz2: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below wiki article

https://wiki.centos.org/yum-errors

If above article doesn't help to resolve this issue please use https://bugs.centos.org/.

 One of the configured repositories failed (Salt repo for RHEL/CentOS 7 PY3),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Run the command with the repository temporarily disabled
            yum --disablerepo=salt-latest-repo ...

     4. Disable the repository permanently, so yum won't use it by default. Yum
        will then just ignore the repository until you permanently enable it
        again or use --enablerepo for temporary usage:

            yum-config-manager --disable salt-latest-repo
        or
            subscription-manager repos --disable=salt-latest-repo

     5. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=salt-latest-repo.skip_if_unavailable=true

failure: repodata/c0ed73856393dad743a7fd1a56fc28309e9cec242ce74cffdc547e9a7ff44004-filelists.sqlite.bz2 from salt-latest-repo: [Errno 256] No more mirrors to try.
https://repo.saltproject.io/py3/redhat/7/x86_64/latest/repodata/c0ed73856393dad743a7fd1a56fc28309e9cec242ce74cffdc547e9a7ff44004-filelists.sqlite.bz2: [Errno 14] HTTPS Error 404 - Not Found

**Versions Report**

salt --versions-report

Salt Version: Salt: 3002.5

Dependency Versions: cffi: 1.9.1 cherrypy: unknown dateutil: Not Installed docker-py: Not Installed gitdb: 0.6.4 gitpython: 1.0.1 Jinja2: 2.11.1 libgit2: Not Installed M2Crypto: 0.35.2 Mako: Not Installed msgpack: 0.6.2 msgpack-pure: Not Installed mysql-python: Not Installed pycparser: 2.14 pycrypto: Not Installed pycryptodome: 3.10.1 pygit2: Not Installed Python: 3.6.8 (default, Nov 16 2020, 16:55:22) python-gnupg: Not Installed PyYAML: 3.13 PyZMQ: 17.0.0 smmap: 0.9.0 timelib: Not Installed Tornado: 4.5.3 ZMQ: 4.1.4

System Versions: dist: centos 7 Core locale: UTF-8 machine: x86_64 release: 3.10.0-1062.12.1.el7.x86_64 system: Linux version: CentOS Linux 7 Core

bryceml commented 3 years ago

I can't seem to replicate this exactly.

If you are pinned to centos 7.7 (and not 7.8 or later) there was an issue where we provided too new of a version of python36-rpm and it required a version of rpm available in centos 7.8 or newer.

starting with 3003 that will be fixed so that we provide a slightly older version of python36-rpm so that it's compatible automatically with 7.7 and newer without any issues.

based on the file https://repo.saltproject.io/py3/redhat/7/x86_64/latest/repodata/c0ed73856393dad743a7fd1a56fc28309e9cec242ce74cffdc547e9a7ff44004-filelists.sqlite.bz2 404 erroring, it seems you have old or incorrect metadata.

does rm -rf /var/cache/yum or yum makecache and then trying again resolve your issue?

The only place I can find c0ed73856393dad743a7fd1a56fc28309e9cec242ce74cffdc547e9a7ff44004-filelists.sqlite.bz2 is in the centos 8 repos. Did you mis-configure your repo files before this?

https://repo.saltproject.io/py3/redhat/8/x86_64/archive/3002.6/repodata/c0ed73856393dad743a7fd1a56fc28309e9cec242ce74cffdc547e9a7ff44004-filelists.sqlite.bz2
dfidler commented 3 years ago

@bryceml - I honestly don't remember if I'd misconfigured or not - I know I've done it many times before (I do a lot of builds and teardowns and often miss clicking the CentOS7 tab before copy/pasting the content). The install always fails [understandably] and I reconfigure, yum clean all and try again and it usually goes through fine after that.

I first encountered the issue with a customer today, watching them go through it was sure that I stopped them from doing the same thing (i even remember saying, "no, stop, click the centos7"). I thought it was weird and maybe it was their proxy acting up (which, it turned out, it was blocking the download of the metadata files from the repo)

So I tried to repro this in my own lab and hit the above. Either way, I've cleared my yum metadata cache and gone again and it's worked. So I'll chalk this up to a mixture of confirmation bias and early onset Alzheimer's. :(

Either way, I'm sorted now.