Bug 1377521

Summary: Should check if a RPM package exists before downloading metadata
Product: Red Hat Enterprise Linux 7 Reporter: Alex Jia <ajia>
Component: rpm-ostree-clientAssignee: Colin Walters <walters>
Status: CLOSED NOTABUG QA Contact: atomic-bugs <atomic-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.4CC: miabbott, smilner
Target Milestone: rcKeywords: Extras
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-10-26 14:24:53 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Alex Jia 2016-09-20 02:01:09 UTC
Description of problem:
When we use rpm-ostree pkg-add a non-exists RPM package, the rpm-ostree will download metadata firstly, it will take several minutes, and then user got a expected result "error: No package 'XXX' found", we should change the logic design of pkg-add packages and check if the RPM package exists firstly.


Version-Release number of selected component (if applicable):

[cloud-user@atomic-00 ~]$ cat /etc/redhat-release 
Red Hat Enterprise Linux Atomic Host release 7.2

[cloud-user@atomic-00 ~]$ atomic host status
State: idle
Deployments:
● rhel-atomic-host-ostree:rhel-atomic-host/7/x86_64/standard
       Version: 7.2.6-1 (2016-08-18 16:01:03)
        Commit: dae35767902aad07b087d359be20f234d244da79fdd4734cd2fbc3ee39b12cf8
        OSName: rhel-atomic-host
      Unlocked: development

[cloud-user@atomic-00 ~]$ rpm -q rpm-ostree-client ostree
rpm-ostree-client-2016.9-1.atomic.el7.x86_64
ostree-2016.10-1.atomic.el7.x86_64

How reproducible:
always

Steps to Reproduce:
1. atomic host unlock
2. download rpm-ostree-client, ostree and time RPM packages and install them
3. time rpm-ostree pkg-add foobar

Actual results:

[cloud-user@atomic-00 ~]$ sudo time rpm-ostree pkg-add foobar

Downloading metadata: [=================================================================================================================================================================] 100%
error: No package 'foobar' found
0.00user 0.00system 9:54.15elapsed 0%CPU (0avgtext+0avgdata 7156maxresident)k
0inputs+0outputs (0major+1930minor)pagefaults 0swaps


Expected results:


Additional info:

and the metadata eats about 300M disk space, how to clean up it? it's relationship w/ bug 1377516.

Comment 1 Alex Jia 2016-09-20 02:03:49 UTC
(In reply to Alex Jia from comment #0)
> Description of problem:
> When we use rpm-ostree pkg-add a non-exists RPM package, the rpm-ostree will
> download metadata firstly, it will take several minutes, and then user got a
> expected result "error: No package 'XXX' found", we should change the logic
> design of pkg-add packages and check if the RPM package exists firstly.

Or is it necessary to download metadata for checking if a RPM package exists? could we check it w/ remote ostree repo?

Comment 3 Micah Abbott 2016-09-20 13:52:37 UTC
I don't believe it is possible to determine if a package does not exsit without querying the repo and downloading the metadata.

It is similar to using yum/dnf where there has to be some metadata in place before you can determine if the package exists.

Comment 4 Steve Milner 2016-10-26 14:24:53 UTC
Based on Micah's comments setting as NOTABUG.