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

Bug 1758286

Summary: Kickstart - DownloadFile.do fails with NPE when selected "Always use the newest Tree"
Product: [Community] Spacewalk Reporter: Stefan Bluhm <fedoraproject.org>
Component: ServerAssignee: Tomáš Kašpárek <tkasparek>
Status: CLOSED DUPLICATE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: high Docs Contact:
Priority: unspecified    
Version: 2.9   
Target Milestone: ---   
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: 2019-10-16 10:16:38 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:

Description Stefan Bluhm 2019-10-03 18:34:16 UTC
Description of problem:
Kickstart fails with an NPE in DownloadFiles.do, when the box "Always use the newest Tree for this base channel. "Newest" is determined by the date it was last modified." is ticket.

With the box, DownloadFile.do tries to access "/rhn/common/DownloadFile.do?url=/ks/dist/child/centos8-x86_64/CentOS_8_Base_OS_x86_64/repodata/repomd.xml".

Without the box, the request is successful to "/rhn/common/DownloadFile.do?url=/ks/dist/org/1/CentOS_8_Base_OS_x86_64/repodata/repomd.xml"

Version-Release number of selected component (if applicable):
Spacewalk Server 2.9 on CentOS 7

How reproducible:
Always


Steps to Reproduce:
1. Create a new CentOS8 base channel, select "Create kickstartable tree" and sync it.
2. Create sub channels (i.e. CentOS 8 Appstream, Spacewalk Client, etc)
3. Ensure in Kickstart --> Distributions, that the distribution is listed.
4. In Kickstart --> Profiles --> Create Kickstart Profile" chose the distribution and enable the tickbox "Always use newest tree..."
5. Complete profile creation.
6. Now Kickstart a new machine

Actual results:
The machine boots the kickstart profile and starts with the pre-installation tasks. You will see, that it stops and asks for the installation source.


Expected results:
Kickstart should start and complete the full installation without manual interaction.

Additional info:
The following exception occurred while executing this request:
GET /rhn/common/DownloadFile.do

Date:10/3/19 1:17:09 PM CEST
Headers:
  host: spacewalk.example.com
  user-agent: libdnf
  accept: */*
  Cache-Control: no-cache
  pragma: no-cache

Request:
Local Name = spacewalk.example.com
Server Name = spacewalk.example.com
Requested Session Valid = false
Session = null
Protocol = http
Request Locale = en_US
Request Character Encoding = UTF-8
Attribute Names = rhnActiveLang, org.apache.struts.action.MESSAGE, org.apache.struts.action.mapping.instance, requestedUri, org.apache.struts.action.MODULE, javax.servlet.jsp.jstl.fmt.timeZone.request, org.apache.struts.globals.ORIGINAL_URI_KEY,


User Information:
No User logged in.

Exception:
javax.servlet.ServletException: java.lang.NullPointerException
        at org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:520)
        at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:427)
        at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229)
        at com.redhat.rhn.frontend.struts.RhnRequestProcessor.process(RhnRequestProcessor.java:105)
        at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1926)
        at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:451)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at com.redhat.rhn.frontend.servlets.AuthFilter.doFilter(AuthFilter.java:104)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:129)
        at com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:77)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at com.redhat.rhn.frontend.servlets.LocalizedEnvironmentFilter.doFilter(LocalizedEnvironmentFilter.java:67)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at com.redhat.rhn.frontend.servlets.EnvironmentFilter.doFilter(EnvironmentFilter.java:101)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at com.redhat.rhn.frontend.servlets.SessionFilter.doFilter(SessionFilter.java:58)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at com.redhat.rhn.frontend.servlets.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:97)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)
        at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:190)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
        at com.redhat.rhn.frontend.action.common.DownloadFile.handleKickstartDownload(DownloadFile.java:288)
        at com.redhat.rhn.frontend.action.common.DownloadFile.execute(DownloadFile.java:135)
        at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
        ... 45 more

Comment 1 Stefan Bluhm 2019-10-16 10:09:36 UTC
I just realised based on https://bugzilla.redhat.com/show_bug.cgi?id=1323548 that this is a documentation issue as well as a insufficient implementation (no messages/infos and a NPE)

Comment 2 Stefan Bluhm 2019-10-16 10:16:38 UTC

*** This bug has been marked as a duplicate of bug 1713283 ***