Uploaded image for project: 'SR for Jira - Development'
  1. SR for Jira - Development
  2. SRJIRA-5626

Database Picker value length will cause it to not render properly in Dashboard Gadget

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Done
    • Low
    • Resolution: Done
    • 6.36.0
    • 6.44.0
    • None
    • SR4J Sprint 115
    • 1

    Description

      The value length of a Database Picker value will cause it to not render properly in the Pie Chart in a Dashboard and cause the web page to stop working/unresponsive.

      Steps to Reproduce

      1. Create a Database Picker with the following configuration:
        • Web Resource - Local Database Connection
        • Retrieval/validation SQL:
           
          select id, summary from jiraissue 
          where id = cast(? as numeric)
          
        • Search SQL:
           
          select id, summary from jiraissue 
          where lower(summary) like lower(?) || '%'
          
      2. Add it to any screen.
      3. Create any issue and use one of the following tested to have triggered the issue as its Issue Summary:
        • Completed Document: POLICY - Global - Code of Conduct - May 2019.pdf
        • AAAAA BBBBB CCCCC DDDDD EEEEE FFFFF GGGGG IIIII J
      4. In another issue, choose the issue with problematic Summary in your Database Picker. (It should render properly in the Issue View)
      5. Create a Dashboard and add a Pie Chart gadget. Simply set the Pie Chart to use all issues or just the project where the issue resides.
      6. Once done, simply reload the Dashboard.

      Expected Behaviour

      Their values are rendered properly in the Pie Chart and its link is clickable.

      An example where the Summary is just a simple "AAA" and it works fine:

      Actual Behaviour

      The values are not being rendered properly but instead got returned with something like below:

      The page will also become unresponsive and prompt the browser to suggest killing the page.

      Workaround

      No workaround.

      Additional Info

      • Tested on Jira 8.16.0 with PostgreSQL 11.
      • Results:
        ScriptRunner Version Affected?
        v6.11.0
        v6.29.0
        v6.30.0
        v6.35.0
        v6.38.0
      • Screen recording of the issue: Screen Recording 2021-11-07 at 4.39.21 PM.mov
      • Noticed that the stack trace error show only partial. of the full Summary string: "Completed Document: POLICY - Global - Code of Cond"
      • Stack trace:
         
        2021-11-07 16:08:41,354+0800 http-nio-8080-exec-8 WARN admin 968x4785x1 1xd9x5u 0:0:0:0:0:0:0:1 /rest/gadget/1.0/statistics [groovy.sql.Sql] Failed to execute: select id, summary from jiraissue 
            where id = cast(? as numeric) because: ERROR: invalid input syntax for type numeric: "Completed Document: POLICY - Global - Code of Cond"
        2021-11-07 16:08:41,355+0800 http-nio-8080-exec-8 WARN admin 968x4785x1 1xd9x5u 0:0:0:0:0:0:0:1 /rest/gadget/1.0/statistics [groovy.sql.Sql] Failed to execute: select id, summary from jiraissue 
            where id = cast(? as numeric) because: ERROR: invalid input syntax for type numeric: "Completed Document: POLICY - Global - Code of Cond"
        2021-11-07 16:08:41,355+0800 http-nio-8080-exec-8 ERROR admin 968x4785x1 1xd9x5u 0:0:0:0:0:0:0:1 /rest/gadget/1.0/statistics [c.o.s.c.j.f.editable.database.DatabasePicker] Error rendering field customfield_13000 retrieving value: Completed Document: POLICY - Global - Code of Cond
        org.postgresql.util.PSQLException: ERROR: invalid input syntax for type numeric: "Completed Document: POLICY - Global - Code of Cond"
        	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2553)
        	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2285)
        	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:323)
        	at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:473)
        	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:393)
        	at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:164)
        	at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:114)
        	at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:83)
        	at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:83)
        	at com.atlassian.jira.ofbiz.sql.PreparedStatementWrapper.executeQuery(PreparedStatementWrapper.java:42)
        	at com.atlassian.jira.diagnostic.connection.DiagnosticPreparedStatement.lambda$executeQuery$5(DiagnosticPreparedStatement.java:59)
        	at com.atlassian.diagnostics.internal.platform.monitor.db.DefaultDatabaseDiagnosticsCollector.recordExecutionTime(DefaultDatabaseDiagnosticsCollector.java:70)
        	at com.atlassian.jira.diagnostic.connection.DatabaseDiagnosticsCollectorDelegate.recordExecutionTime(DatabaseDiagnosticsCollectorDelegate.java:55)
        	at com.atlassian.jira.diagnostic.connection.DiagnosticPreparedStatement.executeQuery(DiagnosticPreparedStatement.java:59)
        	at groovy.sql.Sql$PreparedQueryCommand.runQuery(Sql.java:4726)
        	at groovy.sql.Sql$AbstractQueryCommand.execute(Sql.java:4654)
        	at groovy.sql.Sql.rows(Sql.java:2020)
        	at groovy.sql.Sql.rows(Sql.java:1950)
        	at groovy.sql.Sql.rows(Sql.java:1794)
        	at groovy.sql.Sql.firstRow(Sql.java:2265)
        	at groovy.sql.Sql$firstRow.call(Unknown Source)
        	at com.onresolve.scriptrunner.canned.jira.fields.editable.database.DatabasePicker$_getViewHtml_closure10$_closure17.doCall(DatabasePicker.groovy:232)
        	... 2 filtered
        	at java.lang.reflect.Method.invoke(Method.java:498)
        	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101)
        	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
        	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:263)
        	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041)
        	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:37)
        	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:127)
        	at com.onresolve.scriptrunner.db.AbstractDbConnectionManager.withSql(AbstractDbConnectionManager.groovy:69)
        	at com.onresolve.scriptrunner.db.AbstractDbConnectionManager$withSql$0.callCurrent(Unknown Source)
        	at com.onresolve.scriptrunner.db.AbstractDbConnectionManager.withSql(AbstractDbConnectionManager.groovy:85)
        	at com.onresolve.scriptrunner.db.DbConnectionManager$withSql.call(Unknown Source)
        	at com.onresolve.scriptrunner.canned.jira.fields.editable.database.DatabasePicker$_getViewHtml_closure10.doCall(DatabasePicker.groovy:230)
        	... 2 filtered
        	at java.lang.reflect.Method.invoke(Method.java:498)
        	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101)
        	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
        	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:263)
        	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041)
        	at groovy.lang.Closure.call(Closure.java:405)
        	at groovy.lang.Closure.call(Closure.java:421)
        	at org.codehaus.groovy.runtime.DefaultGroovyMethods.collect(DefaultGroovyMethods.java:3574)
        	at org.codehaus.groovy.runtime.DefaultGroovyMethods.collect(DefaultGroovyMethods.java:3559)
        	at org.codehaus.groovy.runtime.DefaultGroovyMethods.collect(DefaultGroovyMethods.java:3659)
        	at org.codehaus.groovy.runtime.dgm$87.invoke(Unknown Source)
        	at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:244)
        	at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
        	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:127)
        	at com.onresolve.scriptrunner.canned.jira.fields.editable.database.DatabasePicker.getViewHtml(DatabasePicker.groovy:228)
        	... 2 filtered
        	at java.lang.reflect.Method.invoke(Method.java:498)
        	at org.codehaus.groovy.runtime.callsite.PlainObjectMetaMethodSite.doInvoke(PlainObjectMetaMethodSite.java:43)
        	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:190)
        	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:58)
        	at com.onresolve.scriptrunner.canned.jira.fields.editable.picker.AbstractGenericPicker.getTextOnlyValue(AbstractGenericPicker.groovy:136)
        	at com.onresolve.scriptrunner.canned.jira.fields.editable.picker.GenericPicker$getTextOnlyValue$0.call(Unknown Source)
        	at com.onresolve.scriptrunner.canned.jira.fields.editable.AbstractConfigurablePickerHelper.getTextOnlyValue(AbstractConfigurablePickerHelper.groovy:68)
        	... 2 filtered
        	at java.lang.reflect.Method.invoke(Method.java:498)
        	at org.codehaus.groovy.runtime.callsite.PlainObjectMetaMethodSite.doInvoke(PlainObjectMetaMethodSite.java:43)
        	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.invoke(PogoMetaMethodSite.java:167)
        	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:70)
        	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:151)
        	at com.onresolve.scriptrunner.canned.jira.fields.editable.database.SingleValuePicker.getTextOnlyHtml(SingleValuePicker.groovy:102)
        	at com.onresolve.scriptrunner.canned.jira.fields.editable.CustomFieldViewProvider$getTextOnlyHtml.call(Unknown Source)
        	at com.onresolve.scriptrunner.canned.jira.fields.editable.search.PickerStatisticsMapper.getValueFromLuceneField(PickerStatisticsMapper.groovy:76)
        	at com.onresolve.scriptrunner.canned.jira.fields.editable.search.PickerStatisticsMapper.getValueFromLuceneField(PickerStatisticsMapper.groovy)
        	at com.atlassian.jira.dashboarditem.statistics.service.statistics.searcher.StatisticsSearcher.completeOneDimensionalSearch(StatisticsSearcher.java:92)
        	at com.atlassian.jira.dashboarditem.statistics.service.statistics.searcher.StatisticsSearcher.completeOneDimensionalSearch(StatisticsSearcher.java:76)
        	at com.atlassian.jira.dashboarditem.statistics.service.statistics.StatisticsServiceImpl.aggregateOneDimensionalStats(StatisticsServiceImpl.java:96)
        	at com.atlassian.jira.dashboarditem.statistics.rest.StatisticsResource.oneDimensionalSearchWithJql(StatisticsResource.java:128)
        	at com.atlassian.jira.dashboarditem.statistics.rest.StatisticsResource.oneDimensionalSearch(StatisticsResource.java:77)
        	... 2 filtered
        	at java.lang.reflect.Method.invoke(Method.java:498)
        	... 18 filtered
        	at com.atlassian.plugins.rest.module.RestDelegatingServletFilter$JerseyOsgiServletContainer.doFilter(RestDelegatingServletFilter.java:160)
        	... 1 filtered
        	at com.atlassian.plugins.rest.module.RestDelegatingServletFilter.doFilter(RestDelegatingServletFilter.java:70)
        	... 32 filtered
        	at com.atlassian.servicedesk.internal.web.ExternalCustomerLockoutFilter.doFilter(ExternalCustomerLockoutFilter.java:55)
        	... 8 filtered
        	at com.atlassian.jira.plugin.mobile.web.filter.MobileAppRequestFilter.doFilter(MobileAppRequestFilter.java:59)
        	... 4 filtered
        	at com.atlassian.jira.plugin.mobile.login.MobileLoginSuccessFilter.doFilter(MobileLoginSuccessFilter.java:54)
        	... 3 filtered
        	at com.atlassian.diagnostics.internal.platform.monitor.http.HttpRequestMonitoringFilter.doFilter(HttpRequestMonitoringFilter.java:55)
        	... 8 filtered
        	at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21)
        	... 43 filtered
        	at com.atlassian.ratelimiting.internal.filter.RateLimitFilter.doFilter(RateLimitFilter.java:73)
        	... 21 filtered
        	at com.atlassian.jira.security.JiraSecurityFilter.lambda$doFilter$0(JiraSecurityFilter.java:66)
        	... 1 filtered
        	at com.atlassian.jira.security.JiraSecurityFilter.doFilter(JiraSecurityFilter.java:64)
        	... 16 filtered
        	at com.atlassian.plugins.rest.module.servlet.RestSeraphFilter.doFilter(RestSeraphFilter.java:38)
        	... 3 filtered
        	at com.atlassian.pats.web.filter.TokenBasedAuthenticationFilter.doFilter(TokenBasedAuthenticationFilter.java:83)
        	... 19 filtered
        	at com.atlassian.jira.servermetrics.CorrelationIdPopulatorFilter.doFilter(CorrelationIdPopulatorFilter.java:30)
        	... 5 filtered
        	at com.atlassian.plugins.authentication.impl.basicauth.filter.DisableBasicAuthFilter.doFilter(DisableBasicAuthFilter.java:70)
        	... 3 filtered
        	at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.lambda$invokeFilterChain$0(CustomerContextSettingFilter.java:215)
        	at com.atlassian.servicedesk.internal.api.util.context.ReentrantThreadLocalBasedCodeContext.rteInvoke(ReentrantThreadLocalBasedCodeContext.java:136)
        	at com.atlassian.servicedesk.internal.api.util.context.ReentrantThreadLocalBasedCodeContext.runOutOfContext(ReentrantThreadLocalBasedCodeContext.java:89)
        	at com.atlassian.servicedesk.internal.utils.context.CustomerContextServiceImpl.runOutOfCustomerContext(CustomerContextServiceImpl.java:47)
        	at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.outOfCustomerContext(CustomerContextSettingFilter.java:206)
        	at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.doFilterImpl(CustomerContextSettingFilter.java:134)
        	at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.doFilter(CustomerContextSettingFilter.java:123)
        	... 4 filtered
        	at com.atlassian.jwt.internal.servlet.JwtAuthFilter.doFilter(JwtAuthFilter.java:37)
        	... 8 filtered
        	at com.atlassian.ratelimiting.internal.filter.RateLimitPreAuthFilter.doFilter(RateLimitPreAuthFilter.java:71)
        	... 3 filtered
        	at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21)
        	... 4 filtered
        	at com.atlassian.web.servlet.plugin.LocationCleanerFilter.doFilter(LocationCleanerFilter.java:36)
        	... 7 filtered
        	at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:239)
        	at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:215)
        	at net.bull.javamelody.PluginMonitoringFilter.doFilter(PluginMonitoringFilter.java:88)
        	at net.bull.javamelody.JiraMonitoringFilter.doFilter(JiraMonitoringFilter.java:137)
        	... 22 filtered
        	at com.atlassian.jira.servermetrics.MetricsCollectorFilter.doFilter(MetricsCollectorFilter.java:25)
        	... 25 filtered
        	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)
        

      Update added 02 Dec 2021:

      Two Dimensional Filter Statistics seems to be affected as well, simply set the Database Picker as its XAxis or YAxis.

      Attachments

        Issue Links

          Activity

            People

              wsignoretti Wagner Signoretti
              bkek Benz Kek
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: