Bug 619723

Summary: java.lang.ArrayIndexOutOfBoundsException during kickstart
Product: [Community] Spacewalk Reporter: Mark Chappell <tremble>
Component: WebUIAssignee: Jan Pazdziora <jpazdziora>
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: medium Docs Contact:
Priority: low    
Version: 1.0CC: jpazdziora, kurtisnelson, tremble
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: spacewalk-java-1.6.47-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-22 16:50:16 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: 723481    
Attachments:
Description Flags
Backtrace from Catalina.out
none
List of RPMs installed on SW server
none
Catalina log on repo access none

Description Mark Chappell 2010-07-30 10:12:19 UTC
Created attachment 435521 [details]
Backtrace from Catalina.out

Description of problem:
I start a (reasonably long) kickstart, it runs most of the way through and then I get a File Not Found message on the machine beeing kickstarted.

Version-Release number of selected component (if applicable):
Will attach full list

How reproducible:
Consistently, but with different failing packages.

Comment 1 Mark Chappell 2010-07-30 10:13:12 UTC
Created attachment 435522 [details]
List of RPMs installed on SW server

Comment 2 Mark Chappell 2010-07-30 10:18:08 UTC
I mentioned the bug to Justin Sherrill via IRC on Thursday.  Possibly relevant information being that :

* It worked 24 hours ago.
* The resultant VM was unbootable (it failed to find the boot image properly)
* Then I changed the partitioning setup in the kickstart to remove the use of LVM
* I also commented out a couple of entries from the package install list (They take a long time to install)
* Tried rebuilding the VM again, and it now fails.  Yesterday with xulrunner, today with rpm-devel

Comment 3 Jan Pazdziora 2010-10-27 08:32:31 UTC
Mass-aligning under space12, so that we don't lose track of this bugzilla. This however does not mean that we plan (will be able to) address this bug in Spacewalk 1.2.

Comment 4 Jan Pazdziora 2010-11-19 16:05:27 UTC
Mass-moving to space13.

Comment 5 Miroslav Suchý 2011-04-11 07:34:03 UTC
We did not have time for this one during Spacewalk 1.4 time frame. Mass moving to Spacewalk 1.5.

Comment 6 Miroslav Suchý 2011-04-11 07:37:25 UTC
We did not have time for this one during Spacewalk 1.4 time frame. Mass moving to Spacewalk 1.5.

Comment 7 Kurt Nelson 2011-06-23 17:50:24 UTC
Created attachment 509585 [details]
Catalina log on repo access

Whenever http://spacewalk/ks/dist/child/f14updates/Fedora-14-Desktop-x86_64 or similar is accessed via the kickstart, this error happens.

Comment 8 Jan Pazdziora 2011-07-07 08:17:27 UTC
(In reply to comment #0)
> Created attachment 435521 [details]
> Backtrace from Catalina.out
> 
> Description of problem:
> I start a (reasonably long) kickstart, it runs most of the way through and then
> I get a File Not Found message on the machine beeing kickstarted.
> 
> Version-Release number of selected component (if applicable):
> Will attach full list
> 
> How reproducible:
> Consistently, but with different failing packages.

The first backtrace comes from the code

    // Ported from perl - needed for yum's requests for byte ranges
    private StreamInfo manualServeByteRange(HttpServletRequest request,
            HttpServletResponse response,
            String diskPath, String range) {

        // bytes=440-25183
        String[] bytesheader = StringUtils.split(range, "=");
        String[] ranges = StringUtils.split(bytesheader[1], "-");
        long start = Long.valueOf(ranges[0]).longValue();
        long end = Long.valueOf(ranges[1]).longValue();
        if (log.isDebugEnabled()) {
            log.debug("manualServeByteRange Start    : " + start);
            log.debug("manualServeByteRange End      : " + end);
        }

where we process the Range requests. And the range either did not contain the dash (minus) sign, or it was a suffix range request, something like

   bytes=-500 or bytes=9500-

as specified in the 14.35.1 of RFC 2616. In that case, the ranges array would only have single element.

We probably want something like splitPreserveAllTokens there, and correctly account for situations when we will not know the start or end and compute it from the totalSize.

Comment 9 Jan Pazdziora 2011-07-07 08:56:06 UTC
(In reply to comment #7)
> Created attachment 509585 [details]
> Catalina log on repo access
> 
> Whenever http://spacewalk/ks/dist/child/f14updates/Fedora-14-Desktop-x86_64 or
> similar is accessed via the kickstart, this error happens.

Hello,

do kickstart work as expected and does the problem only happen when you try to "browse" the kickstart tree manually?

Spacewalk does not provide the full directory listing -- in will only return the repodata *files* that are needed during kickstart. You might want to append repodata/primary.xml.gz or something similar.

Comment 10 Jan Pazdziora 2011-07-20 11:52:35 UTC
Aligning under space16.

Comment 11 Jan Pazdziora 2011-09-16 14:15:47 UTC
(In reply to comment #8)
> 
> We probably want something like splitPreserveAllTokens there, and correctly
> account for situations when we will not know the start or end and compute it
> from the totalSize.

Fixed in Spacewalk master, 365fb6234d3bbb67919ce058f16b427548421e18, implemented via regexp to also check for the bytes= prefix.

Comment 12 Milan Zázrivec 2011-12-22 16:50:16 UTC
Spacewalk 1.6 has been released.