graylog2-server icon indicating copy to clipboard operation
graylog2-server copied to clipboard

Malformed search query on fresh install running on RHEL 7.2

Open lynndixon opened this issue 10 years ago • 16 comments

Fresh RHEL7.2 machine, Followed the instructions to install Graylog found here: http://docs.graylog.org/en/2.0/pages/installation/os/centos.html

Disabled firewalld and SELinux is in permissive mode.

Confirmed MongoD and elasticsearch are running.

Added Syslog TCP and UDP inputs on port 1514 (verified they are listening by doing netstat -tulnp)

Getting the following error on the Search page:

Malformed search query The search query could not be executed, please correct it and try again. Take a look at the documentation if you need help with the search syntax.

The given query was malformed, and executing it caused the following error:

Error Message: Unable to execute search Exception: org.elasticsearch.action.search.SearchPhaseExecutionException

See Screenshot for details: image

And here is the overview screen:

image

Here is a screen shot of netstat -tulnp:

image

lynndixon avatar Sep 01 '16 00:09 lynndixon

Having a similar issue in Ubuntu. What does your /var/log/graylog-server/server.log show right after you try a search?

jtstuedle avatar Sep 01 '16 02:09 jtstuedle

Just grabbed this from the logs when executing a search:


2016-08-31T22:27:55.940-04:00 WARN  [transport] [graylog-6880bf3c-28e3-429d-a638-b5cbf2d6bbb4] Transport response handler not found of id [44628]
2016-08-31T22:27:55.963-04:00 WARN  [transport] [graylog-6880bf3c-28e3-429d-a638-b5cbf2d6bbb4] Transport response handler not found of id [44626]
2016-08-31T22:27:55.940-04:00 WARN  [transport] [graylog-6880bf3c-28e3-429d-a638-b5cbf2d6bbb4] Transport response handler not found of id [44627]
2016-08-31T22:27:55.979-04:00 WARN  [transport] [graylog-6880bf3c-28e3-429d-a638-b5cbf2d6bbb4] Transport response handler not found of id [44625]
2016-08-31T22:27:56.018-04:00 WARN  [SearchResource] Unable to execute search: all shards failed
2016-08-31T22:28:11.446-04:00 INFO  [connection] Opened connection [connectionId{localValue:12, serverValue:22}] to localhost:27017
2016-08-31T22:28:11.447-04:00 INFO  [connection] Opened connection [connectionId{localValue:13, serverValue:21}] to localhost:27017
2016-08-31T22:28:11.475-04:00 INFO  [connection] Opened connection [connectionId{localValue:15, serverValue:24}] to localhost:27017
2016-08-31T22:28:11.476-04:00 INFO  [connection] Opened connection [connectionId{localValue:14, serverValue:23}] to localhost:27017

lynndixon avatar Sep 01 '16 02:09 lynndixon

Same exact issue : "All shards failed": https://github.com/Graylog2/documentation/issues/173 (I posted my thread in the entirely wrong place). If an admin sees this, please move my issue to the correct thread.

I don't think it's an ElasticSearch issue; on your linux server you should be able to do a 'curl http://localhost:9200/_search?size=5' and it return the last 5 entries that ElasticSearch has processed. Something has changed in the most recent stable release of GrayLog. I am going to roll back to an earlier stable version of GrayLog tomorrow - Following your thread to see if someone else can chime in on a solution; I will post back tomorrow morning sometime after I get an earlier version of GrayLog installed and at least give you an update on getting the system functional.

jtstuedle avatar Sep 01 '16 04:09 jtstuedle

Just a quick update : Installed ElasticSearch v2.0.0 on by Ubuntu server and the latest stable release of GrayLog-Server works fine. No more malformed search queries and it looks like everything is functional.

search

jtstuedle avatar Sep 01 '16 05:09 jtstuedle

@lynndixon Which version of Elasticsearch and which version of Graylog are you using?

joschi avatar Sep 01 '16 07:09 joschi

@joschi Heres my versions:

Elasticsearch:

[root@rhel72-vm02 ~]# curl -XGET 'localhost:9200' 
{
  "name" : "Nobilus",
  "cluster_name" : "graylog",
  "version" : {
    "number" : "2.4.0",
    "build_hash" : "ce9f0c7394dee074091dd1bc4e9469251181fc55",
    "build_timestamp" : "2016-08-29T09:14:17Z",
    "build_snapshot" : false,
    "lucene_version" : "5.5.2"
  },
  "tagline" : "You Know, for Search"
}

Graylog: graylog-server-2.0.3-1.noarch

image

lynndixon avatar Sep 01 '16 14:09 lynndixon

Hi,

I can confirm the same as @lynndixon reported. Here it's a fresh CentOS 7.2 installation. I think it's not related to ElasticSearch - at least queries are working.

CentOS Linux release 7.2.1511 (Core) 

graylog-2.0-repository-1-1.noarch
graylog-server-2.0.3-1.noarch
elasticsearch-2.4.0-1.noarch

mongodb-org-shell-3.2.9-1.el7.x86_64
mongodb-org-tools-3.2.9-1.el7.x86_64
mongodb-org-3.2.9-1.el7.x86_64

python-javapackages-3.4.1-11.el7.noarch
javapackages-tools-3.4.1-11.el7.noarch
tzdata-java-2016f-1.el7.noarch
java-1.8.0-openjdk-headless-1.8.0.101-3.b13.el7_2.x86_64

Something from the logfiles:

# curl -X GET http://localhost:9200/graylog_0

{"graylog_0":{"aliases":{"graylog_deflector":{}},"mappings":{"message":{"properties":{"app":{"type":"string"},"application_name":{"type":"string"},"facility":{"type":"string"},"gl2_remote_ip":{"type":"string"},"gl2_remote_port":{"type":"long"},"gl2_source_input":{"type":"string"},"gl2_source_node":{"type":"string"},"level":{"type":"long"},"message":{"type":"string"},"process_id":{"type":"string"},"source":{"type":"string"},"timestamp":{"type":"string"}}}},"settings":{"index":{"creation_date":"1472743462810","analysis":{"analyzer":{"analyzer_keyword":{"filter":"lowercase","tokenizer":"keyword"}}},"number_of_shards":"4","number_of_replicas":"0","uuid":"_Mgaz3L8STqIueVd9j5XpQ","version":{"created":"2040099"}}},"warmers":{}}}


# curl -X GET http://localhost:9200/graylog_0/_search?q=message:*

{"took":15,"timed_out":false,"_shards":{"total":4,"successful":4,"failed":0},"hits":{"total":15,"max_score":1.0,"hits":[{"_index":"graylog_0","_type":"message","_id":"f91dede0-7058-11e6-aa1c-005056ae679b","_score":1.0,"_source":{"app":"systemd","level":6,"gl2_remote_ip":"1.2.3.4","gl2_remote_port":46710,"streams":[],"source":"hostname.ACME.de","message":"Started Session 6466 of user root.","gl2_source_input":"57c84309a835250b47053552","application_name":"systemd","gl2_source_node":"24e16c9f-7cdf-4016-a67e-d14951fe9c7e","facility":"system daemon","timestamp":"2016-09-01 15:30:01.850"}},{"_index":"graylog_0","_type":"message","_id":"f91fe9b0-7058-11e6-aa1c-005056ae679b","_score":1.0,"_source":{"app":"CROND","process_id":"32675","level":6,"gl2_remote_ip":"1.2.3.4","gl2_remote_port":46710,"streams":[],"source":"hostname.ACME.de","message":"(root) CMD (/usr/lib64/sa/sa1 1 1)","gl2_source_input":"57c84309a835250b47053552","application_name":"CROND","gl2_source_node":"24e16c9f-7cdf-4016-a67e-d14951fe9c7e","facility":"clock","timestamp":"2016-09-01 15:30:01.871"}},{"_index":"graylog_0","_type":"message","_id":"4606e9f0-7058-11e6-aa1c-005056ae679b","_score":1.0,"_source":{"app":"systemd","level":6,"gl2_remote_ip":"1.2.3.4","gl2_remote_port":46710,"streams":[],"source":"hostname.ACME.de","message":"Started Session 6464 of user APP.","gl2_source_input":"57c84309a835250b47053552","application_name":"systemd","gl2_source_node":"24e16c9f-7cdf-4016-a67e-d14951fe9c7e","facility":"system daemon","timestamp":"2016-09-01 15:25:01.403"}},{"_index":"graylog_0","_type":"message","_id":"4608e5c0-7058-11e6-aa1c-005056ae679b","_score":1.0,"_source":{"app":"CROND","process_id":"30360","level":6,"gl2_remote_ip":"1.2.3.4","gl2_remote_port":46710,"streams":[],"source":"hostname.ACME.de","message":"(APP) CMD ($HOME/bin/APP.Daemon.pl start >> /dev/null)","gl2_source_input":"57c84309a835250b47053552","application_name":"CROND","gl2_source_node":"24e16c9f-7cdf-4016-a67e-d14951fe9c7e","facility":"clock","timestamp":"2016-09-01 15:25:01.415"}},{"_index":"graylog_0","_type":"message","_id":"f944d6d0-7058-11e6-aa1c-005056ae679b","_score":1.0,"_source":{"app":"systemd","level":6,"gl2_remote_ip":"1.2.3.4","gl2_remote_port":46710,"streams":[],"source":"hostname.ACME.de","message":"Started Cleanup of Temporary Directories.","gl2_source_input":"57c84309a835250b47053552","application_name":"systemd","gl2_source_node":"24e16c9f-7cdf-4016-a67e-d14951fe9c7e","facility":"system daemon","timestamp":"2016-09-01 15:30:02.115"}},{"_index":"graylog_0","_type":"message","_id":"abad4b41-7059-11e6-aa1c-005056ae679b","_score":1.0,"_source":{"app":"systemd","level":6,"gl2_remote_ip":"1.2.3.4","gl2_remote_port":46710,"streams":[],"source":"hostname.ACME.de","message":"Started Session 6467 of user APP.","gl2_source_input":"57c84309a835250b47053552","application_name":"systemd","gl2_source_node":"24e16c9f-7cdf-4016-a67e-d14951fe9c7e","facility":"system daemon","timestamp":"2016-09-01 15:35:01.426"}},{"_index":"graylog_0","_type":"message","_id":"3cf28ae0-7058-11e6-aa1c-005056ae679b","_score":1.0,"_source":{"app":"username","level":5,"gl2_remote_ip":"1.2.3.4","gl2_remote_port":46710,"streams":[],"source":"hostname.ACME.de","message":" 17:24:46 up 14 days, 10 min,  4 users,  load average: 0,23, 0,28, 0,30","gl2_source_input":"57c84309a835250b47053552","application_name":"username","gl2_source_node":"24e16c9f-7cdf-4016-a67e-d14951fe9c7e","facility":"user-level","timestamp":"2016-09-01 15:24:46.171"}},{"_index":"graylog_0","_type":"message","_id":"46071100-7058-11e6-aa1c-005056ae679b","_score":1.0,"_source":{"app":"systemd","level":6,"gl2_remote_ip":"1.2.3.4","gl2_remote_port":46710,"streams":[],"source":"hostname.ACME.de","message":"Starting Session 6464 of user APP.","gl2_source_input":"57c84309a835250b47053552","application_name":"systemd","gl2_source_node":"24e16c9f-7cdf-4016-a67e-d14951fe9c7e","facility":"system daemon","timestamp":"2016-09-01 15:25:01.405"}},{"_index":"graylog_0","_type":"message","_id":"f91ed840-7058-11e6-aa1c-005056ae679b","_score":1.0,"_source":{"app":"systemd","level":6,"gl2_remote_ip":"1.2.3.4","gl2_remote_port":46710,"streams":[],"source":"hostname.ACME.de","message":"Started Session 6465 of user APP.","gl2_source_input":"57c84309a835250b47053552","application_name":"systemd","gl2_source_node":"24e16c9f-7cdf-4016-a67e-d14951fe9c7e","facility":"system daemon","timestamp":"2016-09-01 15:30:01.865"}},{"_index":"graylog_0","_type":"message","_id":"f91dede1-7058-11e6-aa1c-005056ae679b","_score":1.0,"_source":{"app":"systemd","level":6,"gl2_remote_ip":"1.2.3.4","gl2_remote_port":46710,"streams":[],"source":"hostname.ACME.de","message":"Starting Session 6466 of user root.","gl2_source_input":"57c84309a835250b47053552","application_name":"systemd","gl2_source_node":"24e16c9f-7cdf-4016-a67e-d14951fe9c7e","facility":"system daemon","timestamp":"2016-09-01 15:30:01.859"}}]}}


