Description of problem: Spacewalk 1.8 displays installed packages belonging to a channel for which system is subscribed as extra packages. Version-Release number of selected component (if applicable): 1.8 How reproducible: Create 2 channels containing different packages with the same name, version and architecture. For instance, I discovered this bug by creating a channel for CentOS 6 x86_64 and RHEL 6 x86_64. Steps to Reproduce: 1. 2. 3. Actual results: A system subscribed to one of the 2 channels will report every installed packages having an homonym in an other channel as extra although they belong to a channel for witch the system is subscribed. Expected results: The extra package list should not report packages that belong to a channel on which a system is subscribed. Additional info: The 2 SQL requests used to count and list the number of extra packages are incorrect. The problem lies in 'left outer join rhnPackage p on (sp.name_id = p.name_id and sp.evr_id = p.evr_id and sp.package_arch_id = p.package_arch_id)'. Here are proposed replacement SQL requests for packages_in_errata and packages_in_tmp_errata in java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml that seem to give the correct result : <mode name="extra_packages_systems_count" class="com.redhat.rhn.frontend.dto.SystemOverview"> <query params="userid, orgid"> select s.id as id, s.name as name, 1 as selectable, count(sp.name_id) as extra_pkg_count from rhnServer s join rhnUserServerPerms usp on (usp.server_id = s.id and usp.user_id = :userid) join rhnServerPackage sp on (s.id = sp.server_id) left outer join (select sc.server_id, cp.package_id, p.name_id, p.evr_id, p.package_arch_id from rhnPackage p, rhnServerChannel sc join rhnChannelPackage cp on (sc.channel_id = cp.channel_id) where cp.package_id = p.id ) scp on (scp.server_id = sp.server_id and sp.name_id = scp.name_id and sp.evr_id = scp.evr_id and sp.package_arch_id = scp.package_arch_id) where scp.package_id is null and s.org_id = :orgid group by s.name, s.id order by name, id </query> <elaborator name="system_overview" /> <elaborator name="entitlements" /> <elaborator name="is_virtual_guest" /> <elaborator name="is_virtual_host" /> </mode> <mode name="extra_packages_for_system" class="com.redhat.rhn.frontend.dto.PackageListItem"> <query params="serverid"> select scp.package_id, pn.id || '|' || pe.id || '|' || pa.id as id_combo, pn.name || '-' || pe.version || '-' || pe.release as nvre, pn.name || '-' || evr_t_as_vre_simple(pe.evr) || '.' || pa.label as nvrea, pn.name as name, pe.version as version, pe.release as release, pe.epoch as epoch, pn.id as name_id, pe.id as evr_id, pa.label as arch, sp.installTime from rhnServerPackage sp left outer join (select sc.server_id, cp.package_id, p.name_id, p.evr_id, p.package_arch_id from rhnPackage p, rhnServerChannel sc join rhnChannelPackage cp on (sc.channel_id = cp.channel_id) where cp.package_id = p.id ) scp on (scp.server_id = sp.server_id and sp.name_id = scp.name_id and sp.evr_id = scp.evr_id and sp.package_arch_id = scp.package_arch_id) left outer join rhnPackageName pn on (pn.id = sp.name_id) left outer join rhnPackageArch pa on (pa.id = sp.package_arch_id) left outer join rhnPackageEvr pe on (pe.id = sp.evr_id) where sp.server_id = :serverid and (scp.package_id is null) order by nvre </query> </mode>
extra_packages_systems_count belongs to java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml
Fixed in spacewalk.git master: 1d3c5cd2a566d6ed5a273e64e2b395ce7c6d144a
Marking bug as ON_QA since tonight's build of Spacewalk nightly is a release candidate for Spacewalk 1.9.
Spacewalk 1.9 has been released. https://fedorahosted.org/spacewalk/wiki/ReleaseNotes19