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

Test failing due to wrong content_type - 10_basic/Verify that we can still find things with the template #66986

Closed
pgomulka opened this issue Jan 5, 2021 · 0 comments · Fixed by #67677
Labels
>test-failure Triaged test failures from CI

Comments

@pgomulka
Copy link
Contributor

pgomulka commented Jan 5, 2021

introduced by #65500

Build scan:
https://gradle-enterprise.elastic.co/s/cypeuyt4db6ow/tests/:qa:rolling-upgrade:v7.12.0%23oneThirdUpgradedTest/org.elasticsearch.upgrades.UpgradeClusterClientYamlTestSuiteIT/test%20%7Bp0=mixed_cluster%2F10_basic%2FVerify%20that%20we%20can%20still%20find%20things%20with%20the%20template%7D#1

Repro line:

./gradlew ':qa:rolling-upgrade:v7.12.0#oneThirdUpgradedTest' -Dtests.class="org.elasticsearch.upgrades.UpgradeClusterClientYamlTestSuiteIT" -Dtests.method="test {p0=mixed_cluster/10_basic/Verify that we can still find things with the template}" -Dtests.seed=CCF20BC12765F837 -Dtests.security.manager=true -Dtests.bwc=true -Dtests.locale=he-IL -Dtests.timezone=PRC -Druntime.java=11 -Dtests.rest.suite=mixed_cluster	

Reproduces locally?:
yes

Applicable branches:

Failure history:

Failure excerpt:

"type" : "general_script_exception", |  
-- | --
  | "reason" : "Failed to compile stored script [test_search_template] using lang [mustache]", |  
  | "stack_trace" : "org.elasticsearch.script.GeneralScriptException: Failed to compile stored script [test_search_template] using lang [mustache] |  
  | at org.elasticsearch.script.ScriptCache.compile(ScriptCache.java:121) |  
  | at org.elasticsearch.script.ScriptService.compile(ScriptService.java:339) |  
  | at org.elasticsearch.script.mustache.TransportSearchTemplateAction.convert(TransportSearchTemplateAction.java:100) |  
  | at org.elasticsearch.script.mustache.TransportSearchTemplateAction.doExecute(TransportSearchTemplateAction.java:69) |  
  | at org.elasticsearch.script.mustache.TransportSearchTemplateAction.doExecute(TransportSearchTemplateAction.java:48) |  
  | at org.elasticsearch.action.support.TransportAction$RequestFilterChain.proceed(TransportAction.java:88) |  
  | at org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:64) |  
  | at org.elasticsearch.tasks.TaskManager.registerAndExecute(TaskManager.java:175) |  
  | at org.elasticsearch.client.node.NodeClient.executeLocally(NodeClient.java:108) |  
  | at org.elasticsearch.client.node.NodeClient.doExecute(NodeClient.java:88) |  
  | at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:386) |  
  | at org.elasticsearch.script.mustache.RestSearchTemplateAction.lambda$prepareRequest$1(RestSearchTemplateAction.java:77) |  
  | at org.elasticsearch.rest.BaseRestHandler.handleRequest(BaseRestHandler.java:101) |  
  | at org.elasticsearch.rest.RestController.dispatchRequest(RestController.java:268) |  
  | at org.elasticsearch.rest.RestController.tryAllHandlers(RestController.java:353) |  
  | at org.elasticsearch.rest.RestController.dispatchRequest(RestController.java:198) |  
  | at org.elasticsearch.http.AbstractHttpServerTransport.dispatchRequest(AbstractHttpServerTransport.java:336) |  
  | at org.elasticsearch.http.AbstractHttpServerTransport.handleIncomingRequest(AbstractHttpServerTransport.java:401) |  
  | at org.elasticsearch.http.AbstractHttpServerTransport.incomingRequest(AbstractHttpServerTransport.java:318) |  
  | at org.elasticsearch.http.netty4.Netty4HttpRequestHandler.channelRead0(Netty4HttpRequestHandler.java:42) |  
  | at org.elasticsearch.http.netty4.Netty4HttpRequestHandler.channelRead0(Netty4HttpRequestHandler.java:28) |  
  | at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99) |  
  | at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) |  
  | at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) |  
  | at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) |  
  | at org.elasticsearch.http.netty4.Netty4HttpPipeliningHandler.channelRead(Netty4HttpPipeliningHandler.java:58) |  
  | at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) |  
  | at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) |  
  | at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) |  
  | at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) |  
  | at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) |  
  | at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) |  
  | at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) |  
  | at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) |  
  | at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) |  
  | at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) |  
  | at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) |  
  | at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) |  
  | at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) |  
  | at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) |  
  | at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) |  
  | at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) |  
  | at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) |  
  | at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) |  
  | at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) |  
  | at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) |  
  | at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324) |  
  | at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296) |  
  | at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) |  
  | at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) |  
  | at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) |  
  | at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286) |  
  | at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) |  
  | at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) |  
  | at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) |  
  | at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) |  
  | at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) |  
  | at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) |  
  | at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) |  
  | at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) |  
  | at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) |  
  | at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) |  
  | at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) |  
  | at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) |  
  | at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714) |  
  | at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:615) |  
  | at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:578) |  
  | at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493) |  
  | at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) |  
  | at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) |  
  | at java.base/java.lang.Thread.run(Thread.java:834) |  
  | Caused by: java.lang.IllegalArgumentException: No encoder found for MIME type [application/json; charset=UTF-8] |  
  | at org.elasticsearch.script.mustache.CustomMustacheFactory.createEncoder(CustomMustacheFactory.java:92) |  
  | at org.elasticsearch.script.mustache.CustomMustacheFactory.<init>(CustomMustacheFactory.java:73) |  
  | at org.elasticsearch.script.mustache.MustacheScriptEngine.createMustacheFactory(MustacheScriptEngine.java:96) |  
  | at org.elasticsearch.script.mustache.MustacheScriptEngine.compile(MustacheScriptEngine.java:75) |  
  | at org.elasticsearch.script.ScriptCache.lambda$compile$0(ScriptCache.java:110) |  
  | at org.elasticsearch.common.cache.Cache.computeIfAbsent(Cache.java:435) |  
  | at org.elasticsearch.script.ScriptCache.compile(ScriptCache.java:99) |  
  | ... 70 more
@pgomulka pgomulka added the >test-failure Triaged test failures from CI label Jan 5, 2021
pgomulka added a commit to pgomulka/elasticsearch that referenced this issue Jan 5, 2021
pgomulka added a commit that referenced this issue Jan 21, 2021
…ype.JSON (#67677)

Stored scripts can have content_type option set, however when empty they default to XContentType.JSON#mediaType(). Commit 5e74f79 has changed this in master (ES8) method to return application/json;charset=utf-8 (previously application/json; charset=UTF-8)
This means that when upgrading ES from version 7 to 8 stored script will fail when being used as the encoder is being matched with string equality (map key)

This commit address this by adding back (in addition) the old application/json; charset=UTF-8 into the encoders map.

closes #66986
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>test-failure Triaged test failures from CI
Projects
None yet
1 participant