# curl -X GET http://localhost:9200/_search?size=5

{"took":1,"timed_out":false,"_shards":{"total":4,"successful":4,"failed":0},"hits":{"total":15,"max_score":1.0,"hits":[{"_index":"graylog_0","_type":"message","_id":"f91dede0-7058-11e6-aa1c-005056ae679b","_score":1.0,"_source":{"app":"systemd","level":6,"gl2_remote_ip":"1.2.3.4","gl2_remote_port":46710,"streams":[],"source":"hostname.ACME.de","message":"Started Session 6466 of user root.","gl2_source_input":"57c84309a835250b47053552","application_name":"systemd","gl2_source_node":"24e16c9f-7cdf-4016-a67e-d14951fe9c7e","facility":"system daemon","timestamp":"2016-09-01 15:30:01.850"}},{"_index":"graylog_0","_type":"message","_id":"f91fe9b0-7058-11e6-aa1c-005056ae679b","_score":1.0,"_source":{"app":"CROND","process_id":"32675","level":6,"gl2_remote_ip":"1.2.3.4","gl2_remote_port":46710,"streams":[],"source":"hostname.ACME.de","message":"(root) CMD (/usr/lib64/sa/sa1 1 1)","gl2_source_input":"57c84309a835250b47053552","application_name":"CROND","gl2_source_node":"24e16c9f-7cdf-4016-a67e-d14951fe9c7e","facility":"clock","timestamp":"2016-09-01 15:30:01.871"}},{"_index":"graylog_0","_type":"message","_id":"4606e9f0-7058-11e6-aa1c-005056ae679b","_score":1.0,"_source":{"app":"systemd","level":6,"gl2_remote_ip":"1.2.3.4","gl2_remote_port":46710,"streams":[],"source":"hostname.ACME.de","message":"Started Session 6464 of user APP.","gl2_source_input":"57c84309a835250b47053552","application_name":"systemd","gl2_source_node":"24e16c9f-7cdf-4016-a67e-d14951fe9c7e","facility":"system daemon","timestamp":"2016-09-01 15:25:01.403"}},{"_index":"graylog_0","_type":"message","_id":"4608e5c0-7058-11e6-aa1c-005056ae679b","_score":1.0,"_source":{"app":"CROND","process_id":"30360","level":6,"gl2_remote_ip":"1.2.3.4","gl2_remote_port":46710,"streams":[],"source":"hostname.ACME.de","message":"(APP) CMD ($HOME/bin/APP.Daemon.pl start >> /dev/null)","gl2_source_input":"57c84309a835250b47053552","application_name":"CROND","gl2_source_node":"24e16c9f-7cdf-4016-a67e-d14951fe9c7e","facility":"clock","timestamp":"2016-09-01 15:25:01.415"}},{"_index":"graylog_0","_type":"message","_id":"f944d6d0-7058-11e6-aa1c-005056ae679b","_score":1.0,"_source":{"app":"systemd","level":6,"gl2_remote_ip":"1.2.3.4","gl2_remote_port":46710,"streams":[],"source":"hostname.ACME.de","message":"Started Cleanup of Temporary Directories.","gl2_source_input":"57c84309a835250b47053552","application_name":"systemd","gl2_source_node":"24e16c9f-7cdf-4016-a67e-d14951fe9c7e","facility":"system daemon","timestamp":"2016-09-01 15:30:02.115"}}]}}

ghost avatar Sep 01 '16 15:09 ghost

@lynndixon @yves-vogl Please try using Elasticsearch 2.3.x, just to rule out incompatibilities with the recently released Elasticsearch 2.4.0.

joschi avatar Sep 01 '16 15:09 joschi

Confirmed. Everything works fine when you back ElasticSearch down to v2.3.5.

jtstuedle avatar Sep 01 '16 16:09 jtstuedle

Is there a repo that has v2.3.5? I am only seeing version 2.4 in the repo I am using.

lynndixon avatar Sep 01 '16 16:09 lynndixon

Found 2.3.5-1 in an elasticsearch 2.x repo and installed it.

Looks like that may have resolved my problem:

image

lynndixon avatar Sep 01 '16 16:09 lynndixon

Confirmed. I ran into exactly the same symptoms with Elasticsearch 2.4.0 after successfully using 2.3.5. Even before attempting searches, Graylog gets into trouble creating its index:

2016-09-01T20:43:43.495Z WARN  [DeadEventLoggingListener] Received unhandled event of type <org.graylog2.plugin.lifecycles.Lifecycle> from event bus <AsyncEventBus{graylog-eventbus}>
2016-09-01T20:43:46.940Z WARN  [discovery] [graylog-3bc72b96-2585-40fa-be65-95c408ff268a] waited for 3s and no initial state was set by the discovery
2016-09-01T20:43:53.850Z WARN  [transport] [graylog-3bc72b96-2585-40fa-be65-95c408ff268a] Transport response handler not found of id [26]
2016-09-01T20:43:53.850Z ERROR [Indices] Unable to create the Graylog index template: graylog-internal
org.elasticsearch.index.mapper.MapperParsingException: Failed to parse mapping [message]: analyzer [analyzer_keyword] not found for field [source]
    at org.elasticsearch.index.mapper.MapperService.merge(MapperService.java:291) ~[graylog.jar:?]
    at org.elasticsearch.cluster.metadata.MetaDataIndexTemplateService.validateAndAddTemplate(MetaDataIndexTemplateService.java:213) ~[graylog.jar:?]
    at org.elasticsearch.cluster.metadata.MetaDataIndexTemplateService.access$200(MetaDataIndexTemplateService.java:57) ~[graylog.jar:?]
    at org.elasticsearch.cluster.metadata.MetaDataIndexTemplateService$2.execute(MetaDataIndexTemplateService.java:157) ~[graylog.jar:?]
    at org.elasticsearch.cluster.ClusterStateUpdateTask.execute(ClusterStateUpdateTask.java:45) ~[graylog.jar:?]
    at org.elasticsearch.cluster.service.InternalClusterService.runTasksForExecutor(InternalClusterService.java:468) ~[graylog.jar:?]
    at org.elasticsearch.cluster.service.InternalClusterService$UpdateTask.run(InternalClusterService.java:772) ~[graylog.jar:?]
    at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:231) ~[graylog.jar:?]
    at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:194) ~[graylog.jar:?]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [?:1.8.0_45]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [?:1.8.0_45]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_45]
Caused by: org.elasticsearch.index.mapper.MapperParsingException: analyzer [analyzer_keyword] not found for field [source]
    at org.elasticsearch.index.mapper.core.TypeParsers.parseAnalyzersAndTermVectors(TypeParsers.java:213) ~[graylog.jar:?]
    at org.elasticsearch.index.mapper.core.TypeParsers.parseTextField(TypeParsers.java:250) ~[graylog.jar:?]
    at org.elasticsearch.index.mapper.core.StringFieldMapper$TypeParser.parse(StringFieldMapper.java:165) ~[graylog.jar:?]
    at org.elasticsearch.index.mapper.object.ObjectMapper$TypeParser.parseProperties(ObjectMapper.java:309) ~[graylog.jar:?]
    at org.elasticsearch.index.mapper.object.ObjectMapper$TypeParser.parseObjectOrDocumentTypeProperties(ObjectMapper.java:222) ~[graylog.jar:?]
    at org.elasticsearch.index.mapper.object.RootObjectMapper$TypeParser.parse(RootObjectMapper.java:139) ~[graylog.jar:?]
    at org.elasticsearch.index.mapper.DocumentMapperParser.parse(DocumentMapperParser.java:118) ~[graylog.jar:?]
    at org.elasticsearch.index.mapper.DocumentMapperParser.parse(DocumentMapperParser.java:99) ~[graylog.jar:?]
    at org.elasticsearch.index.mapper.MapperService.parse(MapperService.java:549) ~[graylog.jar:?]
    at org.elasticsearch.index.mapper.MapperService.merge(MapperService.java:319) ~[graylog.jar:?]
    at org.elasticsearch.index.mapper.MapperService.merge(MapperService.java:289) ~[graylog.jar:?]
    ... 11 more

Reverting to 2.3.5 fixes this.

eyablonowitz avatar Sep 01 '16 21:09 eyablonowitz

Did a fresh installation.

Choosen OS: Ubuntu 16 LTS; CentOS 7; Debian 8 Graylog: 2.1.0+62db7e0 Elasticsearch:

    "version" : {
    "number" : "2.4.0",
    "build_hash" : "ce9f0c7394dee074091dd1bc4e9469251181fc55",
    "build_timestamp" : "2016-08-29T09:14:17Z",
    "build_snapshot" : false,
    "lucene_version" : "5.5.2"
  },

And the issue is not present. IMHO we should document that Graylog 2.0 should be used with Elasticsearch 2.3.5 but shows some issues with Elasticsearch 2.4.

jalogisch avatar Sep 02 '16 05:09 jalogisch

I cannot reproduce this issue with Graylog 2.0.3 (installed from the tarball) on Mac OS X 10.11 and Elasticsearch 2.4.0:

2016-09-02 13:58:39,627 INFO : org.graylog2.bootstrap.ServerBootstrap - Graylog server 2.0.3 (f07c170) starting up
2016-09-02 13:58:39,627 INFO : org.graylog2.bootstrap.ServerBootstrap - JRE: Oracle Corporation 1.8.0_102 on Mac OS X 10.11.6
2016-09-02 13:58:39,628 INFO : org.graylog2.bootstrap.ServerBootstrap - Deployment: unknown
2016-09-02 13:58:39,628 INFO : org.graylog2.bootstrap.ServerBootstrap - OS: OS X El Captain (10.11.6)
2016-09-02 13:58:39,628 INFO : org.graylog2.bootstrap.ServerBootstrap - Arch: x86_64
[...]
2016-09-02 13:58:42,761 WARN : org.elasticsearch.discovery - [graylog-9b097ba9-d93c-42b0-be1d-50e62188aa9a] waited for 3s and no initial state was set by the discovery
2016-09-02 13:58:42,767 INFO : org.elasticsearch.http - [graylog-9b097ba9-d93c-42b0-be1d-50e62188aa9a] publish_address {127.0.0.1:9201}, bound_addresses {127.0.0.1:9201}
2016-09-02 13:58:42,768 INFO : org.elasticsearch.node - [graylog-9b097ba9-d93c-42b0-be1d-50e62188aa9a] started
2016-09-02 13:58:42,846 INFO : org.elasticsearch.cluster.service - [graylog-9b097ba9-d93c-42b0-be1d-50e62188aa9a] detected_master {Luchino Nefaria}{KDLuP3daSTmjOGMNgADhPQ}{127.0.0.1}{127.0.0.1:9300}, added {{Luchino Nefaria}{KDLuP3daSTmjOGMNgADhPQ}{127.0.0.1}{127.0.0.1:9300},}, reason: zen-disco-receive(from master [{Luchino Nefaria}{KDLuP3daSTmjOGMNgADhPQ}{127.0.0.1}{127.0.0.1:9300}])
$ curl localhost:9200
{
  "name" : "Luchino Nefaria",
  "cluster_name" : "graylog2",
  "version" : {
    "number" : "2.4.0",
    "build_hash" : "ce9f0c7394dee074091dd1bc4e9469251181fc55",
    "build_timestamp" : "2016-08-29T09:14:17Z",
    "build_snapshot" : false,
    "lucene_version" : "5.5.2"
  },
  "tagline" : "You Know, for Search"
}

joschi avatar Sep 02 '16 12:09 joschi

Ha!

Now I could reproduce it. It only happens on index rotation when Graylog tries to (re-) insert the graylog-internal index template.

joschi avatar Sep 02 '16 12:09 joschi

We only support Elasticsearch 2.3.x in Graylog 2.0.x.

If you update Elasticsearch to a new version, you can just drop in the update to the new Graylog release as well.

jalogisch avatar Sep 12 '16 09:09 jalogisch