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

Handle decorator creation and execution errors #2592

Merged
merged 1 commit into from Aug 3, 2016

Conversation

Projects
None yet
2 participants
@bernd
Member

bernd commented Aug 3, 2016

When the decoration creation or exection fails, the search request should not fail but return the undecorated result.

Turns this unhandled exception that returns a 500 for a search request and leaves the UI in a bad state ...

2016-08-03 10:04:22,240 ERROR: org.graylog2.shared.rest.exceptionmappers.AnyExceptionClassMapper - Unhandled exception in REST resource
java.lang.NullPointerException: source_field cannot be null
    at java.util.Objects.requireNonNull(Objects.java:228) ~[?:1.8.0_101]
    at org.graylog2.decorators.SyslogSeverityMapperDecorator.<init>(SyslogSeverityMapperDecorator.java:96) ~[classes/:?]
    at org.graylog2.decorators.SyslogSeverityMapperDecorator$$FastClassByGuice$$ec295563.newInstance(<generated>) ~[classes/:?]
    at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:89) ~[guice-4.1.0.jar:?]
    at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:111) ~[guice-4.1.0.jar:?]
    at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90) ~[guice-4.1.0.jar:?]
    at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:268) ~[guice-4.1.0.jar:?]
    at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1019) ~[guice-4.1.0.jar:?]
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1085) ~[guice-4.1.0.jar:?]
    at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1015) ~[guice-4.1.0.jar:?]
    at com.google.inject.assistedinject.FactoryProvider2.invoke(FactoryProvider2.java:776) ~[guice-assistedinject-4.1.0.jar:?]
    at com.sun.proxy.$Proxy99.create(Unknown Source) ~[?:?]
    at org.graylog2.decorators.DecoratorResolver.instantiateSearchResponseDecorator(DecoratorResolver.java:63) ~[classes/:?]
    at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_101]
    at java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:352) ~[?:1.8.0_101]
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) ~[?:1.8.0_101]
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) ~[?:1.8.0_101]
    at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) ~[?:1.8.0_101]
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_101]
    at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) ~[?:1.8.0_101]
    at org.graylog2.decorators.DecoratorResolver.searchResponseDecoratorsForGlobal(DecoratorResolver.java:56) ~[classes/:?]
    at org.graylog2.decorators.DecoratorProcessorImpl.decorate(DecoratorProcessorImpl.java:47) ~[classes/:?]
    at org.graylog2.rest.resources.search.SearchResource.buildSearchResponse(SearchResource.java:184) ~[classes/:?]
    at org.graylog2.rest.resources.search.RelativeSearchResource.searchRelative(RelativeSearchResource.java:113) ~[classes/:?]

... into an error log message and returns the undecorated search result.

2016-08-03 10:09:26,643 ERROR: org.graylog2.decorators.DecoratorResolver - Unable to create <Syslog Severity Mapper> decorator
java.lang.NullPointerException: source_field cannot be null
    at java.util.Objects.requireNonNull(Objects.java:228) ~[?:1.8.0_101]
    at org.graylog2.decorators.SyslogSeverityMapperDecorator.<init>(SyslogSeverityMapperDecorator.java:96) ~[classes/:?]
    at org.graylog2.decorators.SyslogSeverityMapperDecorator$$FastClassByGuice$$ec295563.newInstance(<generated>) ~[classes/:?]
    at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:89) ~[guice-4.1.0.jar:?]
    at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:111) ~[guice-4.1.0.jar:?]
    at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90) ~[guice-4.1.0.jar:?]
    at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:268) ~[guice-4.1.0.jar:?]
    at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1019) ~[guice-4.1.0.jar:?]
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1085) ~[guice-4.1.0.jar:?]
    at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1015) ~[guice-4.1.0.jar:?]
    at com.google.inject.assistedinject.FactoryProvider2.invoke(FactoryProvider2.java:776) ~[guice-assistedinject-4.1.0.jar:?]
    at com.sun.proxy.$Proxy99.create(Unknown Source) ~[?:?]
    at org.graylog2.decorators.DecoratorResolver.instantiateSearchResponseDecorator(DecoratorResolver.java:68) ~[classes/:?]
    at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) [?:1.8.0_101]
    at java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:352) [?:1.8.0_101]
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) [?:1.8.0_101]
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) [?:1.8.0_101]
    at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) [?:1.8.0_101]
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) [?:1.8.0_101]
    at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) [?:1.8.0_101]
    at org.graylog2.decorators.DecoratorResolver.searchResponseDecoratorsForGlobal(DecoratorResolver.java:60) [classes/:?]
    at org.graylog2.decorators.DecoratorProcessorImpl.decorate(DecoratorProcessorImpl.java:52) [classes/:?]
    at org.graylog2.rest.resources.search.SearchResource.buildSearchResponse(SearchResource.java:184) [classes/:?]
    at org.graylog2.rest.resources.search.RelativeSearchResource.searchRelative(RelativeSearchResource.java:113) [classes/:?]
Handle decorator creation and execution errors
When the decoration creation or exection fails, the search request
should not fail but return the undecorated result.

@bernd bernd added this to the 2.1.0 milestone Aug 3, 2016

@kroepke kroepke self-assigned this Aug 3, 2016

@kroepke

This comment has been minimized.

Member

kroepke commented Aug 3, 2016

lgtm

@kroepke kroepke merged commit 3e3f8c2 into master Aug 3, 2016

4 checks passed

ci-server-integration Jenkins build graylog2-server-integration-pr 1204 has succeeded
Details
ci-web-linter Jenkins build graylog-pr-linter-check 687 has succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@kroepke kroepke deleted the handle-decorator-resolver-errors branch Aug 3, 2016

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