Error during invocation of method 'getHtml' in class jigit.tabpanels.JigitTabAction

Issue #1 resolved
Sergio Carrascoso Nogales created an issue

When trying to see the Jigit tab view on some Jira issues, there is an error complaining about:

An error occurred whilst rendering this message. Please contact the administrators, and inform them of this bug. 
Details: ------- org.apache.velocity.exception.MethodInvocationException: Invocation of method 'renderActivityModule' 
in class com.atlassian.jira.plugin.issuenav.IssueNavAction threw exception com.atlassian.templaterenderer.RenderingException:
org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getHtml' 
in class jigit.tabpanels.JigitTabAction threw exception java.lang.reflect.UndeclaredThrowableException at viewissue/activityblock.vm[line 58, column 27]...

In the Jira instance logs I can see a similar error:

2017-07-06 18:02:40,207 http-nio-8080-exec-5 ERROR 1082x1960444x3 fnx6ke  [c.atlassian.velocity.DefaultVelocityManager] MethodInvocationException occurred getting message body from Velocity: com.atlassian.templaterenderer.RenderingException: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getHtml' in  class jigit.tabpanels.JigitTabAction threw exception java.lang.reflect.UndeclaredThrowableException at viewissue/activityblock.vm[line 58, column 27]
com.atlassian.templaterenderer.RenderingException: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getHtml' in  class jigit.tabpanels.JigitTabAction threw exception java.lang.reflect.UndeclaredThrowableException at viewissue/activityblock.vm[line 58, column 27]
    at com.atlassian.templaterenderer.velocity.one.six.internal.VelocityTemplateRendererImpl.render(VelocityTemplateRendererImpl.java:109)
    at com.atlassian.templaterenderer.velocity.AbstractCachingWebPanelRenderer.render(AbstractCachingWebPanelRenderer.java:53)
    at com.atlassian.plugin.web.model.ResourceTemplateWebPanel.writeHtml(ResourceTemplateWebPanel.java:50)
    at com.atlassian.plugin.web.model.ResourceTemplateWebPanel.getHtml(ResourceTemplateWebPanel.java:65)
    at com.atlassian.plugin.web.descriptors.DefaultWebPanelModuleDescriptor$ContextAwareWebPanel.getHtml(DefaultWebPanelModuleDescriptor.java:144)
    at com.atlassian.jira.plugin.issuenav.IssueNavAction.renderActivityModule(IssueNavAction.java:660)
    ... 2 filtered

I have included the full error traces as attachments, as they are really long.

I can confirm that the plugin works fine in other Jira issues (it only fails for some of them). I would say the pattern seems to be issues that do not have a commit to be displayed in the plugin tab, but that partially match other commits, for example:

  • JIRA-15 has no commits, it displays fine with no errors
  • JIRA-16 has no commits, it triggers the error; coincidentally, there are commits for issue JIRA-161 (or 162, 163...)

Any help will be appreciated.

Comments (17)

  1. Dmitrii Apanasevich repo owner

    Hi!

    As I see from logs you use Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production. Is it correct?

    Which Jira version do you use?

    EDIT: Could you, please, take a look at Oracle log? It can contains some errors, and they would be very useful. They could have been occurred near the 2017-07-06 18:02:40

  2. Sergio Carrascoso Nogales reporter

    Hi!

    Yes, it is correct. These are the Jira details:

    • Version: 7.1.4
    • Build Number: 71008

    Thanks.

  3. Dmitrii Apanasevich repo owner

    Is there any news?

    Please, enable additional logging as desrcibed here: https://developer.atlassian.com/docs/atlassian-platform-common-components/active-objects/developing-your-plugin-with-active-objects/active-objects-faq/enabling-sql-logging. You should go to Administration - System - Logging and profiling and switch logging level of net.java.ao.sql to DEBUG.

    And then reproduce the bug and send me related rows from %JIRA_HOME%\log\atlassian-jira.log.

    Actually, there is a problem on DB side. But I still can't understand where a mistake is. I'll to try to reproduce it with Oracle 10g, because I can't do it with HSQL, Postgresql and MySql.

  4. Sergio Carrascoso Nogales reporter

    Thanks for the link. I did that already, but wasn't able to get any specific error in the sql logs (that's why I haven't sent anything yet). I can send some traces, though, so you can inspect.

  5. Dmitrii Apanasevich repo owner

    I did that already, but wasn't able to get any specific error in the sql logs

    It can contain no errors, but I'm interested in SQL queries that JIRA generates to DBMS. Something like following:

    SELECT ...
    FROM ... as commit JOIN ... as commit_issue ON commit.ID = commit_issue.COMMIT_ID
    

    Please, send me such information, if you find it.

  6. Sergio Carrascoso Nogales reporter

    Regarding the pattern that the error is following... I think it can be extended with:

    • JIRA-16 has no commits, it triggers the error; coincidentally, there are commits for issue JIRA-161 (or 162, 163...), or Jira-116 (or 216, 316...)
  7. Dmitrii Apanasevich repo owner

    Unfortunately, the log you attached doesn't contain queries from Jigit. It should contain at least commit_issue table alias, because it's a part of code. Please, try to reproduce bug with SQL logging turned on.

    I've tested plugin with Oracle 10g and it works without errors. So, we need to go deeper ).

    • What JDBC driver do you use?

    JIRA-16 has no commits, it triggers the error; coincidentally, there are commits for issue JIRA-161 (or 162, 163...)

    • Does the plugin show commits for JIRA-161?
  8. Dmitrii Apanasevich repo owner

    One more thing: please, send me an email to apanasevich.d@gmail.com and I'll answer with a special version, which probably fixes the bug. It based on some suggestions from stacktrace you provided.

  9. Sergio Carrascoso Nogales reporter
    • What JDBC driver do you use? oracle.jdbc.OracleDriver
    • Does the plugin show commits for JIRA-161? Yes, the plugin shows them fine

    I'll try to provide sql logs with more details.

  10. Dmitrii Apanasevich repo owner

    Hi Sergio!

    Finally, I've reproduced the bug and fixed an issue. Unfortunatelly, it wasn't covered by any test. Now such a test exists. It was connected with the change history of issue key field. Has JIRA-16 issue ever changed its key? I think, it has, and this caused the problem due to my bug.

    I've attached a new plugin version. You should go to "Administration"/"Add-ons"/"Manage Add-ons" menu and install it via "Upload add-on" button. Please, check if it works on the problematic JIRA-16 issue. If so, I'll release it on Atlassian Marketplace under the version 1.0.2.

  11. Sergio Carrascoso Nogales reporter

    Thank you very much for the quick fix! I'll test this as soon as possible.

  12. Sergio Carrascoso Nogales reporter

    I have tested the plugin with a few of the known issues, and they all work fine. Also, I can confirm that these issues had been changed its project in the past (and hence their key). Thanks a lot!

  13. Log in to comment