DataTables ajax error with shinyproxy v. 2.4.1

Was wondering if anyone has any suggestions for getting DataTables to work when delivering ShinyProxy v. 2.4.1 with Kubernetes via an NGINX ingress controller.

We are getting an error message: DataTables warning: table id=DataTables_Table_1 - Ajax error. For more information about this error, please see http://datatables.net/tn/7, and the DataTable has column names, but no data.

Our config.
We are running shinyproxy (2.4.1) from a Kubernetes cluster with an NGINX ingress controller. We have set NGINX to have “sticky sessions.” Authentication is being handled by openID and Azure Active Directory.

The config works with shinyproxy 2.3.1. We would just revert back to 2.3.1 but we need the kubernetes-pod-patches from 2.4.1 to mount a Persistent Volume to our cluster.

Below are copies of our application.yml and the relevant parts of the logs from shinyproxy.

application.yml:

proxy:
    container-wait-time: 60000 
    port: 8080
    authentication: openid
    openid:
        auth-url: https://login.microsoftonline.com/REDACTED/oauth2/authorize
        token-url: https://login.microsoftonline.com/REDACTED/oauth2/token
        jwks-url: https://login.microsoftonline.com/common/discovery/keys
        client-id: REDACTED
        client-secret: "REDACTED"
    container-backend: kubernetes
    kubernetes:
      internal-networking: true
      url: http://localhost:8001
      image-pull-policy: Always
      image-pull-secret: REDACTED
    specs:
    - id: 01_hello
      display-name: Hello Application
      description: Application which demonstrates the basics of a Shiny app
      container-cmd: ["R", "-e", "shinyproxy::run_01_hello()"]
      container-image: openanalytics/shinyproxy-demo
    - id: debug_app
      display-name: debug DT app
      description: Tiny app for debugging DataTables
      container-cmd: ["R", "-e", "shiny::runApp('/srv/shiny-server/debug_app/')"] # 
      container-image: shinyrepo.azurecr.io/debug_dt
server:
    useForwardHeaders: true
    container-protocol: http

image

Here are the logs from shinyproxy:
2020-11-18 05:15:32.419 INFO 1 — [ XNIO-1 task-3] e.o.containerproxy.service.ProxyService : Proxy activated [user: smlehman@gmail.com] [spec: debug_app] [id: ea94d85a-0983-492d-b4c9-876bba434b19]
2020-11-18 05:15:33.226 ERROR 1 — [ XNIO-1 I/O-1] io.undertow.proxy : UT005028: Proxy request to /proxy_endpoint/ea94d85a-0983-492d-b4c9-876bba434b19/session/cda0314d18ef8f62a2a0d149b2c0e7fd/dataobj/dtTable failed

io.undertow.server.TruncatedResponseException: null
        at io.undertow.client.http.HttpRequestConduit.truncateWrites(HttpRequestConduit.java:711) ~[undertow-core-2.1.4.Final.jar!/:2.1.4.Final]
        at io.undertow.conduits.AbstractFixedLengthStreamSinkConduit.terminateWrites(AbstractFixedLengthStreamSinkConduit.java:256) ~[undertow-core-2.1.4.Final.jar!/:2.1.4.Final]
        at org.xnio.conduits.ConduitStreamSinkChannel.shutdownWrites(ConduitStreamSinkChannel.java:178) ~[xnio-api-3.8.0.Final.jar!/:3.8.0.Final]
        at io.undertow.channels.DetachableStreamSinkChannel.shutdownWrites(DetachableStreamSinkChannel.java:79) ~[undertow-core-2.1.4.Final.jar!/:2.1.4.Final]
        at io.undertow.server.handlers.proxy.ProxyHandler$HTTPTrailerChannelListener.handleEvent(ProxyHandler.java:754) ~[undertow-core-2.1.4.Final.jar!/:2.1.4.Final]
        at io.undertow.server.handlers.proxy.ProxyHandler$ProxyAction$1.completed(ProxyHandler.java:646) ~[undertow-core-2.1.4.Final.jar!/:2.1.4.Final]
        at io.undertow.server.handlers.proxy.ProxyHandler$ProxyAction$1.completed(ProxyHandler.java:561) ~[undertow-core-2.1.4.Final.jar!/:2.1.4.Final]
        at io.undertow.client.http.HttpClientExchange.invokeReadReadyCallback(HttpClientExchange.java:212) ~[undertow-core-2.1.4.Final.jar!/:2.1.4.Final]
        at io.undertow.client.http.HttpClientConnection.initiateRequest(HttpClientConnection.java:414) ~[undertow-core-2.1.4.Final.jar!/:2.1.4.Final]
        at io.undertow.client.http.HttpClientConnection.sendRequest(HttpClientConnection.java:347) ~[undertow-core-2.1.4.Final.jar!/:2.1.4.Final]
        at io.undertow.server.handlers.proxy.ProxyHandler$ProxyAction.run(ProxyHandler.java:561) ~[undertow-core-2.1.4.Final.jar!/:2.1.4.Final]
        at io.undertow.util.SameThreadExecutor.execute(SameThreadExecutor.java:35) ~[undertow-core-2.1.4.Final.jar!/:2.1.4.Final]
        at io.undertow.server.HttpServerExchange.dispatch(HttpServerExchange.java:821) ~[undertow-core-2.1.4.Final.jar!/:2.1.4.Final]
        at io.undertow.server.handlers.proxy.ProxyHandler$ProxyClientHandler.completed(ProxyHandler.java:316) ~[undertow-core-2.1.4.Final.jar!/:2.1.4.Final]
        at io.undertow.server.handlers.proxy.ProxyHandler$ProxyClientHandler.completed(ProxyHandler.java:290) ~[undertow-core-2.1.4.Final.jar!/:2.1.4.Final]
        at io.undertow.server.handlers.proxy.ProxyConnectionPool.connectionReady(ProxyConnectionPool.java:353) ~[undertow-core-2.1.4.Final.jar!/:2.1.4.Final]
        at io.undertow.server.handlers.proxy.ProxyConnectionPool.connect(ProxyConnectionPool.java:548) ~[undertow-core-2.1.4.Final.jar!/:2.1.4.Final]
        at io.undertow.server.handlers.proxy.LoadBalancingProxyClient.getConnection(LoadBalancingProxyClient.java:316) ~[undertow-core-2.1.4.Final.jar!/:2.1.4.Final]
        at eu.openanalytics.containerproxy.util.ProxyMappingManager$1.getConnection(ProxyMappingManager.java:88) ~[containerproxy-0.8.5.jar!/:0.8.5]
        at io.undertow.server.handlers.proxy.ProxyHandler$ProxyClientHandler.run(ProxyHandler.java:310) ~[undertow-core-2.1.4.Final.jar!/:2.1.4.Final]
        at org.xnio.nio.WorkerThread.safeRun(WorkerThread.java:612) ~[xnio-nio-3.8.0.Final.jar!/:3.8.0.Final]
        at org.xnio.nio.WorkerThread.run(WorkerThread.java:479) ~[xnio-nio-3.8.0.Final.jar!/:3.8.0.Final]

2020-11-18 05:16:52.454  INFO 1 --- [tiveProxyKiller] e.o.c.service.HeartbeatService           : Releasing inactive proxy [user: smlehman@gmail.com] [spec: debug_app] [id: ea94d85a-0983-492d-b4c9-876bba434b19] [silence: 66451ms]
2020-11-18 05:16:52.480  INFO 1 --- [pool-2-thread-1] e.o.containerproxy.service.ProxyService  : Proxy released [user: smlehman@gmail.com] [spec: debug_app] [id: ea94d85a-0983-492d-b4c9-876bba434b19]
2020-11-18 05:16:54.575 ERROR 1 --- [   XNIO-1 I/O-1] io.undertow.proxy                        : UT005028: Proxy request to /proxy_endpoint/ea94d85a-0983-492d-b4c9-876bba434b19/session/cda0314d18ef8f62a2a0d149b2c0e7fd/dataobj/dtTable failed

java.io.IOException: UT001000: Connection closed
        at io.undertow.client.http.HttpClientConnection$ClientReadListener.handleEvent(HttpClientConnection.java:581) ~[undertow-core-2.1.4.Final.jar!/:2.1.4.Final]
        at io.undertow.client.http.HttpClientConnection$ClientReadListener.handleEvent(HttpClientConnection.java:516) ~[undertow-core-2.1.4.Final.jar!/:2.1.4.Final]
        at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92) ~[xnio-api-3.8.0.Final.jar!/:3.8.0.Final]
        at org.xnio.conduits.ReadReadyHandler$ChannelListenerHandler.readReady(ReadReadyHandler.java:66) ~[xnio-api-3.8.0.Final.jar!/:3.8.0.Final]
        at org.xnio.nio.NioSocketConduit.handleReady(NioSocketConduit.java:89) ~[xnio-nio-3.8.0.Final.jar!/:3.8.0.Final]
        at org.xnio.nio.WorkerThread.run(WorkerThread.java:591) ~[xnio-nio-3.8.0.Final.jar!/:3.8.0.Final]

Hi

We have a similar setup, with ShinyProxy running on Kubernetes with nginx ingress controller, which is working fine.

However, there is a small problem with ShinyProxy 2.4.1 and DataTables when you enable debug logging in ShinyProxy. I don’t see this in your config, but maybe you actually have it enabled. If so, you have to exclude a specific class using the following configuration:

logging:
  level:
     root: DEBUG
     org:
        springframework:
           web:
              servlet:
                 DispatcherServlet: INFO

I hope this solves your issue too!

Thanks for the suggestion. We saw that there was an issue (140) with logging on github.

I have tried adding the logging code that @LEDfan had suggested, as well as completely eliminating logging (as per the application.yml I copied in the post). I should have mentioned that we’ve already explored that possibility.

Really appreciate your thoughts.
Steve