Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue in viewing the dashboard after creating a report #152

Open
reshmabidikar opened this issue Jun 21, 2023 · 3 comments
Open

Issue in viewing the dashboard after creating a report #152

reshmabidikar opened this issue Jun 21, 2023 · 3 comments

Comments

@reshmabidikar
Copy link
Contributor

Steps to reproduce:

  1. Start Kill Bill via Docker with the following versions: killbill/killbill:0.24.2, killbill/kaui:2.0.11, killbill/mariadb:0.24
  2. Install the analytics plugin by clicking the plug icon in Kaui.
  3. Execute the Analytics DDL.
  4. Start the analytics plugin.
  5. Click on the plug icon --> Analytics link - The analytics dashboard can be accessed in Kaui as expected.
  6. Execute calendar.sql
  7. Create the active_by_product_term_monthly report as follows:
    1. Execute v_report_active_by_product_term_monthly.ddl to create the view.
    2. Execute report_active_by_product_term_monthly.ddl to create the database table and stored procedure
    3. Click on the plug icon --> Analytics link - The analytics dashboard can be accessed in Kaui as expected.
    4. Run the following cURL to create the report:
    curl -v \
     -X POST \
     -u admin:password \
     -H "X-Killbill-ApiKey:bob" \
     -H "X-Killbill-ApiSecret:lazar" \
     -H 'Content-Type: application/json' \
     -d '{"reportName": "report_active_by_product_term_monthly",
          "reportPrettyName": "Monthly active subscriptions",
          "sourceTableName": "report_active_by_product_term_monthly",
          "refreshProcedureName": "refresh_report_active_by_product_term_monthly",
          "refreshFrequency": "DAILY",
          "refreshHourOfDayGmt": 4}' \
     "http://127.0.0.1:8081/plugins/killbill-analytics/reports"
    
  8. Click on the plug icon --> Analytics link - The analytics dashboard is inaccessible. The following screen is seen:
image
  1. The following stack trace is seen in the Kill Bill logs:
