Kibana plugin error


(Adel-S) #1

Our software:
ElasticSearch 5.2.2
Kibana 5.2.2

ReadonlyREST versions:
ElasticSearch plugin: 1.16.8
Kibana Plugin: [email protected] (it is the only version I get for Kibana 5.2.2 from PRO versions download page)

When I try to commit settings from kibana plugin interface I got an error.

At the top of Kibana’s interface:
Elasticsearch error: {"data":{"error":{"root_cause":[{"type":"json_generation_exception","reason":"Can not start an object, expecting field name (context: Object)"}],"type":"json_generation_exception","reason":"Can not start an object, expecting field name (context: Object)"},"status":500},"status":500,"config":{"method":"POST","transformRequest":[null],"transformResponse":[null],"url":"/api/readonlyrest_kbn/settings","data":{"settings":"readonlyrest:\n access_control_rules:\n\n - name: \"Allowing anything from localhost\"\n hosts: [127.0.0.1]\n\n - name: \"Kibana service\"\n hosts: [10.201.140.0/24]\n auth_key: kibana_service:sfCoQgtq02Sp\n type: allow\n\n - name: \"Kibana admin\"\n type: allow\n kibana_access: admin\n auth_key: admin:kibana\n\n - name: \"Kibana user\"\n auth_key: user:kibana\n kibana_access: ro\n kibana_hide_apps: [\"timelion\", \"readonlyrest_kbn\", \"kibana:dev_tools\", \"monitoring\", \"kibana:management\"]\n actions: [\"cluster:monitor/nodes/info\", \"indices:admin/mappings/fields/get\", \"indices:data/read/\"]\n indices: [\".kibana\", \"public_index\", \"medium_index\"]\n\n - name: \"Kibana power user\"\n auth_key: power_user:kibana\n kibana_access: ro\n kibana_hide_apps: [\"timelion\", \"readonlyrest_kbn\", \"kibana:dev_tools\", \"monitoring\", \"kibana:management\"]\n actions: [\"cluster:monitor/nodes/info\", \"indices:admin/mappings/fields/get\", \"indices:data/read/\"]\n indices: [\".kibana\", \"private_index\", \"public_index\", \"medium_index\"]"},"headers":{"Accept":"application/json, text/plain, /","Content-Type":"application/json;charset=utf-8","kbn-version":"5.2.2"}},"statusText":"Internal Server Error"}

At the same time at elasticsearch’s log:
[2017-07-17T13:29:13,273][WARN ][r.suppressed ] path: /_readonlyrest/admin/refreshconfig, params: {} com.fasterxml.jackson.core.JsonGenerationException: Can not start an object, expecting field name (context: Object) at com.fasterxml.jackson.core.JsonGenerator._reportError(JsonGenerator.java:1897) ~[jackson-core-2.8.6.jar:2.8.6] at com.fasterxml.jackson.core.json.JsonGeneratorImpl._reportCantWriteValueExpectName(JsonGeneratorImpl.java:244) ~[jackson-core-2.8.6.jar:2.8.6] at com.fasterxml.jackson.core.json.UTF8JsonGenerator._verifyValueWrite(UTF8JsonGenerator.java:1027) ~[jackson-core-2.8.6.jar:2.8.6] at com.fasterxml.jackson.core.json.UTF8JsonGenerator.writeStartObject(UTF8JsonGenerator.java:313) ~[jackson-core-2.8.6.jar:2.8.6] at org.elasticsearch.common.xcontent.json.JsonXContentGenerator.writeStartObject(JsonXContentGenerator.java:161) ~[elasticsearch-5.2.2.jar:5.2.2] at org.elasticsearch.common.xcontent.XContentBuilder.startObject(XContentBuilder.java:217) ~[elasticsearch-5.2.2.jar:5.2.2] at org.elasticsearch.plugin.readonlyrest.es.rradmin.RRAdminResponse.toXContent(RRAdminResponse.java:50) ~[?:?] at org.elasticsearch.rest.action.RestToXContentListener.buildResponse(RestToXContentListener.java:48) ~[elasticsearch-5.2.2.jar:5.2.2] at org.elasticsearch.rest.action.RestToXContentListener.buildResponse(RestToXContentListener.java:41) ~[elasticsearch-5.2.2.jar:5.2.2] at org.elasticsearch.rest.action.RestToXContentListener.buildResponse(RestToXContentListener.java:33) ~[elasticsearch-5.2.2.jar:5.2.2] at org.elasticsearch.rest.action.RestResponseListener.processResponse(RestResponseListener.java:37) ~[elasticsearch-5.2.2.jar:5.2.2] at org.elasticsearch.rest.action.RestActionListener.onResponse(RestActionListener.java:47) ~[elasticsearch-5.2.2.jar:5.2.2] at org.elasticsearch.action.support.TransportAction$1.onResponse(TransportAction.java:91) ~[elasticsearch-5.2.2.jar:5.2.2] at org.elasticsearch.action.support.TransportAction$1.onResponse(TransportAction.java:87) ~[elasticsearch-5.2.2.jar:5.2.2] at org.elasticsearch.plugin.readonlyrest.es.actionlisteners.ACLActionListener.onResponse(ACLActionListener.java:69) ~[?:?] at org.elasticsearch.plugin.readonlyrest.es.actionlisteners.ACLActionListener.onResponse(ACLActionListener.java:32) ~[?:?] at org.elasticsearch.plugin.readonlyrest.es.rradmin.TransportRRAdminAction.lambda$doExecute$0(TransportRRAdminAction.java:60) ~[?:?] at java.util.concurrent.CompletableFuture.uniAccept(CompletableFuture.java:656) ~[?:1.8.0_131] at java.util.concurrent.CompletableFuture.uniAcceptStage(CompletableFuture.java:669) ~[?:1.8.0_131] at java.util.concurrent.CompletableFuture.thenAccept(CompletableFuture.java:1997) ~[?:1.8.0_131] at org.elasticsearch.plugin.readonlyrest.es.rradmin.TransportRRAdminAction.doExecute(TransportRRAdminAction.java:55) ~[?:?] at org.elasticsearch.plugin.readonlyrest.es.rradmin.TransportRRAdminAction.doExecute(TransportRRAdminAction.java:36) ~[?:?] at org.elasticsearch.action.support.TransportAction.doExecute(TransportAction.java:149) ~[elasticsearch-5.2.2.jar:5.2.2] at org.elasticsearch.action.support.TransportAction$RequestFilterChain.proceed(TransportAction.java:173) ~[elasticsearch-5.2.2.jar:5.2.2] at org.elasticsearch.plugin.readonlyrest.es.IndexLevelActionFilter.lambda$handleRequest$1(IndexLevelActionFilter.java:212) ~[?:?] at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602) ~[?:1.8.0_131] at java.util.concurrent.CompletableFuture.uniApplyStage(CompletableFuture.java:614) ~[?:1.8.0_131] at java.util.concurrent.CompletableFuture.thenApply(CompletableFuture.java:1983) ~[?:1.8.0_131] at org.elasticsearch.plugin.readonlyrest.es.IndexLevelActionFilter.handleRequest(IndexLevelActionFilter.java:202) ~[?:?] at org.elasticsearch.plugin.readonlyrest.es.IndexLevelActionFilter.apply(IndexLevelActionFilter.java:145) ~[?:?] at org.elasticsearch.action.support.TransportAction$RequestFilterChain.proceed(TransportAction.java:171) ~[elasticsearch-5.2.2.jar:5.2.2] at org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:145) ~[elasticsearch-5.2.2.jar:5.2.2] at org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:87) ~[elasticsearch-5.2.2.jar:5.2.2] at org.elasticsearch.client.node.NodeClient.executeLocally(NodeClient.java:75) ~[elasticsearch-5.2.2.jar:5.2.2] at org.elasticsearch.client.node.NodeClient.doExecute(NodeClient.java:64) ~[elasticsearch-5.2.2.jar:5.2.2] at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:403) ~[elasticsearch-5.2.2.jar:5.2.2] at org.elasticsearch.plugin.readonlyrest.es.rradmin.rest.RestRRAdminAction.lambda$prepareRequest$0(RestRRAdminAction.java:49) ~[?:?] at org.elasticsearch.rest.BaseRestHandler.handleRequest(BaseRestHandler.java:82) ~[elasticsearch-5.2.2.jar:5.2.2] at org.elasticsearch.plugin.readonlyrest.es.ReadonlyRestPlugin.lambda$null$3(ReadonlyRestPlugin.java:120) ~[?:?] at org.elasticsearch.rest.RestController.dispatchRequest(RestController.java:162) [elasticsearch-5.2.2.jar:5.2.2] at org.elasticsearch.http.HttpServer.dispatchRequest(HttpServer.java:115) [elasticsearch-5.2.2.jar:5.2.2] at org.elasticsearch.http.netty4.Netty4HttpServerTransport.dispatchRequest(Netty4HttpServerTransport.java:515) [transport-netty4-5.2.2.jar:5.2.2] at org.elasticsearch.http.netty4.Netty4HttpRequestHandler.channelRead0(Netty4HttpRequestHandler.java:70) [transport-netty4-5.2.2.jar:5.2.2] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [netty-transport-4.1.7.Final.jar:4.1.7.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) [netty-transport-4.1.7.Final.jar:4.1.7.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349) [netty-transport-4.1.7.Final.jar:4.1.7.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:341) [netty-transport-4.1.7.Final.jar:4.1.7.Final] at org.elasticsearch.http.netty4.pipelining.HttpPipeliningHandler.channelRead(HttpPipeliningHandler.java:65) [transport-netty4-5.2.2.jar:5.2.2] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) [netty-transport-4.1.7.Final.jar:4.1.7.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349) [netty-transport-4.1.7.Final.jar:4.1.7.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:341) [netty-transport-4.1.7.Final.jar:4.1.7.Final] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) [netty-codec-4.1.7.Final.jar:4.1.7.Final] at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) [netty-codec-4.1.7.Final.jar:4.1.7.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) [netty-transport-4.1.7.Final.jar:4.1.7.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349) [netty-transport-4.1.7.Final.jar:4.1.7.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:341) [netty-transport-4.1.7.Final.jar:4.1.7.Final] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) [netty-codec-4.1.7.Final.jar:4.1.7.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) [netty-transport-4.1.7.Final.jar:4.1.7.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349) [netty-transport-4.1.7.Final.jar:4.1.7.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:341) [netty-transport-4.1.7.Final.jar:4.1.7.Final] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) [netty-codec-4.1.7.Final.jar:4.1.7.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) [netty-transport-4.1.7.Final.jar:4.1.7.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349) [netty-transport-4.1.7.Final.jar:4.1.7.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:341) [netty-transport-4.1.7.Final.jar:4.1.7.Final] at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293) [netty-codec-4.1.7.Final.jar:4.1.7.Final] at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267) [netty-codec-4.1.7.Final.jar:4.1.7.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) [netty-transport-4.1.7.Final.jar:4.1.7.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349) [netty-transport-4.1.7.Final.jar:4.1.7.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:341) [netty-transport-4.1.7.Final.jar:4.1.7.Final] at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86) [netty-transport-4.1.7.Final.jar:4.1.7.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) [netty-transport-4.1.7.Final.jar:4.1.7.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349) [netty-transport-4.1.7.Final.jar:4.1.7.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:341) [netty-transport-4.1.7.Final.jar:4.1.7.Final] at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334) [netty-transport-4.1.7.Final.jar:4.1.7.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363) [netty-transport-4.1.7.Final.jar:4.1.7.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349) [netty-transport-4.1.7.Final.jar:4.1.7.Final] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926) [netty-transport-4.1.7.Final.jar:4.1.7.Final] at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:129) [netty-transport-4.1.7.Final.jar:4.1.7.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:642) [netty-transport-4.1.7.Final.jar:4.1.7.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:527) [netty-transport-4.1.7.Final.jar:4.1.7.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:481) [netty-transport-4.1.7.Final.jar:4.1.7.Final] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:441) [netty-transport-4.1.7.Final.jar:4.1.7.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858) [netty-common-4.1.7.Final.jar:4.1.7.Final] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131]


(Simone Scarduzio) #2

Hello @Adel-S!

Yes I remember your 5.2.2 cluster :slight_smile: I will try to reproduce this using the configuration provided as part of the error message.


(Adel-S) #3

Thank you, Simone!
Sorry but now upgrade cluster to 5.5 is not an option.


(Simone Scarduzio) #4

Yeah nevermind, your version is supposed to work well. So let’s see…


(Simone Scarduzio) #5

Reproduced and fixed.

Try this build: https://readonlyrest-data.s3-eu-west-1.amazonaws.com/tmp/readonlyrest-1.16.9-pre1_es5.2.2.zip?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJEKIPNTOTIVGQ4EQ/20170717/eu-west-1/s3/aws4_request&X-Amz-Date=20170717T144545Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=e5e30777c06488bd00eb83cb84f244d8799cfb15b2a26b9dc93e754ef8619732


(Adel-S) #6

With new version error disappeared - config successfully stored in .readonlyrest index.
Trying to add new user, see him in .readonlyrest index:

- name: \"Kibana meduim user\" auth_key: medium_user:kibana kibana_access: ro kibana_hide_apps: [\"timelion\", \"readonlyrest_kbn\", \"kibana:dev_tools\", \"monitoring\", \"kibana:management\"] actions: [\"cluster:monitor/nodes/info\", \"indices:admin/mappings/fields/get*\", \"indices:data/read/*\"] indices: ['.kibana', 'medium_index']"

But this user can not login, elasticsearch_logs shows me:
[2017-07-17T19:29:03,190][INFO ][o.e.p.r.a.ACL ] FORBIDDEN by default req={ ID:1599144333-503522377#9248, TYP:NodesInfoRequest, USR:medium_user(?), BRS:false, ACT:cluster:monitor/nodes/info, OA:10.201.140.17, IDX:<N/A>, MET:GET, PTH:/_nodes/_local, CNT:<OMITTED, LENGTH=0>, HDR:Authorization,Connection,content-length,Host, HIS:[Kibana user->[auth_key->false]], [Allowing anything from localhost->[hosts->false]], [Kibana admin->[auth_key->false]], [Kibana power user->[auth_key->false]], [Kibana service->[auth_key->false]] }

What am I doing wrong?


(Simone Scarduzio) #7

Good catch @Adel-S, I found the bug, it’s a regression. You’ll have it fixed today. :slight_smile:


(Simone Scarduzio) #9

Here is a build, I wrote a new integration test to avoid regressions in the future.

https://readonlyrest-data.s3-eu-west-1.amazonaws.com/build/1.16.9-pre3/readonlyrest-1.16.9-pre3_es5.2.1.zip?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJEKIPNTOTIVGQ4EQ/20170718/eu-west-1/s3/aws4_request&X-Amz-Date=20170718T204516Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=8fece88d1968d0e2c851f6979c9a1a572db3cb0d9c0e5a27457ee6d240b336d4


(Adel-S) #10

./bin/elasticsearch-plugin install file:///tmp/readonlyrest-1.16.9-pre3_es5.2.1.zip
-> Downloading file:///tmp/readonlyrest-1.16.9-pre3_es5.2.1.zip
[=================================================] 100%
Exception in thread “main” java.lang.IllegalArgumentException: Plugin [readonlyrest] is incompatible with Elasticsearch [5.2.2]. Was designed for version [5.2.1]


(Simone Scarduzio) #11

Apologies, I linked the wrong version :frowning:
https://readonlyrest-data.s3-eu-west-1.amazonaws.com/build/1.16.9-pre3/readonlyrest-1.16.9-pre3_es5.2.2.zip?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJEKIPNTOTIVGQ4EQ/20170719/eu-west-1/s3/aws4_request&X-Amz-Date=20170719T141556Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=b1246ed7019784e94d8b3ad11d8f7ad88a84b114d9c4eabecefc96e277bf4e60


(Adel-S) #12

I cannot install this due to error during installation:

[email protected]:/usr/share/elasticsearch# ./bin/elasticsearch-plugin install file://tmp/readonlyrest-1.16.9-pre3_es5.2.2.zip
-> Downloading file://tmp/readonlyrest-1.16.9-pre3_es5.2.2.zip
Exception in thread “main” java.net.UnknownHostException: tmp
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184)
at java.net.Socket.connect(Socket.java:589)
at java.net.Socket.connect(Socket.java:538)
at sun.net.ftp.impl.FtpClient.doConnect(FtpClient.java:964)
at sun.net.ftp.impl.FtpClient.tryConnect(FtpClient.java:924)
at sun.net.ftp.impl.FtpClient.connect(FtpClient.java:1019)
at sun.net.ftp.impl.FtpClient.connect(FtpClient.java:1005)
at sun.net.www.protocol.ftp.FtpURLConnection.connect(FtpURLConnection.java:294)
at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnection.java:400)
at org.elasticsearch.plugins.InstallPluginCommand.downloadZip(InstallPluginCommand.java:279)
at org.elasticsearch.plugins.InstallPluginCommand.download(InstallPluginCommand.java:254)
at org.elasticsearch.plugins.InstallPluginCommand.execute(InstallPluginCommand.java:210)
at org.elasticsearch.plugins.InstallPluginCommand.execute(InstallPluginCommand.java:195)
at org.elasticsearch.cli.SettingCommand.execute(SettingCommand.java:54)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:122)
at org.elasticsearch.cli.MultiCommand.execute(MultiCommand.java:69)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:122)
at org.elasticsearch.cli.Command.main(Command.java:88)
at org.elasticsearch.plugins.PluginCli.main(PluginCli.java:47)


(Simone Scarduzio) #13

You need three slashes after “file:”


(Adel-S) #14

This new version works like a charm.
Many thanks for your support, Simone!