GET /api/system/bundles returns "ApiError" with empty message and HTTP code 500


I’m facing with such responce on GET /api/system/bundles :


  "type": "ApiError",
  "message": ""

Looks like it happend after PUT request with the incorrect payload. I’ve got return code 201 on that PUT, but after this, I’m not able to list content packs anymore.

I’ve tried already to restart graylog-server process on one of nodes, but wthout success, GET /api/system/bundles still returning ApiError and HTTP code 500.

Maybe someone has ideas, how to fix it?

ps: unluckily, I’ve lost original response message after uploading incorrect content pack, so I can’t delete it by id.

So there is any bypass mechanism to get the list of content packs rather than via API?

Thanks in advance!

p.s. Graylog version is 2.4.7+9116ead

at the graylog server log, I am getting this at the moment of request:

2019-12-10T13:27:06.351+01:00 ERROR [AnyExceptionClassMapper] Unhandled exception in REST resource
java.lang.NullPointerException: null
        at ~[graylog.jar:?]
        at$Builder.put( ~[graylog.jar:?]
        at ~[graylog.jar:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_181]
        at sun.reflect.NativeMethodAccessorImpl.invoke( ~[?:1.8.0_181]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke( ~[?:1.8.0_181]
        at java.lang.reflect.Method.invoke( ~[?:1.8.0_181]
        at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke( ~[graylog.jar:?]
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$ ~[graylog.jar:?]
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke( ~[graylog.jar:?]
        at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch( ~[graylog.jar:?]
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch( ~[graylog.jar:?]
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke( ~[graylog.jar:?]
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply( ~[graylog.jar:?]
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply( ~[graylog.jar:?]
        at org.glassfish.jersey.server.ServerRuntime$ [graylog.jar:?]
        at org.glassfish.jersey.internal.Errors$ [graylog.jar:?]
        at org.glassfish.jersey.internal.Errors$ [graylog.jar:?]
        at org.glassfish.jersey.internal.Errors.process( [graylog.jar:?]
        at org.glassfish.jersey.internal.Errors.process( [graylog.jar:?]
        at org.glassfish.jersey.internal.Errors.process( [graylog.jar:?]
        at org.glassfish.jersey.process.internal.RequestScope.runInScope( [graylog.jar:?]
        at org.glassfish.jersey.server.ServerRuntime.process( [graylog.jar:?]
        at org.glassfish.jersey.server.ApplicationHandler.handle( [graylog.jar:?]
        at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service( [graylog.jar:?]
        at org.glassfish.grizzly.http.server.HttpHandler$ [graylog.jar:?]
        at com.codahale.metrics.InstrumentedExecutorService$ [graylog.jar:?]        at java.util.concurrent.ThreadPoolExecutor.runWorker( [?:1.8.0_181]
        at java.util.concurrent.ThreadPoolExecutor$ [?:1.8.0_181]
        at [?:1.8.0_181]

it could be that you hit a bug in that old version. You might need to cleanup the mongodb collection for that.

But sorry I do not have such an old version running to check which collection that actually is. It might be named like content_packs or similar.

1 Like

That was actually the only my idea, but I am bit lacking of documentation regarding, how to access local mongodb instance for Graylog node. Maybe you could sent me some starting points/keywords for it?
And another question, should I make such cleanup for all graylog nodes in the cluster, or they are replicating auto-magically?

he @epiqsty

if you have multiple MongoDB instances in your setup that are part of a cluster - build a replica set or replicate you only need to make the write to the mongoDB master server and it will be replicated to all secondary servers.

you might want to spin up one instance of nosqlclient to help you with the task - it is a mongoDB client ( )

This would make it also easier to identify the malicious parts in the database.

Thanks a lot!
With nosqlclient and additional help of
I was able to connect to MongoDb, and reach out the ID of incorrect content pack bundle in content_packs collection.
Then I’ve deleted such content pack via Graylog API and /api/system/bundles endpoint started working again!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.