jfrog / jfrog-cli

JFrog CLI is a client that provides a simple interface that automates access to the JFrog products.
https://www.jfrog.com/confluence/display/CLI/JFrog+CLI
Apache License 2.0
519 stars 223 forks source link

2.58.1 fails to install on el7 distributions #2571

Closed Stealthii closed 2 weeks ago

Stealthii commented 2 weeks ago

Describe the bug

RPMs from 2.58.1 onwards fail to install on el7 based systems, due to a base docker image change in #2570.

Current behavior

Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
jfrog-cli-2.58.1.x86_64.rpm                                  | 7.7 MB  00:00:04
Running transaction check
ERROR You need to update rpm to handle:
rpmlib(PayloadIsZstd) <= 5.4.18-1 is needed by jfrog-cli-v2-2.58.1-1.x86_64
RPM needs to be updated
 You could try running: rpm -Va --nofiles --nodigest
Your transaction was saved, rerun it with:
 yum load-transaction /tmp/yum_save_tx.2024-06-10.17-37.Qj4kwu.yumtx

Reproduction steps

# On CentOS 7
yum install jfrog-cli-v2-2.58.1-1

Expected behavior

RPMs should be built with the appropriate distribution image, so they are packaged appropriately for the target distro.

JFrog CLI version

2.58.1

Operating system type and version

CentOS 7.9.2009

JFrog Artifactory version

No response

JFrog Xray version

No response

eyalbe4 commented 2 weeks ago

Thanks for reporting this @Stealthii.

See this change we had to make in the Jenkinsfile before the release. We had to replace the docker image the release uses to create JFrog CLI's RPM package. This is because the RPM build process stated failing with the previous image used by the script. I suspect something changed on the RPM public repositories side, but I'm not quite sure what that change was.

If you're experienced with creating RPMs, perhaps you could share some advice that can improve things. From the error you received, it looks like if you update RPM, the issue would be resolved.

Sickafant commented 2 weeks ago

I see the same issue, in my case when doing an "update":

TASK [Updating packages] *******************************************************[0m
Monday 10 June 2024  18:34:08 +0000 (0:00:03.353)       0:00:03.410 ***********[0m
fatal: [default]: FAILED! => changed=true[0m
  changes:[0m
    installed: [][0m
    updated:[0m
    - - jfrog-cli-v2-jf[0m
      - 2.58.0-1.x86_64 from jfrog-cli-rpm-remote[0m
  msg: |-[0m
    RPM needs to be updated[0m
  rc: 1[0m
  results:[0m
  - |-[0m
    Loaded plugins: priorities, update-motd, upgrade-helper, versionlock[0m
    Resolving Dependencies[0m
    --> Running transaction check[0m
    ---> Package jfrog-cli-v2-jf.x86_64 0:2.57.1-1 will be updated[0m
    ---> Package jfrog-cli-v2-jf.x86_64 0:2.58.0-1 will be an update[0m
    --> Finished Dependency Resolution[0m

    Dependencies Resolved[0m

    ================================================================================[0m
     Package              Arch        Version       Repository                 Size[0m
    ================================================================================[0m
    Updating:[0m
     jfrog-cli-v2-jf      x86_64      2.58.0-1      jfrog-cli-rpm-remote      7.7 M[0m

    Transaction Summary[0m
    ================================================================================[0m
    Upgrade  1 Package[0m

    Total download size: 7.7 M[0m
    Downloading packages:[0m
    Delta RPMs disabled because /usr/bin/applydeltarpm not installed.[0m
    Running transaction check[0m
    ERROR You need to update rpm to handle:[0m
    rpmlib(PayloadIsZstd) <= 5.4.18-1 is needed by jfrog-cli-v2-jf-2.58.0-1.x86_64[0m
     You could try running: rpm -Va --nofiles --nodigest[0m
    Your transaction was saved, rerun it with:[0m
     yum load-transaction /tmp/yum_save_tx.2024-06-10.18-34.51UmVd.yumtx[0m
Stealthii commented 2 weeks ago

If you're experienced with creating RPMs, perhaps you could share some advice that can improve things. From the error you received, it looks like if you update RPM, the issue would be resolved.

The issue is that you are building your RPMs using an AlmaLinux 9.4 image, which are incompatible with CentOS 7:

❯ docker run --platform=linux/amd64 --rm -it almalinux:9 rpm --version
RPM version 4.16.1.3
❯ docker run --platform=linux/amd64 --rm -it almalinux:8 rpm --version
RPM version 4.14.3
❯ docker run --platform=linux/amd64 --rm -it centos:7 rpm --version
RPM version 4.11.3

The fact that it works on el8 based distros is by chance. RPMs strictly should be built on the target major OS release, although lower versions can work they are not guaranteed.

@eyalbe4 you previously used a CentOS Stream 8 image, and these worked on CentOS 7, so why not switch over to an AlmaLinux 8.x base image? As it stands right now the 2.58.1 RPMs that exist in your Yum repository are not installable on a CentOS 7 (or RHEL7) based system. At the very least these versions should be pulled until you rectify the issue.

Updating core OS utilities and packages like rpm, yum, etc. are completely out of the question - the OS is based around these as part of the core functionality, and many systems would break with such a change. The issue is with your package build pipeline not using a compatible ABI as a base.

eyalbe4 commented 2 weeks ago

Thank you @Stealthii! I created thw above PR as you suggested.

eyalbe4 commented 2 weeks ago

@Stealthii, Version 2.58.2 is now released. Looking forward to your feedback.

Stealthii commented 2 weeks ago

Thanks @eyalbe4!

Can confirm that #2572 resolved this issue.


$ docker run --platform=linux/amd64 --rm -it artifactory.company.com/docker/company/ci/centos:7-jfrog bash
bash-4.2# yum update -y jfrog-cli-v2
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package jfrog-cli-v2.x86_64 0:2.57.1-1 will be updated
---> Package jfrog-cli-v2.x86_64 0:2.58.2-1 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================
 Package                    Arch                 Version                 Repository           Size
===================================================================================================
Updating:
 jfrog-cli-v2               x86_64               2.58.2-1                Jfrog               7.8 M

Transaction Summary
===================================================================================================
Upgrade  1 Package

Total download size: 7.8 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
jfrog-cli-2.58.2.x86_64.rpm                                                 | 7.8 MB  00:00:02
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : jfrog-cli-v2-2.58.2-1.x86_64                                                    1/2
  Cleanup    : jfrog-cli-v2-2.57.1-1.x86_64                                                    2/2
  Verifying  : jfrog-cli-v2-2.58.2-1.x86_64                                                    1/2
  Verifying  : jfrog-cli-v2-2.57.1-1.x86_64                                                    2/2

Updated:
  jfrog-cli-v2.x86_64 0:2.58.2-1

Complete!
bash-4.2# jfrog --version
jf version 2.58.2