Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1591371

Summary: Insights-client rpm after re-install cannot get newest.egg
Product: Red Hat Hybrid Cloud Console (console.redhat.com) Reporter: Eduard <esakaiev>
Component: ClientAssignee: jcrafts
Status: CLOSED NEXTRELEASE QA Contact: Jeff Needle <jneedle>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: jcrafts, klape, pyakovle
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-09-24 16:33:01 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:
Embargoed:
Attachments:
Description Flags
Screenshot of wrong archive structure
none
Insights-client log
none
Archive for analysis none

Description Eduard 2018-06-14 14:43:16 UTC
Description of problem:

Insights-client creates the wrong archive structure during insights-client --keep-archive. 

insights-client --version
Client: 3.0.4-1
Core: 3.0.4-2

Also reproduces for v: 3.0.3-9


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


How reproducible: 100%


Steps to Reproduce:
1. provision fresh rhel 7.5
2. subscribe with subscription-manager
3. install insights-client: yum -y insights-client
4. insights-client --register
5. remove insights-client: yum -y remove insights-client
6. yum -y install insights-client
7. insights-client --register --keep-archive
8. check archive structure

Actual results:
see in the attachments

Expected results:

drwx------.  3 root root   19 Jun 14 10:38 boot
-rw-r--r--.  1 root root   40 Jun 14 10:38 branch_info
drwx------. 18 root root 4096 Jun 14 10:38 etc
drwx------.  2 root root 8192 Jun 14 10:38 insights_commands
drwx------.  4 root root  106 Jun 14 10:38 proc
drwx------.  3 root root   24 Jun 14 10:38 run
drwx------.  4 root root   35 Jun 14 10:38 sys
drwx------.  3 root root   17 Jun 14 10:38 usr
drwx------.  3 root root   17 Jun 14 10:38 var


Additional info:
Way how to fix it:
after removing of insights-client: yum -y remove insights-client need to remove 
rm -rf /etc/insights-client.

Comment 1 Eduard 2018-06-14 14:43:50 UTC
Created attachment 1451440 [details]
Screenshot of wrong archive structure

Comment 2 Eduard 2018-06-14 14:44:47 UTC
Created attachment 1451441 [details]
Insights-client log

Comment 3 Eduard 2018-06-14 14:45:26 UTC
Created attachment 1451442 [details]
Archive for analysis

Comment 4 Eduard 2018-06-14 14:51:32 UTC
Actual archive structure, which includes the variety of files:

