java.lang.reflect.InvocationTargetException

Jenkins JIRA | jlongman | 2 years ago
  1. 0

    [JENKINS-28290] Git plugin prevents build display on missing header entries in changelog.xml - Jenkins JIRA

    jenkins-ci.org | 7 months ago
    java.lang.reflect.InvocationTargetException
  2. 0

    When the {{changelog.xml}} is missing entries, specifically {{parent}} a giant stacktrace appears in the build page. This also breaks wallboards which call {{fetchJobViews}}. To test, take a changelog and delete the parent SHA1 id, ensure a trailing space is left after {{parent}}, so "parent " as opposed to "parent 8d79986e611a81aa3ace7036b8b52351541604d6". I still don't know why the headers were missing, any information about where the {{changelog.xml}} is generated would be helpful, since a {{git log --pretty=raw $SHA1}} shows the {{parent}} correctly. (I should note that the master is an older git because maintenance is downtime and the slaves are all ansible'ized and up to date.) Created [JENKINS-28291] to track. I should note that this is *NOT* caused by the lack of the Mail plugin being properly configured - [JENKINS-19045] - it is present, enabled and configured: it works fine. {noformat} javax.servlet.ServletException: org.apache.commons.jelly.JellyTagException: jar:file:/usr/home/hudson/hudson/war/WEB-INF/lib/jenkins-core-1.608.jar!/hudson/model/AbstractBuild/index.jelly:67:61: <st:include> No page found 'digest.jelly' for class hudson.matrix.MatrixBuild at org.kohsuke.stapler.jelly.JellyClassTearOff.serveIndexJelly(JellyClassTearOff.java:117) at org.kohsuke.stapler.jelly.JellyFacet.handleIndexRequest(JellyFacet.java:127) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:735) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876) [...] Caused by: org.apache.commons.jelly.JellyTagException: jar:file:/usr/home/hudson/hudson/war/WEB-INF/lib/jenkins-core-1.608.jar!/hudson/model/AbstractBuild/index.jelly:67:61: <st:include> No page found 'digest.jelly' for class hudson.matrix.MatrixBuild at org.kohsuke.stapler.jelly.IncludeTag.doTag(IncludeTag.java:124) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) [...] {noformat} In the jenkins http://jenkins/log/all what appears is: {noformat} Caught exception evaluating: it.changeSet in /job/4.9.1/2/TARGET_ARCH=amd64,label=xipos9/. Reason: java.lang.reflect.InvocationTargetException java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedMethodAccessor357.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) [...] at java.lang.Thread.run(Thread.java:724) Caused by: java.lang.ArrayIndexOutOfBoundsException {noformat} Separately, the {{JiraIssueIndexer}} failed with this stacktrace {noformat} SEVERE: Timer task hudson.plugins.jiraapi.IssueIndexerThread@8e3484d failed java.lang.ArrayIndexOutOfBoundsException: 1 at hudson.plugins.git.GitChangeSet.parseCommit(GitChangeSet.java:104) at hudson.plugins.git.GitChangeSet.<init>(GitChangeSet.java:89) at hudson.plugins.git.GitChangeLogParser.parseCommit(GitChangeLogParser.java:73) at hudson.plugins.git.GitChangeLogParser.parse(GitChangeLogParser.java:57) at hudson.plugins.git.GitChangeLogParser.parse(GitChangeLogParser.java:44) at hudson.plugins.git.GitChangeLogParser.parse(GitChangeLogParser.java:25) at hudson.scm.ChangeLogParser.parse(ChangeLogParser.java:57) at hudson.model.AbstractBuild.calcChangeSet(AbstractBuild.java:906) at hudson.model.AbstractBuild.getChangeSet(AbstractBuild.java:874) at hudson.plugins.jiraapi.index.IssueIndexer.findBuildRelatedIssues(IssueIndexer.java:209) at hudson.plugins.jiraapi.index.IssueIndexer.fullIndex(IssueIndexer.java:171) at hudson.plugins.jiraapi.IssueIndexerThread.doRun(IssueIndexerThread.java:68) at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:51) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [...] at java.lang.Thread.run(Thread.java:724) {noformat} Inspecting these lines: {code:java|title=GitChangeSet.java} if (line.startsWith("commit ")) { this.id = line.split(" ")[1]; } else if (line.startsWith("tree ")) { } else if (line.startsWith("parent ")) { this.parentCommit = line.split(" ")[1]; } else if (line.startsWith(PREFIX_COMMITTER)) { {code} makes it pretty obvious the code is going to fail in these conditions. (Line 104 is actually the line after the "parent " test.) This was verified in a debugger which led to the files being obviously incorrect. Hand editing these {{changelog.xml}} files and adding any value corrects the issue - the {{parent}} attribute is used for {{gitweb}} and not elsewhere from what I can see, so was sufficient to test the theory even if it is not the correct SHA1 and breaks web links. This code lacks [robustness|http://en.wikipedia.org/wiki/Robustness_principle] by assuming the input is correct. A simple patch would test the array length and report an error, I can do it it's more understanding the correct erroring (or ignoring and logging) methods, advice appreciated. An example changelog.xml {noformat:title=changelog.xml} commit 452eada08db501e04f3de9441065bb72728dbc9b tree 9b346ed5ba67deaec8f8c608fe03530afa900334 parent author J. Longman <longman@foo.com> 2015-05-05 14:40:55 -0400 committer J. Longman <longman@foo.com> 2015-05-05 14:57:20 -0400 CORE-6830 another empty commit - will rewrite branch :000000 100644 0000000000000000000000000000000000000000 5a6b53c58b4df185b955f46b7ffdfb26671242a5 A .gitignore :000000 100644 0000000000000000000000000000000000000000 49d479c60ef90e82eae181f33c6f12ade0a6687d A .gitmodules [...etc] {noformat}

    Jenkins JIRA | 2 years ago | jlongman
    java.lang.reflect.InvocationTargetException
  3. 0

    When the {{changelog.xml}} is missing entries, specifically {{parent}} a giant stacktrace appears in the build page. This also breaks wallboards which call {{fetchJobViews}}. To test, take a changelog and delete the parent SHA1 id, ensure a trailing space is left after {{parent}}, so "parent " as opposed to "parent 8d79986e611a81aa3ace7036b8b52351541604d6". I still don't know why the headers were missing, any information about where the {{changelog.xml}} is generated would be helpful, since a {{git log --pretty=raw $SHA1}} shows the {{parent}} correctly. (I should note that the master is an older git because maintenance is downtime and the slaves are all ansible'ized and up to date.) Created [JENKINS-28291] to track. I should note that this is *NOT* caused by the lack of the Mail plugin being properly configured - [JENKINS-19045] - it is present, enabled and configured: it works fine. {noformat} javax.servlet.ServletException: org.apache.commons.jelly.JellyTagException: jar:file:/usr/home/hudson/hudson/war/WEB-INF/lib/jenkins-core-1.608.jar!/hudson/model/AbstractBuild/index.jelly:67:61: <st:include> No page found 'digest.jelly' for class hudson.matrix.MatrixBuild at org.kohsuke.stapler.jelly.JellyClassTearOff.serveIndexJelly(JellyClassTearOff.java:117) at org.kohsuke.stapler.jelly.JellyFacet.handleIndexRequest(JellyFacet.java:127) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:735) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876) [...] Caused by: org.apache.commons.jelly.JellyTagException: jar:file:/usr/home/hudson/hudson/war/WEB-INF/lib/jenkins-core-1.608.jar!/hudson/model/AbstractBuild/index.jelly:67:61: <st:include> No page found 'digest.jelly' for class hudson.matrix.MatrixBuild at org.kohsuke.stapler.jelly.IncludeTag.doTag(IncludeTag.java:124) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) [...] {noformat} In the jenkins http://jenkins/log/all what appears is: {noformat} Caught exception evaluating: it.changeSet in /job/4.9.1/2/TARGET_ARCH=amd64,label=xipos9/. Reason: java.lang.reflect.InvocationTargetException java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedMethodAccessor357.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) [...] at java.lang.Thread.run(Thread.java:724) Caused by: java.lang.ArrayIndexOutOfBoundsException {noformat} Separately, the {{JiraIssueIndexer}} failed with this stacktrace {noformat} SEVERE: Timer task hudson.plugins.jiraapi.IssueIndexerThread@8e3484d failed java.lang.ArrayIndexOutOfBoundsException: 1 at hudson.plugins.git.GitChangeSet.parseCommit(GitChangeSet.java:104) at hudson.plugins.git.GitChangeSet.<init>(GitChangeSet.java:89) at hudson.plugins.git.GitChangeLogParser.parseCommit(GitChangeLogParser.java:73) at hudson.plugins.git.GitChangeLogParser.parse(GitChangeLogParser.java:57) at hudson.plugins.git.GitChangeLogParser.parse(GitChangeLogParser.java:44) at hudson.plugins.git.GitChangeLogParser.parse(GitChangeLogParser.java:25) at hudson.scm.ChangeLogParser.parse(ChangeLogParser.java:57) at hudson.model.AbstractBuild.calcChangeSet(AbstractBuild.java:906) at hudson.model.AbstractBuild.getChangeSet(AbstractBuild.java:874) at hudson.plugins.jiraapi.index.IssueIndexer.findBuildRelatedIssues(IssueIndexer.java:209) at hudson.plugins.jiraapi.index.IssueIndexer.fullIndex(IssueIndexer.java:171) at hudson.plugins.jiraapi.IssueIndexerThread.doRun(IssueIndexerThread.java:68) at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:51) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [...] at java.lang.Thread.run(Thread.java:724) {noformat} Inspecting these lines: {code:java|title=GitChangeSet.java} if (line.startsWith("commit ")) { this.id = line.split(" ")[1]; } else if (line.startsWith("tree ")) { } else if (line.startsWith("parent ")) { this.parentCommit = line.split(" ")[1]; } else if (line.startsWith(PREFIX_COMMITTER)) { {code} makes it pretty obvious the code is going to fail in these conditions. (Line 104 is actually the line after the "parent " test.) This was verified in a debugger which led to the files being obviously incorrect. Hand editing these {{changelog.xml}} files and adding any value corrects the issue - the {{parent}} attribute is used for {{gitweb}} and not elsewhere from what I can see, so was sufficient to test the theory even if it is not the correct SHA1 and breaks web links. This code lacks [robustness|http://en.wikipedia.org/wiki/Robustness_principle] by assuming the input is correct. A simple patch would test the array length and report an error, I can do it it's more understanding the correct erroring (or ignoring and logging) methods, advice appreciated. An example changelog.xml {noformat:title=changelog.xml} commit 452eada08db501e04f3de9441065bb72728dbc9b tree 9b346ed5ba67deaec8f8c608fe03530afa900334 parent author J. Longman <longman@foo.com> 2015-05-05 14:40:55 -0400 committer J. Longman <longman@foo.com> 2015-05-05 14:57:20 -0400 CORE-6830 another empty commit - will rewrite branch :000000 100644 0000000000000000000000000000000000000000 5a6b53c58b4df185b955f46b7ffdfb26671242a5 A .gitignore :000000 100644 0000000000000000000000000000000000000000 49d479c60ef90e82eae181f33c6f12ade0a6687d A .gitmodules [...etc] {noformat}

    Jenkins JIRA | 2 years ago | jlongman
    java.lang.reflect.InvocationTargetException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    GitHub comment 55#114525197

    GitHub | 2 years ago | robertoschwald
    java.lang.reflect.InvocationTargetException

    1 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.reflect.InvocationTargetException

      No message provided

      at sun.reflect.GeneratedMethodAccessor357.invoke()
    2. Java RT
      Thread.run
      1. sun.reflect.GeneratedMethodAccessor357.invoke(Unknown Source)
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      3. java.lang.reflect.Method.invoke(Method.java:606)[...]
      4. java.lang.Thread.run(Thread.java:724)
      4 frames