Bug 1114044 - creating kickstart distribution with same label across two different orgs results in ISE during download
Summary: creating kickstart distribution with same label across two different orgs res...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: WebUI
Version: 560
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Stephen Herr
QA Contact: Pavel Studeník
URL:
Whiteboard:
Depends On:
Blocks: sat570-blockers
TreeView+ depends on / blocked
 
Reported: 2014-06-27 14:25 UTC by Shannon Hughes
Modified: 2018-12-06 17:04 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-01-22 09:10:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
patch to fix media_path for custom kickstart distributions (1.47 KB, patch)
2014-06-27 20:39 UTC, Shannon Hughes
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 974643 0 None None None Never

Description Shannon Hughes 2014-06-27 14:25:53 UTC
Description of problem:

Creating a custom kickstart distribution using the same label for two different orgs results in an ISE during the download of the kicsktart tree files. 

org.hibernate.NonUniqueResultException: query did not return a unique result: 2
	at org.hibernate.impl.AbstractQueryImpl.uniqueElement(AbstractQueryImpl.java:844)
	at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:835)
	at com.redhat.rhn.domain.kickstart.KickstartFactory.lookupKickstartTreeByLabel(KickstartFactory.java:645)
	at com.redhat.rhn.frontend.action.common.DownloadFile.handleKickstartDownload(DownloadFile.java:269)
	at com.redhat.rhn.frontend.action.common.DownloadFile.execute(DownloadFile.java:125)
	at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
	... 40 more

It appears we are using a hiberate query to select by label only and not by label/org_id

currently investigating and plan on proposing a patch.

Comment 2 Shannon Hughes 2014-06-27 20:39:49 UTC
Created attachment 912958 [details]
patch to fix media_path for custom kickstart distributions

Comment 4 Stephen Herr 2014-07-15 20:30:45 UTC
Committing to Spacewalk master:
cd0a7132d6fe8a1b24f6078bd079e9757db1f2bc

Note that this will fix Kickstart Distributions that are created / modified in the future, but not currently existing Distributions.

Comment 5 Stephen Herr 2014-07-15 23:11:59 UTC
And Checkstyle fix:
789f173e74eacc279b9b3ece5506cdb4a3996055

Comment 7 Pavel Studeník 2014-09-23 12:31:14 UTC
Reproducer:

1. create first organization A
 a) download image to server and create distribution "Fedora-21" in A org
 b) create new kickstart with this distribution in org B

2. create second organization B
 a) create new distribution "Fedora-21" in B org
 b) create new kickstart with this distribution in org B

3) Try to provision system with this kickstart or go to web page
 a) /ks/dist/Fedora-21 (ISE 500)
 b) /ks/dist/org/2/Fedora-21 (ISE 500)
 c) /ks/dist/org/1/Fedora-21 (ok)

Comment 10 Lukáš Hellebrandt 2015-01-21 13:02:29 UTC
Re-verified
spacewalk-java-2.3.8-96

Used reproducer from comment 7. Do not use its last a,b,c) part as this part of the reproducer is wrong.

Kickstart file now contains "url --url http://<fqdn>/ks/dist/org/<org_id>/<ks_label>" instead of http://<fqdn>/ks/dist/<ks_label>


Note You need to log in before you can comment on or make changes to this bug.