drwx------.  3 root root     19 Jun 14 10:25 boot
-rw-r--r--.  1 root root     40 Jun 14 10:25 branch_info
drwx------. 12 root root   4096 Jun 14 10:25 etc
-rw-r--r--.  1 root root    589 Jun 14 10:25 etckrb5.conf
-rw-r--r--.  1 root root    214 Jun 14 10:25 etcmodprobe.ddccp-blacklist.conf
-rw-r--r--.  1 root root    165 Jun 14 10:25 etcmodprobe.dfirewalld-sysctls.conf
-rw-r--r--.  1 root root    672 Jun 14 10:25 etcmodprobe.dtuned.conf
-rw-r--r--.  1 root root   2421 Jun 14 10:25 etcsecuritylimits.conf
-rw-r--r--.  1 root root    190 Jun 14 10:25 etcsecuritylimits.d20-nproc.conf
-rw-r--r--.  1 root root    158 Jun 14 10:25 etcsysconfignetwork-scriptsifcfg-eth0
-rw-r--r--.  1 root root    253 Jun 14 10:25 etcsysconfignetwork-scriptsifcfg-lo
-rw-r--r--.  1 root root    982 Jun 14 10:25 etcsystemdjournald.conf
-rw-r--r--.  1 root root    371 Jun 14 10:25 etcyumpluginconf.dlangpacks.conf
-rw-r--r--.  1 root root    176 Jun 14 10:25 etcyumpluginconf.drhnplugin.conf
-rw-r--r--.  1 root root 402361 Jun 14 10:25 etcyum.repos.dredhat.repo
drwx------.  2 root root   8192 Jun 14 10:25 insights_commands
drwx------.  4 root root     86 Jun 14 10:25 insights_data
drwx------.  4 root root    106 Jun 14 10:25 proc
-rw-r--r--.  1 root root    563 Jun 14 10:25 runtmpfiles.dkmod.conf
drwx------.  4 root root     35 Jun 14 10:25 sys
drwx------.  3 root root     17 Jun 14 10:25 usr
-rw-r--r--.  1 root root     36 Jun 14 10:25 usrlibtmpfiles.dcloud-init.conf
-rw-r--r--.  1 root root    463 Jun 14 10:25 usrlibtmpfiles.detc.conf
-rw-r--r--.  1 root root     37 Jun 14 10:25 usrlibtmpfiles.dinitscripts.conf
-rw-r--r--.  1 root root   1180 Jun 14 10:25 usrlibtmpfiles.dlegacy.conf
-rw-r--r--.  1 root root     33 Jun 14 10:25 usrlibtmpfiles.dlibselinux.conf
-rw-r--r--.  1 root root     60 Jun 14 10:25 usrlibtmpfiles.dlvm2.conf
-rw-r--r--.  1 root root    109 Jun 14 10:25 usrlibtmpfiles.dpam.conf
-rw-r--r--.  1 root root     15 Jun 14 10:25 usrlibtmpfiles.dpython.conf
-rw-r--r--.  1 root root     21 Jun 14 10:25 usrlibtmpfiles.drpm.conf
-rw-r--r--.  1 root root    227 Jun 14 10:25 usrlibtmpfiles.dsap.conf
-rw-r--r--.  1 root root    136 Jun 14 10:25 usrlibtmpfiles.dselinux-policy.conf
-rw-r--r--.  1 root root     32 Jun 14 10:25 usrlibtmpfiles.dsubscription-manager.conf
-rw-r--r--.  1 root root    312 Jun 14 10:25 usrlibtmpfiles.dsudo.conf
-rw-r--r--.  1 root root   1662 Jun 14 10:25 usrlibtmpfiles.dsystemd.conf
-rw-r--r--.  1 root root    495 Jun 14 10:25 usrlibtmpfiles.dsystemd-nologin.conf
-rw-r--r--.  1 root root    637 Jun 14 10:25 usrlibtmpfiles.dtmp.conf
-rw-r--r--.  1 root root     55 Jun 14 10:25 usrlibtmpfiles.dtuned.conf
-rw-r--r--.  1 root root    562 Jun 14 10:25 usrlibtmpfiles.dvar.conf
-rw-r--r--.  1 root root    622 Jun 14 10:25 usrlibtmpfiles.dx11.conf
drwx------.  3 root root     17 Jun 14 10:25 var

Comment 5 Eduard 2018-06-14 14:52:46 UTC
Actual archive structure, which includes the variety of files:

