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

Creating input fails with NPE #3515

Closed
edmundoa opened this Issue Feb 17, 2017 · 0 comments

Comments

Projects
None yet
3 participants
@edmundoa
Member

edmundoa commented Feb 17, 2017

Since 1aefec0, creating message inputs fail with a NPE, as puts in an ImmutableMap.Builder require the key and value to be non null.

Here is the request payload:

{
  "title": "Rawr",
  "type": "org.graylog2.inputs.raw.tcp.RawTCPInput",
  "configuration": {
    "bind_address": "0.0.0.0",
    "port": 5555,
    "recv_buffer_size": 1048576,
    "tls_cert_file": "",
    "tls_key_file": "",
    "tls_enable": false,
    "tls_key_password": "",
    "tls_client_auth": "disabled",
    "tls_client_auth_cert_file": "",
    "tcp_keepalive": false,
    "use_null_delimiter": false,
    "max_message_size": 2097152,
    "override_source": null
  },
  "global": true
}

And the stacktrace from the server logs:

2017-02-17 12:26:37,141 ERROR: org.graylog2.shared.rest.exceptionmappers.AnyExceptionClassMapper - Unhandled exception in REST resource
java.lang.NullPointerException: null value in entry: content_pack=null
	at com.google.common.collect.CollectPreconditions.checkEntryNotNull(CollectPreconditions.java:34) ~[guava-21.0.jar:?]
	at com.google.common.collect.ImmutableMapEntry.<init>(ImmutableMapEntry.java:49) ~[guava-21.0.jar:?]
	at com.google.common.collect.ImmutableMap.entryOf(ImmutableMap.java:172) ~[guava-21.0.jar:?]
	at com.google.common.collect.ImmutableMap$Builder.put(ImmutableMap.java:248) ~[guava-21.0.jar:?]
	at org.graylog2.plugin.inputs.MessageInput.asMap(MessageInput.java:273) ~[classes/:?]
	at org.graylog2.rest.resources.system.inputs.InputsResource.create(InputsResource.java:133) ~[classes/:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_112]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_112]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_112]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_112]
	at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81) ~[jersey-server-2.25.1.jar:?]
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144) ~[jersey-server-2.25.1.jar:?]
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161) ~[jersey-server-2.25.1.jar:?]
	at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:160) ~[jersey-server-2.25.1.jar:?]
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99) ~[jersey-server-2.25.1.jar:?]
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389) ~[jersey-server-2.25.1.jar:?]
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347) ~[jersey-server-2.25.1.jar:?]
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102) ~[jersey-server-2.25.1.jar:?]
	at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326) [jersey-server-2.25.1.jar:?]
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) [jersey-common-2.25.1.jar:?]
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) [jersey-common-2.25.1.jar:?]
	at org.glassfish.jersey.internal.Errors.process(Errors.java:315) [jersey-common-2.25.1.jar:?]
	at org.glassfish.jersey.internal.Errors.process(Errors.java:297) [jersey-common-2.25.1.jar:?]
	at org.glassfish.jersey.internal.Errors.process(Errors.java:267) [jersey-common-2.25.1.jar:?]
	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) [jersey-common-2.25.1.jar:?]
	at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305) [jersey-server-2.25.1.jar:?]
	at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154) [jersey-server-2.25.1.jar:?]
	at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:384) [jersey-container-grizzly2-http-2.25.1.jar:?]
	at org.glassfish.grizzly.http.server.HttpHandler$1.run(HttpHandler.java:224) [grizzly-http-server-2.3.28.jar:2.3.28]
	at com.codahale.metrics.InstrumentedExecutorService$InstrumentedRunnable.run(InstrumentedExecutorService.java:176) [metrics-core-3.1.2.jar:3.1.2]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_112]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_112]
	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_112]

Your Environment

  • Graylog Version: Graylog 2.3.0-SNAPSHOT (5cb2891)

@edmundoa edmundoa added the bug label Feb 17, 2017

@edmundoa edmundoa added this to the 2.3.0 milestone Feb 17, 2017

@joschi joschi self-assigned this Feb 20, 2017

joschi added a commit that referenced this issue Feb 20, 2017

@joschi joschi added the triaged label Feb 20, 2017

@joschi joschi added the in progress label Feb 20, 2017

@wafflebot wafflebot bot removed the in progress label Feb 20, 2017

dennisoelkers added a commit that referenced this issue Feb 20, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment