通过Scala Play Framework和JDBC在Druid SQL查询中传递JavaScript时遇到HTTP/502错误

ecbunoof  于 12个月前  发布在  Scala
关注(0)|答案(1)|浏览(208)

我在Scala Play Framework应用程序中遇到了一个问题,该问题使用JDBC向Druid发送SQL查询。当我尝试使用预处理语句执行包含表情符号(例如,ESTA)的Druid SQL查询时,我遇到了HTTP/502错误。具体的错误消息是:🥰
“java.lang.RuntimeException:无法执行HTTP请求,获取HTTP/502。”
版本:

  • play-framework:2.8.16

java:11
Druid:25
Avatica-core:1.17.0*
下面是一个API响应:

{
    "error": {
        "id": "83h6dee8l",
        "requestId": 1,
        "exception": {
            "title": "Execution exception",
            "description": "[SQLException: while preparing SQL: SELECT added, comment FROM sample_data_test WHERE (__time BETWEEN TIMESTAMP '2009-10-24 00:00:00' AND TIMESTAMP '2023-10-25 00:00:00') AND comment IN ('🥰SHAE_BAE_BIIHHH🥰', 'test comment') GROUP BY added, comment, channel ORDER BY lower(channel) DESC LIMIT 15 OFFSET 0]",
            "stacktrace": [
                "java.sql.SQLException: while preparing SQL: SELECT added, comment FROM sample_data_test WHERE (__time BETWEEN TIMESTAMP '2009-10-24 00:00:00' AND TIMESTAMP '2023-10-25 00:00:00') AND comment IN ('🥰SHAE_BAE_BIIHHH🥰', 'test comment') GROUP BY added, comment, channel ORDER BY lower(channel) DESC LIMIT 15 OFFSET 0",
                "at org.apache.calcite.avatica.Helper.createException(Helper.java:56)",
                "at org.apache.calcite.avatica.Helper.createException(Helper.java:41)",
                "at org.apache.calcite.avatica.AvaticaConnection.prepareStatement(AvaticaConnection.java:358)",
                "at org.apache.calcite.avatica.AvaticaConnection.prepareStatement(AvaticaConnection.java:175)",
                "at com.zaxxer.hikari.pool.ProxyConnection.prepareStatement(ProxyConnection.java:337)",
                "at com.zaxxer.hikari.pool.HikariProxyConnection.prepareStatement(HikariProxyConnection.java)",
                "at v2.druid.DruidQueryServiceImpl.$anonfun$getQueryDataV2$1(DruidQueryServiceImpl.scala:53)",
                "at play.api.db.DefaultDatabase.withConnection(Databases.scala:180)",
                "at play.api.db.DefaultDatabase.withConnection(Databases.scala:174)",
                "at v2.druid.DruidQueryServiceImpl.getQueryDataV2(DruidQueryServiceImpl.scala:46)",
                "at v2.druid.DruidQueryController.$anonfun$getData$11(DruidQueryController.scala:41)",
                "at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:678)",
                "at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:467)",
                "at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:63)",
                "at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:100)",
                "at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)",
                "at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:94)",
                "at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:100)",
                "at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:49)",
                "at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:48)",
                "at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)",
                "at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)",
                "at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)",
                "at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)",
                "at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)",
                "Caused by: java.lang.RuntimeException: Failed to execute HTTP Request, got HTTP/502",
                "at org.apache.calcite.avatica.remote.AvaticaCommonsHttpClientImpl.send(AvaticaCommonsHttpClientImpl.java:131)",
                "at org.apache.calcite.avatica.remote.RemoteService.apply(RemoteService.java:34)",
                "at org.apache.calcite.avatica.remote.JsonService.apply(JsonService.java:124)",
                "at org.apache.calcite.avatica.remote.RemoteMeta$12.call(RemoteMeta.java:241)",
                "at org.apache.calcite.avatica.remote.RemoteMeta$12.call(RemoteMeta.java:237)",
                "at org.apache.calcite.avatica.AvaticaConnection.invokeWithRetries(AvaticaConnection.java:793)",
                "at org.apache.calcite.avatica.remote.RemoteMeta.prepare(RemoteMeta.java:236)",
                "at org.apache.calcite.avatica.AvaticaConnection.prepareStatement(AvaticaConnection.java:354)",
                "... 22 more"
            ]
        }
    }
}

字符串
这是Druid的日志:
org.eclipse.jetty.http.BadMessageException:500:不正确的内容长度390!=374

router           | 2023-11-14T11:33:17,460 DEBUG [qtp633514467-64] org.eclipse.jetty.client.HttpSender - Request begin HttpRequest[POST /druid/v2/sql/avatica/ HTTP/1.1]@1da392d3
router           | 2023-11-14T11:33:17,460 DEBUG [qtp633514467-64] org.eclipse.jetty.client.HttpSender - Request headers HttpRequest[POST /druid/v2/sql/avatica/ HTTP/1.1]@1da392d3
router           | User-Agent: Apache-HttpClient/4.5.13 (Java/11.0.20.1)
router           | Accept-Encoding: gzip,deflate
router           | Content-Length: 374
router           | Content-Type: application/octet-stream
router           | Via: 1.1 c9d73fa9f3a2
router           | X-Forwarded-For: 192.168.192.1
router           | X-Forwarded-Proto: http
router           | X-Forwarded-Host: localhost:8888
router           | X-Forwarded-Server: 192.168.192.8
router           | Host: 192.168.192.9:8082
router           | 2023-11-14T11:33:17,460 DEBUG [qtp633514467-64] org.eclipse.jetty.client.HttpContent - Advanced content to last chunk java.nio.HeapByteBuffer[pos=0 lim=390 cap=390]
broker           | 2023-11-14T11:33:17,465 DEBUG [qtp213850519-111] org.eclipse.jetty.util.thread.QueuedThreadPool - queue ReservedThreadExecutor@517fbf62{s=0/6,p=1}@542acfc3 startThread=0
router           | 2023-11-14T11:33:17,460 DEBUG [qtp633514467-64] org.eclipse.jetty.client.HttpSender - Generated headers (-1 bytes), chunk (-1 bytes), content (390 bytes) - NEED_HEADER/HttpGenerator@4c4c177{s=START}
broker           | 2023-11-14T11:33:17,465 DEBUG [qtp213850519-121] org.eclipse.jetty.util.thread.QueuedThreadPool - run ReservedThreadExecutor@517fbf62{s=0/6,p=1}@542acfc3 in QueuedThreadPool[qtp213850519]@cbf1997{STARTED,68<=68<=68,i=61,r=-1,q=0}[ReservedThreadExecutor@517fbf62{s=0/6,p=1}]
broker           | 2023-11-14T11:33:17,465 DEBUG [qtp213850519-121] org.eclipse.jetty.util.thread.ReservedThreadExecutor - ReservedThreadExecutor@517fbf62{s=1/6,p=1}@542acfc3 started
broker           | 2023-11-14T11:33:17,465 DEBUG [qtp213850519-121] org.eclipse.jetty.util.thread.ReservedThreadExecutor - ReservedThreadExecutor@517fbf62{s=1/6,p=0}@542acfc3 waiting
broker           | 2023-11-14T11:33:17,466 DEBUG [qtp213850519-118] org.eclipse.jetty.util.thread.ReservedThreadExecutor - ReservedThreadExecutor@517fbf62{s=0/6,p=1}@3b859d06 task=EatWhatYouKill@6d80e411/SelectorProducer@45f0038/IDLE/p=true/QueuedThreadPool[qtp213850519]@cbf1997{STARTED,68<=68<=68,i=61,r=-1,q=0}[ReservedThreadExecutor@517fbf62{s=1/6,p=0}][pc=0,pic=0,pec=1,epc=0]@2023-11-14T11:33:17.466Z
broker           | 2023-11-14T11:33:17,466 DEBUG [qtp213850519-118] org.eclipse.jetty.util.thread.strategy.EatWhatYouKill - EatWhatYouKill@6d80e411/SelectorProducer@45f0038/IDLE/p=true/QueuedThreadPool[qtp213850519]@cbf1997{STARTED,68<=68<=68,i=61,r=-1,q=0}[ReservedThreadExecutor@517fbf62{s=1/6,p=0}][pc=0,pic=0,pec=1,epc=0]@2023-11-14T11:33:17.466Z tryProduce true
broker           | 2023-11-14T11:33:17,466 DEBUG [qtp213850519-118] org.eclipse.jetty.io.ManagedSelector - updateable 0
router           | 2023-11-14T11:33:17,460 DEBUG [qtp633514467-64] org.eclipse.jetty.http.HttpGenerator - generateHeaders POST{u=/druid/v2/sql/avatica/,HTTP/1.1,h=10,cl=390} last=true content=HeapByteBuffer@6a77fca[p=0,l=390,c=390,r=390]={<<<{"request":"prepare","con...ET 0","maxRowCount":-1}>>>}
router           | 2023-11-14T11:33:17,460 DEBUG [qtp633514467-64] org.eclipse.jetty.http.HttpGenerator - User-Agent: Apache-HttpClient/4.5.13 (Java/11.0.20.1)
router           | Accept-Encoding: gzip,deflate
router           | Content-Length: 374
router           | Content-Type: application/octet-stream
router           | Via: 1.1 c9d73fa9f3a2
router           | X-Forwarded-For: 192.168.192.1
router           | X-Forwarded-Proto: http
router           | X-Forwarded-Host: localhost:8888
router           | X-Forwarded-Server: 192.168.192.8
router           | Host: 192.168.192.9:8082
router           |
router           |
broker           | 2023-11-14T11:33:17,467 DEBUG [qtp213850519-118] org.eclipse.jetty.io.ManagedSelector - updates 0
broker           | 2023-11-14T11:33:17,467 DEBUG [qtp213850519-118] org.eclipse.jetty.io.ChannelEndPoint - Key interests updated 1 -> 0 on SocketChannelEndPoint@c49370f{l=/192.168.192.9:8082,r=/192.168.192.8:59946,OPEN,fill=FI,flush=-,to=29/300000}{io=0/0,kio=0,kro=1}->HttpConnection@6493274f[p=HttpParser{s=START,0 of -1},g=HttpGenerator@1eee9d27{s=START}]=>HttpChannelOverHttp@35214ae4{s=HttpChannelState@2d3a7ac5{s=IDLE rs=BLOCKING os=OPEN is=IDLE awp=false se=false i=true al=0},r=1,c=false/false,a=IDLE,uri=null,age=0}
broker           | 2023-11-14T11:33:17,467 DEBUG [qtp213850519-118] org.eclipse.jetty.io.ManagedSelector - Selector sun.nio.ch.EPollSelectorImpl@4e99f5f5 waiting with 1 keys
broker           | 2023-11-14T11:33:17,467 DEBUG [qtp213850519-111] org.eclipse.jetty.util.thread.strategy.EatWhatYouKill - EatWhatYouKill@6d80e411/SelectorProducer@45f0038/IDLE/p=true/QueuedThreadPool[qtp213850519]@cbf1997{STARTED,68<=68<=68,i=61,r=-1,q=0}[ReservedThreadExecutor@517fbf62{s=0/6,p=1}][pc=0,pic=0,pec=1,epc=0]@2023-11-14T11:33:17.465Z m=EXECUTE_PRODUCE_CONSUME t=CEP:SocketChannelEndPoint@c49370f{l=/192.168.192.9:8082,r=/192.168.192.8:59946,OPEN,fill=FI,flush=-,to=28/300000}{io=0/0,kio=0,kro=1}->HttpConnection@6493274f[p=HttpParser{s=START,0 of -1},g=HttpGenerator@1eee9d27{s=START}]=>HttpChannelOverHttp@35214ae4{s=HttpChannelState@2d3a7ac5{s=IDLE rs=BLOCKING os=OPEN is=IDLE awp=false se=false i=true al=0},r=1,c=false/false,a=IDLE,uri=null,age=0}:runFillable:BLOCKING/BLOCKING
router           | 2023-11-14T11:33:17,460 DEBUG [qtp633514467-64] org.eclipse.jetty.client.HttpSender - Request failure HttpRequest[POST /druid/v2/sql/avatica/ HTTP/1.1]@1da392d3
router           | org.eclipse.jetty.http.BadMessageException: 500: Incorrect Content-Length 390!=374
router           |      at org.eclipse.jetty.http.HttpGenerator.generateHeaders(HttpGenerator.java:637) ~[jetty-http-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.http.HttpGenerator.generateRequest(HttpGenerator.java:239) ~[jetty-http-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.client.http.HttpSenderOverHTTP$HeadersCallback.process(HttpSenderOverHTTP.java:217) ~[jetty-client-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:241) ~[jetty-util-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:223) ~[jetty-util-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.client.http.HttpSenderOverHTTP.sendHeaders(HttpSenderOverHTTP.java:65) ~[jetty-client-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.client.HttpSender.send(HttpSender.java:212) ~[jetty-client-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.client.http.HttpChannelOverHTTP.send(HttpChannelOverHTTP.java:84) ~[jetty-client-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.client.HttpChannel.send(HttpChannel.java:128) ~[jetty-client-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.client.HttpConnection.send(HttpConnection.java:233) ~[jetty-client-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.client.http.HttpConnectionOverHTTP$Delegate.send(HttpConnectionOverHTTP.java:260) ~[jetty-client-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.client.http.HttpConnectionOverHTTP.send(HttpConnectionOverHTTP.java:122) ~[jetty-client-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.client.http.HttpDestinationOverHTTP.send(HttpDestinationOverHTTP.java:38) ~[jetty-client-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.client.HttpDestination.process(HttpDestination.java:381) ~[jetty-client-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.client.HttpDestination.process(HttpDestination.java:336) ~[jetty-client-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.client.HttpDestination.send(HttpDestination.java:315) ~[jetty-client-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.client.HttpDestination.send(HttpDestination.java:309) ~[jetty-client-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.client.HttpDestination.send(HttpDestination.java:286) ~[jetty-client-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.client.HttpDestination.send(HttpDestination.java:263) ~[jetty-client-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.client.HttpClient.send(HttpClient.java:600) ~[jetty-client-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.client.HttpRequest.sendAsync(HttpRequest.java:778) ~[jetty-client-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:765) ~[jetty-client-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.proxy.AbstractProxyServlet.sendProxyRequest(AbstractProxyServlet.java:618) ~[jetty-proxy-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.apache.druid.server.AsyncQueryForwardingServlet.sendProxyRequest(AsyncQueryForwardingServlet.java:429) ~[druid-services-0.23.0.jar:0.23.0]
router           |      at org.eclipse.jetty.proxy.ProxyServlet.service(ProxyServlet.java:114) ~[jetty-proxy-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.apache.druid.server.AsyncQueryForwardingServlet.doService(AsyncQueryForwardingServlet.java:381) ~[druid-services-0.23.0.jar:0.23.0]
router           |      at org.apache.druid.server.AsyncQueryForwardingServlet.service(AsyncQueryForwardingServlet.java:292) ~[druid-services-0.23.0.jar:0.23.0]
router           |      at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) ~[javax.servlet-api-3.1.0.jar:3.1.0]
router           |      at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:791) ~[jetty-servlet-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1626) ~[jetty-servlet-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.apache.druid.server.security.PreResponseAuthorizationCheckFilter.doFilter(PreResponseAuthorizationCheckFilter.java:82) ~[druid-server-0.23.0.jar:0.23.0]
router           |      at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193) ~[jetty-servlet-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601) ~[jetty-servlet-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.apache.druid.server.initialization.jetty.StandardResponseHeaderFilterHolder$StandardResponseHeaderFilter.doFilter(StandardResponseHeaderFilterHolder.java:161) ~[druid-server-0.23.0.jar:0.23.0]
router           |      at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193) ~[jetty-servlet-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601) ~[jetty-servlet-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.apache.druid.server.security.AllowHttpMethodsResourceFilter.doFilter(AllowHttpMethodsResourceFilter.java:78) ~[druid-server-0.23.0.jar:0.23.0]
router           |      at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193) ~[jetty-servlet-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601) ~[jetty-servlet-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.apache.druid.server.security.AllowOptionsResourceFilter.doFilter(AllowOptionsResourceFilter.java:75) ~[druid-server-0.23.0.jar:0.23.0]
router           |      at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193) ~[jetty-servlet-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601) ~[jetty-servlet-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.apache.druid.server.security.AuthenticationWrappingFilter.doFilter(AuthenticationWrappingFilter.java:57) ~[druid-server-0.23.0.jar:0.23.0]
router           |      at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193) ~[jetty-servlet-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601) ~[jetty-servlet-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.apache.druid.server.security.UnsecuredResourceFilter.doFilter(UnsecuredResourceFilter.java:60) ~[druid-server-0.23.0.jar:0.23.0]
router           |      at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193) ~[jetty-servlet-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601) ~[jetty-servlet-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.apache.druid.server.security.SecuritySanityCheckFilter.doFilter(SecuritySanityCheckFilter.java:77) ~[druid-server-0.23.0.jar:0.23.0]
router           |      at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193) ~[jetty-servlet-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601) ~[jetty-servlet-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:548) ~[jetty-servlet-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) ~[jetty-server-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624) ~[jetty-server-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) ~[jetty-server-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1435) ~[jetty-server-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188) ~[jetty-server-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501) ~[jetty-servlet-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594) ~[jetty-server-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) ~[jetty-server-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1350) ~[jetty-server-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) ~[jetty-server-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:763) ~[jetty-server-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:59) ~[jetty-server-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) ~[jetty-server-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.server.Server.handle(Server.java:516) ~[jetty-server-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:388) ~[jetty-server-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:633) ~[jetty-server-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:380) ~[jetty-server-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277) ~[jetty-server-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) ~[jetty-io-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105) ~[jetty-io-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104) ~[jetty-io-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336) ~[jetty-util-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313) ~[jetty-util-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171) ~[jetty-util-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:135) ~[jetty-util-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:882) [jetty-util-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1036) [jetty-util-9.4.40.v20210413.jar:9.4.40.v20210413]
router           |      at java.lang.Thread.run(Thread.java:748) [?:1.8.0_275]
router           | 2023-11-14T11:33:17,461 DEBUG [qtp633514467-64] org.eclipse.jetty.util.thread.QueuedThreadPool - queue org.eclipse.jetty.client.HttpSender$$Lambda$175/378668227@544efbcc startThread=0
router           | 2023-11-14T11:33:17,461 DEBUG [qtp633514467-64] org.eclipse.jetty.server.session - Leaving scope org.eclipse.jetty.server.session.SessionHandler121597447==dftMaxIdleSec=-1 dispatch=REQUEST, async=true, session=null, oldsession=null, oldsessionhandler=null
router           | 2023-11-14T11:33:17,461 DEBUG [AsyncQueryForwardingServlet-2db86a7c-187] org.eclipse.jetty.util.thread.QueuedThreadPool - run org.eclipse.jetty.client.HttpSender$$Lambda$175/378668227@544efbcc in QueuedThreadPool[AsyncQueryForwardingServlet-2db86a7c]@ae3c140{STARTED,8<=8<=100,i=2,r=-1,q=0}[ReservedThreadExecutor@625264ed{s=1/8,p=0}]
router           | 2023-11-14T11:33:17,461 DEBUG [AsyncQueryForwardingServlet-2db86a7c-187] org.eclipse.jetty.client.HttpSender - Request shutdown output HttpRequest[POST /druid/v2/sql/avatica/ HTTP/1.1]@1da392d3
router           | 2023-11-14T11:33:17,461 DEBUG [qtp633514467-64] org.eclipse.jetty.server.Server - handled=true async=true committed=false on HttpChannelOverHttp@127f3859{s=HttpChannelState@3e025170{s=HANDLING rs=ASYNC os=OPEN is=READY awp=false se=false i=true al=0},r=2,c=false/false,a=HANDLING,uri=//localhost:8888/druid/v2/sql/avatica/,age=10}
router           | 2023-11-14T11:33:17,461 DEBUG [qtp633514467-64] org.eclipse.jetty.server.HttpChannelState - unhandle HttpChannelState@3e025170{s=HANDLING rs=ASYNC os=OPEN is=READY awp=false se=false i=true al=0}
router           | 2023-11-14T11:33:17,461 DEBUG [qtp633514467-64] org.eclipse.jetty.server.HttpChannelState - nextAction(false) READ_CALLBACK HttpChannelState@3e025170{s=HANDLING rs=ASYNC os=OPEN is=IDLE awp=false se=false i=false al=0}
router           | 2023-11-14T11:33:17,461 DEBUG [qtp633514467-64] org.eclipse.jetty.server.HttpChannel - action READ_CALLBACK HttpChannelOverHttp@127f3859{s=HttpChannelState@3e025170{s=HANDLING rs=ASYNC os=OPEN is=IDLE awp=false se=false i=false al=0},r=2,c=false/false,a=HANDLING,uri=//localhost:8888/druid/v2/sql/avatica/,age=10}
router           | 2023-11-14T11:33:17,461 DEBUG [qtp633514467-64] org.apache.druid.server.AsyncQueryForwardingServlet.2db86a7c - 646294277 proxying content to upstream completed
router           | 2023-11-14T11:33:17,461 DEBUG [AsyncQueryForwardingServlet-2db86a7c-187] org.eclipse.jetty.client.HttpSender - Request abort HttpRequest[POST /druid/v2/sql/avatica/ HTTP/1.1]@1da392d3 HttpExchange@282ccdc6{req=HttpRequest[POST /druid/v2/sql/avatica/ HTTP/1.1]@1da392d3[COMPLETED/org.eclipse.jetty.http.BadMessageException: 500: Incorrect Content-Length 390!=374] res=HttpResponse[null 0 null]@71340f1[PENDING/null]} on HttpChannelOverHTTP@23ced3d3(exchange=HttpExchange@282ccdc6{req=HttpRequest[POST /druid/v2/sql/avatica/ HTTP/1.1]@1da392d3[COMPLETED/org.eclipse.jetty.http.BadMessageException: 500: Incorrect Content-Length 390!=374] res=HttpResponse[null 0 null]@71340f1[PENDING/null]})[send=HttpSenderOverHTTP@26ce6841(req=FAILURE,snd=FAILED,failure=org.eclipse.jetty.http.BadMessageException: 500: Incorrect Content-Length 390!=374)[HttpGenerator@4c4c177{s=END}],recv=HttpReceiverOverHTTP@64c2a36b(rsp=IDLE,failure=null)[HttpParser{s=START,0 of -1}]]: {}
router           | 2023-11-14T11:33:17,461 DEBUG [qtp633514467-64] org.eclipse.jetty.server.HttpChannelState - unhandle HttpChannelState@3e025170{s=HANDLING rs=ASYNC os=OPEN is=IDLE awp=false se=false i=false al=0}
router           | 2023-11-14T11:33:17,461 DEBUG [qtp633514467-64] org.eclipse.jetty.server.HttpChannelState - nextAction(false) WAIT HttpChannelState@3e025170{s=WAITING rs=ASYNC os=OPEN is=IDLE awp=false se=false i=false al=0}
router           | 2023-11-14T11:33:17,461 DEBUG [AsyncQueryForwardingServlet-2db86a7c-187] org.eclipse.jetty.client.HttpExchange - Terminated request for HttpExchange@282ccdc6{req=HttpRequest[POST /druid/v2/sql/avatica/ HTTP/1.1]@1da392d3[TERMINATED/org.eclipse.jetty.http.BadMessageException: 500: Incorrect Content-Length 390!=374] res=HttpResponse[null 0 null]@71340f1[PENDING/null]}, result: null
router           | 2023-11-14T11:33:17,461 DEBUG [AsyncQueryForwardingServlet-2db86a7c-187] org.eclipse.jetty.client.HttpSender - Terminating request HttpRequest[POST /druid/v2/sql/avatica/ HTTP/1.1]@1da392d3
router           | 2023-11-14T11:33:17,461 DEBUG [qtp633514467-64] org.eclipse.jetty.server.HttpChannel - action WAIT HttpChannelOverHttp@127f3859{s=HttpChannelState@3e025170{s=WAITING rs=ASYNC os=OPEN is=IDLE awp=false se=false i=false al=0},r=2,c=false/false,a=WAITING,uri=//localhost:8888/druid/v2/sql/avatica/,age=10}
router           | 2023-11-14T11:33:17,461 DEBUG [qtp633514467-64] org.eclipse.jetty.server.HttpChannel - !handle WAIT HttpChannelOverHttp@127f3859{s=HttpChannelState@3e025170{s=WAITING rs=ASYNC os=OPEN is=IDLE awp=false se=false i=false al=0},r=2,c=false/false,a=WAITING,uri=//localhost:8888/druid/v2/sql/avatica/,age=10}
router           | 2023-11-14T11:33:17,461 DEBUG [AsyncQueryForwardingServlet-2db86a7c-187] org.eclipse.jetty.client.HttpSender - Response failure from request HttpRequest[POST /druid/v2/sql/avatica/ HTTP/1.1]@1da392d3 HttpExchange@282ccdc6{req=HttpRequest[POST /druid/v2/sql/avatica/ HTTP/1.1]@1da392d3[TERMINATED/org.eclipse.jetty.http.BadMessageException: 500: Incorrect Content-Length 390!=374] res=HttpResponse[null 0 null]@71340f1[COMPLETED/org.eclipse.jetty.http.BadMessageException: 500: Incorrect Content-Length 390!=374]}


我将感谢任何关于如何在Scala Play和JDBC的上下文中处理Druid SQL查询中的表情符号的见解或建议。
我已经验证了同样的查询在没有表情符号的情况下也能正常工作,但是一旦包含了表情符号,就会出现错误。我使用Postman进行测试。值得注意的是,当我直接将包含表情符号的相同查询粘贴到Druid中时,它可以正常工作。这个问题似乎是针对Scala Play,JDBC和Druid之间的交互。

vjrehmav

vjrehmav1#

我在经纪人日志中发现的错误是:
500:内容长度不正确390!=374
它仍然发生在later Avatica上吗?
建议将其作为Github Issue放在主存储库中,并提供一个失败的查询示例。注意Druid 28刚刚发布,所以你可能想看看在不同的Druid版本上是否会遇到同样的问题。你可以将28 env设置为https://github.com/implydata/learn-druid并创建一个虚拟查询。

相关问题