drwx------.  3 root root     19 Jun 14 10:25 boot
-rw-r--r--.  1 root root     40 Jun 14 10:25 branch_info
drwx------. 12 root root   4096 Jun 14 10:25 etc
-rw-r--r--.  1 root root    589 Jun 14 10:25 etckrb5.conf
-rw-r--r--.  1 root root    214 Jun 14 10:25 etcmodprobe.ddccp-blacklist.conf
-rw-r--r--.  1 root root    165 Jun 14 10:25 etcmodprobe.dfirewalld-sysctls.conf
-rw-r--r--.  1 root root    672 Jun 14 10:25 etcmodprobe.dtuned.conf
-rw-r--r--.  1 root root   2421 Jun 14 10:25 etcsecuritylimits.conf
-rw-r--r--.  1 root root    190 Jun 14 10:25 etcsecuritylimits.d20-nproc.conf
-rw-r--r--.  1 root root    158 Jun 14 10:25 etcsysconfignetwork-scriptsifcfg-eth0
-rw-r--r--.  1 root root    253 Jun 14 10:25 etcsysconfignetwork-scriptsifcfg-lo
-rw-r--r--.  1 root root    982 Jun 14 10:25 etcsystemdjournald.conf
-rw-r--r--.  1 root root    371 Jun 14 10:25 etcyumpluginconf.dlangpacks.conf
-rw-r--r--.  1 root root    176 Jun 14 10:25 etcyumpluginconf.drhnplugin.conf
-rw-r--r--.  1 root root 402361 Jun 14 10:25 etcyum.repos.dredhat.repo
drwx------.  2 root root   8192 Jun 14 10:25 insights_commands
drwx------.  4 root root     86 Jun 14 10:25 insights_data
drwx------.  4 root root    106 Jun 14 10:25 proc
-rw-r--r--.  1 root root    563 Jun 14 10:25 runtmpfiles.dkmod.conf
drwx------.  4 root root     35 Jun 14 10:25 sys
drwx------.  3 root root     17 Jun 14 10:25 usr
-rw-r--r--.  1 root root     36 Jun 14 10:25 usrlibtmpfiles.dcloud-init.conf
-rw-r--r--.  1 root root    463 Jun 14 10:25 usrlibtmpfiles.detc.conf
-rw-r--r--.  1 root root     37 Jun 14 10:25 usrlibtmpfiles.dinitscripts.conf
-rw-r--r--.  1 root root   1180 Jun 14 10:25 usrlibtmpfiles.dlegacy.conf
-rw-r--r--.  1 root root     33 Jun 14 10:25 usrlibtmpfiles.dlibselinux.conf
-rw-r--r--.  1 root root     60 Jun 14 10:25 usrlibtmpfiles.dlvm2.conf
-rw-r--r--.  1 root root    109 Jun 14 10:25 usrlibtmpfiles.dpam.conf
-rw-r--r--.  1 root root     15 Jun 14 10:25 usrlibtmpfiles.dpython.conf
-rw-r--r--.  1 root root     21 Jun 14 10:25 usrlibtmpfiles.drpm.conf
-rw-r--r--.  1 root root    227 Jun 14 10:25 usrlibtmpfiles.dsap.conf
-rw-r--r--.  1 root root    136 Jun 14 10:25 usrlibtmpfiles.dselinux-policy.conf
-rw-r--r--.  1 root root     32 Jun 14 10:25 usrlibtmpfiles.dsubscription-manager.conf
-rw-r--r--.  1 root root    312 Jun 14 10:25 usrlibtmpfiles.dsudo.conf
-rw-r--r--.  1 root root   1662 Jun 14 10:25 usrlibtmpfiles.dsystemd.conf
-rw-r--r--.  1 root root    495 Jun 14 10:25 usrlibtmpfiles.dsystemd-nologin.conf
-rw-r--r--.  1 root root    637 Jun 14 10:25 usrlibtmpfiles.dtmp.conf
-rw-r--r--.  1 root root     55 Jun 14 10:25 usrlibtmpfiles.dtuned.conf
-rw-r--r--.  1 root root    562 Jun 14 10:25 usrlibtmpfiles.dvar.conf
-rw-r--r--.  1 root root    622 Jun 14 10:25 usrlibtmpfiles.dx11.conf
drwx------.  3 root root     17 Jun 14 10:25 var

Comment 6 Pavlo Yakovlev 2018-06-14 15:53:49 UTC
USER STORY:
1. Install & Register + collect data
1.1 yum -y install insights-client
1.2 insights-client --register

3. Modify insights-client.conf (e.g. using  Obfuscate IP)

4. Collect data with new settings -> insights-client

5. Rollback default settings
5.1 yum -y remove insights-client
5.2 yum -y install insights-client

Actual results:
insights-client gets 304 status for etag_headers:
.insights-core.etag
.insights-core-gpg-sig.etag
And doesn't upload new_egg into /var/lib/insights

We still have old-Core with fixed Defects such as "wrong structure" of archive or uploader.json for v1

Expected results:
yum -y remove insights-client -> erases /etc/insights-client/.insights-core.etag & .insights-core-gpg-sig.etag

Additional info:
Currently "yum -y remove insights-client" erases /var/lib/insights/* with last_stable.egg and last_stable.egg.asc

Comment 7 jcrafts 2018-06-20 14:55:00 UTC
This is due to lingering etags on uninstall. Fixed here:
https://github.com/RedHatInsights/insights-client/commit/8a6c3de11ec11236b66ec3901553fe0c9600bc62

Comment 8 Eduard 2018-07-10 17:44:34 UTC
Hi,

I've reproduced the current issue on the latest rpm.egg

1. >> insights-client --version
      Client: 3.0.3-9
      Core: 3.0.8-1
2. insights-client --register
3. yum -y remove insights-client
4. ls -la /etc/insights-client/ls -la /etc/insights-client/.insights-core*.etag
   -rw-rw-r--+ 1 root root 45 Jun 13 08:37 /etc/insights-client/.insights-core.etag
   -rw-rw-r--+ 1 root root 45 Jun 13 08:37 /etc/insights-client/.insights-core-gpg-sig.etag

Reassigning ticket.