[JIRA] (JENKINS-60092) ArrayIndexOutOfBoundsException in getPrimaryView when no view exists

13 views
Skip to first unread message

pierre-louis.bonicoli@libregerbil.fr (JIRA)

unread,
Nov 7, 2019, 11:50:03 AM11/7/19
to jenkinsc...@googlegroups.com
Pierre-Louis Bonicoli created an issue
 
Jenkins / Bug JENKINS-60092
ArrayIndexOutOfBoundsException in getPrimaryView when no view exists
Issue Type: Bug Bug
Assignee: Unassigned
Components: core
Created: 2019-11-07 16:49
Labels: exception
Priority: Minor Minor
Reporter: Pierre-Louis Bonicoli

This exception occurs while defining a view using a job DSL when no other view exists:

SEVERE  jenkins.InitReactorRunner$1#onTaskFailed: Failed ConfigurationAsCode.init
java.lang.ArrayIndexOutOfBoundsException: 0
    at java.util.concurrent.CopyOnWriteArrayList.get(CopyOnWriteArrayList.java:388)
    at java.util.concurrent.CopyOnWriteArrayList.get(CopyOnWriteArrayList.java:397)
    at hudson.model.ViewGroupMixIn.getPrimaryView(ViewGroupMixIn.java:172)
    at hudson.model.ViewGroupMixIn.getView(ViewGroupMixIn.java:134)
    at jenkins.model.Jenkins.getView(Jenkins.java:1834)
    at javaposse.jobdsl.plugin.JenkinsJobManagement.createOrUpdateView(JenkinsJobManagement.java:175)
    at javaposse.jobdsl.dsl.JobManagement$createOrUpdateView$2.call(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:141)
    at javaposse.jobdsl.dsl.AbstractDslScriptLoader$_extractGeneratedViews_closure5.doCall(AbstractDslScriptLoader.groovy:216)

Can be reproduced using the following Dockerfile:

FROM jenkins/jenkins:latest

RUN echo job-dsl > /usr/share/jenkins/ref/plugins.txt
RUN echo configuration-as-code >> /usr/share/jenkins/ref/plugins.txt
RUN /usr/local/bin/install-plugins.sh < /usr/share/jenkins/ref/plugins.txt

RUN echo 2.0 > /usr/share/jenkins/ref/jenkins.install.UpgradeWizard.state

RUN echo 'jenkins:' > /usr/share/jenkins/ref/jenkins.yaml.override
RUN echo 'jobs:' >> /usr/share/jenkins/ref/jenkins.yaml.override
RUN echo '  - file: /var/jenkins_home/my-view.groovy' >> /usr/share/jenkins/ref/jenkins.yaml.override

RUN /bin/echo -e "listView('test') {\n\
    description('test desc')\n\
}" > /usr/share/jenkins/ref/my-view.groovy

ENV JAVA_OPTS -Djenkins.install.runSetupWizard=false

and the following commands:

  • docker build -t testjenkins .
  • docker run -p 8080:8080 -p 50000:50000 -it testjenkins
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

jglick@cloudbees.com (JIRA)

unread,
Nov 22, 2019, 10:34:02 AM11/22/19
to jenkinsc...@googlegroups.com
Change By: Jesse Glick
Status: Open Fixed but Unreleased
Resolution: Fixed
Released As: 2.206

jglick@cloudbees.com (JIRA)

unread,
Nov 22, 2019, 10:34:03 AM11/22/19
to jenkinsc...@googlegroups.com

o.v.nenashev@gmail.com (JIRA)

unread,
Nov 25, 2019, 4:25:02 PM11/25/19
to jenkinsc...@googlegroups.com

o.v.nenashev@gmail.com (JIRA)

unread,
Nov 25, 2019, 4:25:03 PM11/25/19
to jenkinsc...@googlegroups.com
Oleg Nenashev updated Bug JENKINS-60092
 

Fixed it 2.206. I am not sure whether it is a good LTS candidate taking the plan to introduce the default view, but I will leave the decision to Oliver Gondža

Change By: Oleg Nenashev
Status: Fixed but Unreleased Resolved

dbeck@cloudbees.com (JIRA)

unread,
Jan 13, 2020, 12:26:03 PM1/13/20
to jenkinsc...@googlegroups.com

ogondza@gmail.com (JIRA)

unread,
Jan 13, 2020, 1:34:03 PM1/13/20
to jenkinsc...@googlegroups.com
Oliver Gondža updated an issue
Change By: Oliver Gondža
Labels: exception lts 2.204.2 - candidate fixed exception
Reply all
Reply to author
Forward
0 new messages