Bug 537156

Summary: User cannot install RPM via yum -- repo does not appear to be fully populated.
Product: [Other] RHQ Project Reporter: Corey Welton <cwelton>
Component: ContentAssignee: John Matthews <jmatthew>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: jmatthew
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard: sprint_2
Fixed In Version: 2.4 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-08-12 16:48:10 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 538145    

Description Corey Welton 2009-11-12 17:12:44 UTC
Description of problem:


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


How reproducible:


Steps to Reproduce:
1.  Create/sync/associate Content Provider, Repo, etc.
2.  Associate platform with above.
3.  in $Platform > Inventory > Connection, enable internal yum server; Look in /etc/yum.repos.d to assure rhq.repo has been created and that the data there matches the info $Platform > Inventory > Connectio
4. `yum list` 

Actual results:

[root@core-01 yum.repos.d]# yum list
Loaded plugins: refresh-packagekit
http://localhost:9080/yum/repodata/repomd.xml: [Errno 7] HTTP Exception (BadStatusLine): 
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: rhq. Please verify its path and try again
[root@core-01 yum.repos.d]# telnet localhost:9080


Expected results:

Repo metadata should be getting populated but doesn't seem to be.

Additional info:

Note the port is open:

[root@core-01 yum.repos.d]# telnet localhost 9080
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.

Comment 1 John Matthews 2009-11-17 19:21:54 UTC
Looking at the agent logs, this is the exception I'm seeing.

2009-11-17 14:21:01,047 INFO  [yum:9080] (plugins.platform.content.yum.Request)- processing: /yum/repodata/repomd.xml
2009-11-17 14:21:01,060 INFO  [yum:9080] (plugins.platform.content.yum.PrimaryMD5)- primary.md5 updated: e29578a1c93f76eb524054b543d17203
2009-11-17 14:21:01,088 ERROR [yum:9080] (plugins.platform.content.yum.Request)- request failed:
java.lang.NullPointerException
	at java.lang.String.<init>(String.java:601)
	at org.rhq.plugins.platform.content.yum.Primary.gunzip(Primary.java:265)
	at org.rhq.plugins.platform.content.yum.Primary.create(Primary.java:220)
	at org.rhq.plugins.platform.content.yum.Primary.file(Primary.java:139)
	at org.rhq.plugins.platform.content.yum.Repomd.create(Repomd.java:150)
	at org.rhq.plugins.platform.content.yum.Repomd.file(Repomd.java:118)
	at org.rhq.plugins.platform.content.yum.Repomd.length(Repomd.java:90)
	at org.rhq.plugins.platform.content.yum.Repomd.writeHeader(Repomd.java:71)
	at org.rhq.plugins.platform.content.yum.Request.reply(Request.java:187)
	at org.rhq.plugins.platform.content.yum.Request.process(Request.java:122)
	at org.rhq.plugins.platform.content.yum.YumServer.listen(YumServer.java:165)
	at org.rhq.plugins.platform.content.yum.YumServer.access$200(YumServer.java:45)
	at org.rhq.plugins.platform.content.yum.YumServer$1.run(YumServer.java:148)

Comment 2 John Matthews 2009-11-18 02:35:53 UTC
First problem identified was that we were not saving the 'metadata' to the DB.
For 'metadata' I'm talking about a GZipped XML String representing a <package> element which primary.xml (yum) uses.

RHQ will look in the DB and grab a 'metadata' value for each package, it then throws them together to create the primary.xml.

We addressed a change to the RHN plugin to translate it's data to the <package> blob and pass it gzipped into the DTO object.  The data is now being persisted in the database, but it looks like more work is required.

When doing a yum repolist, I see "0" packages.

The initial problem "yum list" returning an error has been fixed, but the process as a whole needs more work.


The 2 commits done to address the metadata with RHN Plugin are here:
commit 4b618e36d53ef97c8710243ba0868312e4da71c0
Author: John Matthews <jmatthew>
Date:   Tue Nov 17 21:11:17 2009 -0500

    Allows RHN plugin to save 'metadata' needed by RHQ Yum operations


commit 4051ded4547cf520f08f8866c085cfce6b186b1d
Author: John Matthews <jmatthew>
Date:   Tue Nov 17 20:51:59 2009 -0500

    Adding 'metadata' to package store in RHQ.
    RHQ requires us to form a Package element from a primary.xml for each package
    We then need to ensure this xml string is gzipped and passed into the DTO
    so it will be preserved and later used to reconstruct a primary.xml to give to yum

Comment 3 John Matthews 2009-12-07 21:21:39 UTC
This is now working with latest git pull from the "content" branch.

Comment 4 Corey Welton 2009-12-09 22:50:09 UTC
QA Verified.

Comment 5 Corey Welton 2010-08-12 16:48:10 UTC
Mass-closure of verified bugs against JON.