Route:
      | Method | Path     | Source                                                         | Name                   | Pattern  | Consumes | Produces           |
      |--------|----------|----------------------------------------------------------------|------------------------|----------|----------|--------------------|
      | GET    | /reports | org.killbill.billing.plugin.analytics.http.ReportsResource:142 | /ReportsResource.doGet | /reports | [*/*]    | [application/json] |

Stacktrace:
org.jooby.Err: Server Error(500)
        at org.jooby.internal.HttpHandlerImpl.handleErr(HttpHandlerImpl.java:589)
        at org.jooby.internal.HttpHandlerImpl.cleanup(HttpHandlerImpl.java:562)
        at org.jooby.internal.HttpHandlerImpl.handle(HttpHandlerImpl.java:504)
        at org.killbill.billing.plugin.core.JoobyServlet.service(JoobyServlet.java:61)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:583)
        at jdk.internal.reflect.GeneratedMethodAccessor123.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.killbill.billing.osgi.ContextClassLoaderHelper$ClassLoaderInvocationHandler$1.execute(ContextClassLoaderHelper.java:146)
        at org.killbill.commons.profiling.Profiling.executeWithProfiling(Profiling.java:35)
        at org.killbill.billing.osgi.ContextClassLoaderHelper$ClassLoaderInvocationHandler.handleInvocation(ContextClassLoaderHelper.java:143)
        at org.killbill.commons.utils.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:91)
        at com.sun.proxy.$Proxy299.service(Unknown Source)
        at org.killbill.billing.osgi.http.OSGIServlet.serviceViaPlugin(OSGIServlet.java:89)
        at org.killbill.billing.osgi.http.OSGIServlet.doGet(OSGIServlet.java:52)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:489)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:583)
        at org.killbill.billing.jaxrs.resources.PluginResource.serviceViaOSGIPlugin(PluginResource.java:217)
        at org.killbill.billing.jaxrs.resources.PluginResource.serviceViaOSGIPlugin(PluginResource.java:176)
        at org.killbill.billing.jaxrs.resources.PluginResource.doGET(PluginResource.java:120)
        at jdk.internal.reflect.GeneratedMethodAccessor122.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:134)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:177)
        at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:176)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:81)
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:478)
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:400)
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:81)
        at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:256)
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:248)
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:244)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:244)
        at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:265)
        at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:235)
        at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:684)
        at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:394)
        at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:346)
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:358)
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:311)
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:205)
        at com.google.inject.servlet.ServletDefinition.doServiceImpl(ServletDefinition.java:290)
        at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:280)
        at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:184)
        at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:89)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:85)
        at org.killbill.billing.server.security.TenantFilter.doFilter(TenantFilter.java:109)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
        at org.killbill.billing.server.filters.ResponseCorsFilter.doFilter(ResponseCorsFilter.java:76)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
        at ch.qos.logback.classic.helpers.MDCInsertingServletFilter.doFilter(MDCInsertingServletFilter.java:49)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
        at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:121)
        at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:133)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:181)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:156)
        at org.apache.shiro.guice.web.SimpleFilterChain.doFilter(SimpleFilterChain.java:44)
        at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
        at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
        at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:154)
        at org.apache.shiro.guice.web.SimpleFilterChain.doFilter(SimpleFilterChain.java:41)
        at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
        at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
        at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:154)
        at org.apache.shiro.guice.web.SimpleFilterChain.doFilter(SimpleFilterChain.java:41)
        at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:458)
        at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:373)
        at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
        at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
        at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:387)
        at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:370)
        at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:154)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:181)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:156)
        at org.killbill.commons.metrics.servlets.InstrumentedFilter.doFilter(InstrumentedFilter.java:139)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:181)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:156)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:483)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:130)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93)
        at org.apache.catalina.valves.rewrite.RewriteValve.invoke(RewriteValve.java:305)
        at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:682)
        at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:768)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
        at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:617)
        at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
        at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:932)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1695)
        at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
        at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
        at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.AbstractMethodError: Receiver class net.sf.log4jdbc.sql.jdbcapi.ConnectionSpy does not define or inherit an implementation of the resolved method 'abstract java.lang.String getSchema()' of interface java.sql.Connection.
        at org.killbill.billing.plugin.analytics.reports.sql.Metadata$2.run(Metadata.java:212)
        at org.killbill.billing.plugin.analytics.reports.sql.Metadata$2.run(Metadata.java:209)
        at org.jooq.impl.DefaultDSLContext.connectionResult(DefaultDSLContext.java:656)
        at org.killbill.billing.plugin.analytics.reports.sql.Metadata.getSchemaName(Metadata.java:209)
        at org.killbill.billing.plugin.analytics.reports.sql.Metadata.getTable(Metadata.java:86)
        at org.killbill.billing.plugin.analytics.reports.ReportsUserApi$3.apply(ReportsUserApi.java:186)
        at org.killbill.billing.plugin.analytics.reports.ReportsUserApi$3.apply(ReportsUserApi.java:181)
        at com.google.common.collect.Lists$TransformingRandomAccessList.get(Lists.java:612)

Additional Notes: The issue only occurs when Kill Bill is run in Docker. It is not reproducible when Kill Bill runs within Tomcat.

@reshmabidikar
Copy link
Contributor Author

Update: The issue is reproducible while creating any report. For example, the issue also occurs when a report is created using the steps mentioned here.

@reshmabidikar reshmabidikar changed the title Issue in viewing the dashboard after creating certain canned reports Issue in viewing the dashboard after creating a report Jun 21, 2023
@reshmabidikar
Copy link
Contributor Author

The issue occurs because the log4jdbc library does not implement the getSchema / setSchema methods. See arthurblake/log4jdbc@b827dd1#diff-8557b1f4c307ea88b761b1f25bb57665d58bc030b6ccf21a07388ab669567123R942

@reshmabidikar
Copy link
Contributor Author

Update: A workaround is to disable the log4jdbc in the Kill Bill docker image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant