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

REST API NPE when using fields parameter and JSON #4068

Closed
tholu opened this issue Aug 9, 2017 · 1 comment
Closed

REST API NPE when using fields parameter and JSON #4068

tholu opened this issue Aug 9, 2017 · 1 comment
Assignees
Labels
bug
Milestone

Comments

@tholu
Copy link

@tholu tholu commented Aug 9, 2017

When trying to use https://github.com/graylog-labs/cli-dashboard I encountered the following exception:

graylog_1        | 2017-08-09 07:19:09,217 ERROR: org.graylog2.shared.rest.exceptionmappers.AnyExceptionClassMapper - Unhandled exception in REST resource
graylog_1        | java.lang.NullPointerException: null
graylog_1        |      at org.graylog2.indexer.searches.Searches.lambda$search$3(Searches.java:272) ~[graylog.jar:?]
graylog_1        |      at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_72-internal]
graylog_1        |      at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1374) ~[?:1.8.0_72-internal]
graylog_1        |      at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) ~[?:1.8.0_72-internal]
graylog_1        |      at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) ~[?:1.8.0_72-internal]
graylog_1        |      at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) ~[?:1.8.0_72-internal]
graylog_1        |      at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_72-internal]
graylog_1        |      at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) ~[?:1.8.0_72-internal]
graylog_1        |      at org.graylog2.indexer.searches.Searches.search(Searches.java:273) ~[graylog.jar:?]
graylog_1        |      at org.graylog2.rest.resources.search.RelativeSearchResource.searchRelative(RelativeSearchResource.java:111) ~[graylog.jar:?]

Further investigation suggests it happens when calling the JSON API on GET /search/universal/relative, see Steps to Reproduce.

Expected Behavior

API returns data and 200 status code.

Current Behavior

API Error with 500 status code.

Possible Solution

Fix NPE.

Steps to Reproduce (for bugs)

  1. Use Graylog REST API Brower
  2. Use JSON version of GET /search/universal/relative
  3. Enter * in query, 86400 in range, message in fields
  4. Click "Try it out!"
  5. Response:
{
  "type": "ApiError",
  "message": ""
}

Context

Cannot use cli-dashboard tool.

Your Environment

  • Graylog Version: Docker graylog2/server:2.3.0-1,
  • Elasticsearch Version: Docker elasticsearch:2
  • MongoDB Version: Docker mongo:3
  • Operating System: Docker 17.05.0-ce on Debian 8
@joschi joschi added the bug label Aug 9, 2017
@joschi joschi added this to the 2.3.1 milestone Aug 9, 2017
joschi pushed a commit that referenced this issue Aug 9, 2017
Jochen Schalanda
Fixes #4068
@joschi joschi self-assigned this Aug 9, 2017
@tholu
Copy link
Author

@tholu tholu commented Aug 9, 2017

Note: cli-dashboard version 1.0.0 was used, the API call seems to be fixed/different in version 1.1.1 there (works).

@bernd bernd closed this in #4069 Aug 11, 2017
bernd added a commit that referenced this issue Aug 11, 2017
joschi added a commit that referenced this issue Aug 11, 2017
…4069)

Fixes #4068

(cherry picked from commit 1aa1ba2)
bernd added a commit that referenced this issue Aug 11, 2017
…4069) (#4077)

Fixes #4068

(cherry picked from commit 1aa1ba2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants