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

Error when updating a bundle (content pack) #2138

Closed
tomac opened this issue Apr 25, 2016 · 0 comments
Closed

Error when updating a bundle (content pack) #2138

tomac opened this issue Apr 25, 2016 · 0 comments
Assignees
Labels
bug
Milestone

Comments

@tomac
Copy link

@tomac tomac commented Apr 25, 2016

Problem description

I'm getting the following error when updating a bundle:
{"type":"ApiError","message":"No objects to return"}

And the log shows:

2016-04-25 00:58:25,732 ERROR: org.graylog2.shared.rest.exceptionmappers.AnyExceptionClassMapper - Unhandled exception in REST resource
com.mongodb.MongoException: No objects to return
    at org.mongojack.WriteResult.getSavedObject(WriteResult.java:65) ~[graylog.jar:?]
    at org.graylog2.bundles.BundleService.update(BundleService.java:92) ~[graylog.jar:?]
    at org.graylog2.rest.resources.system.bundles.BundleResource.updateBundle(BundleResource.java:139) ~[graylog.jar:?]
    at sun.reflect.GeneratedMethodAccessor131.invoke(Unknown Source) ~[?:?]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_72-internal]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_72-internal]
    at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81) ~[graylog.jar:?]
    at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144) ~[graylog.jar:?]
    at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161) ~[graylog.jar:?]
    at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$VoidOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:143) ~[graylog.jar:?]
    at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99) ~[graylog.jar:?]
    at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389) ~[graylog.jar:?]
    at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347) ~[graylog.jar:?]
    at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102) ~[graylog.jar:?]
    at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326) [graylog.jar:?]
    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) [graylog.jar:?]
    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) [graylog.jar:?]
    at org.glassfish.jersey.internal.Errors.process(Errors.java:315) [graylog.jar:?]
    at org.glassfish.jersey.internal.Errors.process(Errors.java:297) [graylog.jar:?]
    at org.glassfish.jersey.internal.Errors.process(Errors.java:267) [graylog.jar:?]
    at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) [graylog.jar:?]
    at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305) [graylog.jar:?]
    at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154) [graylog.jar:?]
    at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:384) [graylog.jar:?]
    at org.glassfish.grizzly.http.server.HttpHandler$1.run(HttpHandler.java:224) [graylog.jar:?]
    at com.codahale.metrics.InstrumentedExecutorService$InstrumentedRunnable.run(InstrumentedExecutorService.java:176) [graylog.jar:?]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_72-internal]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_72-internal]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_72-internal]

Steps to reproduce the problem

  1. Create a new bundle:
{
        'id': None,
        'name': 'CounterCraft Content Pack',
        'description': 'Everything you need',
        'category': 'CounterCraft',
        'inputs': [ {
          "configuration": {
              "allow_override_date": True,
              "bind_address": "0.0.0.0",
              "expand_structured_data": False,
              "force_rdns": False,
              "override_source": None,
              "port": 514,
              "recv_buffer_size": 262144,
              "store_full_message": False
          },
          "title":  "Syslog UDP",
          "global":  True,
          "type":"org.graylog2.inputs.syslog.udp.SyslogUDPInput",
          "extractors": []
        }, {
          "configuration": {
              "allow_override_date": True,
              "bind_address": "0.0.0.0",
              "expand_structured_data": False,
              "force_rdns": False,
              "max_message_size": 2097152,
              "override_source": None,
              "port": 514,
              "recv_buffer_size": 1048576,
              "store_full_message": False,
              "tcp_keepalive": False,
              "tls_cert_file": "",
              "tls_client_auth": "disabled",
              "tls_client_auth_cert_file": "",
              "tls_enable": False,
              "tls_key_file": "",
              "tls_key_password": "",
              "use_null_delimiter": False
          },
          "title":  "Syslog TCP",
          "global":  True,
          "type":"org.graylog2.inputs.syslog.tcp.SyslogTCPInput",
          "extractors": []
        }],
        "outputs": [],
        "dashboards": [],
        "grok_patterns": []
    }
  1. Update the bundle with the same information

Environment

  • Graylog Version: Graylog 2.0.0-beta.3
  • Elasticsearch Version: 2.3.1
  • MongoDB Version: 3.0.9
  • Operating System: Debian jessie
  • Browser version: Chrome 50.0.2661.75
joschi pushed a commit that referenced this issue Apr 26, 2016
The WriteResult returned by JacksonDBCollection doesn't contain the updated object
and thus WriteResult#getSavedObject() failed with "No objects to return". The returned
WriteResult does contain the number of changed documents, though, so simply comparing
that number with the expected number of updated documents suffices as return value of
BundleService#update().

Fixes #2138
@joschi joschi self-assigned this Apr 26, 2016
@joschi joschi added the bug label Apr 26, 2016
@joschi joschi added this to the 2.0.0 milestone Apr 26, 2016
@bernd bernd closed this in 1e7388f Apr 26, 2016
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
You can’t perform that action at this time.