Graylog2 / graylog2-server

Free and open log management
https://www.graylog.org
Other
7.35k stars 1.06k forks source link

"Select Contet Pack" stuck in "loading..." #5664

Open S1L3NC3 opened 5 years ago

S1L3NC3 commented 5 years ago

Environment: OS: Debian 9 stretch Graylog ver: 2.5.1 Mongdb ver: 3.6.10 Elasticsearch ver: 6.2.4 Browser: any

Description: In tab "Content packs" within graylog, it stucks in "loading". To reproduce: click on "Content packs" and "loading" never desappears.

Testcase: Checking server.log from graylog:


java.lang.RuntimeException: IOException encountered while reading from a byte array input stream
        at org.mongojack.internal.stream.JacksonDBDecoder.decode(JacksonDBDecoder.java:67) ~[graylog.jar:?]
        at com.mongodb.DBDecoderAdapter.decode(DBDecoderAdapter.java:49) ~[graylog.jar:?]
        at com.mongodb.DBDecoderAdapter.decode(DBDecoderAdapter.java:29) ~[graylog.jar:?]
        at com.mongodb.operation.CommandResultArrayCodec.decode(CommandResultArrayCodec.java:52) ~[graylog.jar:?]
        at com.mongodb.operation.CommandResultDocumentCodec.readValue(CommandResultDocumentCodec.java:60) ~[graylog.jar:?]
        at org.bson.codecs.BsonDocumentCodec.decode(BsonDocumentCodec.java:84) ~[graylog.jar:?]
        at org.bson.codecs.BsonDocumentCodec.decode(BsonDocumentCodec.java:41) ~[graylog.jar:?]
        at org.bson.codecs.configuration.LazyCodec.decode(LazyCodec.java:47) ~[graylog.jar:?]
        at org.bson.codecs.BsonDocumentCodec.readValue(BsonDocumentCodec.java:101) ~[graylog.jar:?]
        at com.mongodb.operation.CommandResultDocumentCodec.readValue(CommandResultDocumentCodec.java:63) ~[graylog.jar:?]
        at org.bson.codecs.BsonDocumentCodec.decode(BsonDocumentCodec.java:84) ~[graylog.jar:?]
        at org.bson.codecs.BsonDocumentCodec.decode(BsonDocumentCodec.java:41) ~[graylog.jar:?]
        at com.mongodb.connection.ReplyMessage.<init>(ReplyMessage.java:50) ~[graylog.jar:?]
        at com.mongodb.connection.CommandProtocol.getResponseDocument(CommandProtocol.java:132) ~[graylog.jar:?]
        at com.mongodb.connection.CommandProtocol.execute(CommandProtocol.java:111) ~[graylog.jar:?]
        at com.mongodb.connection.DefaultServer$DefaultServerProtocolExecutor.execute(DefaultServer.java:159) ~[graylog.jar:?]
        at com.mongodb.connection.DefaultServerConnection.executeProtocol(DefaultServerConnection.java:289) ~[graylog.jar:?]
        at com.mongodb.connection.DefaultServerConnection.command(DefaultServerConnection.java:176) ~[graylog.jar:?]
        at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:216) ~[graylog.jar:?]
        at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:207) ~[graylog.jar:?]
        at com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:113) ~[graylog.jar:?]
        at com.mongodb.operation.FindOperation$1.call(FindOperation.java:715) ~[graylog.jar:?]
        at com.mongodb.operation.FindOperation$1.call(FindOperation.java:709) ~[graylog.jar:?]
        at com.mongodb.operation.OperationHelper.withConnectionSource(OperationHelper.java:433) ~[graylog.jar:?]
        at com.mongodb.operation.OperationHelper.withConnection(OperationHelper.java:406) ~[graylog.jar:?]
        at com.mongodb.operation.FindOperation.execute(FindOperation.java:709) ~[graylog.jar:?]
        at com.mongodb.operation.FindOperation.execute(FindOperation.java:81) ~[graylog.jar:?]
        at com.mongodb.Mongo.execute(Mongo.java:810) ~[graylog.jar:?]
        at com.mongodb.Mongo$2.execute(Mongo.java:797) ~[graylog.jar:?]
        at com.mongodb.DBCursor.initializeCursor(DBCursor.java:871) ~[graylog.jar:?]
        at com.mongodb.DBCursor.hasNext(DBCursor.java:142) ~[graylog.jar:?]
        at org.mongojack.DBCursor.hasNext(DBCursor.java:330) ~[graylog.jar:?]
        at org.graylog2.bundles.BundleService.loadAll(BundleService.java:83) ~[graylog.jar:?]
        at org.graylog2.rest.resources.system.bundles.BundleResource.listBundles(BundleResource.java:100) ~[graylog.jar:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_191]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_191]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_191]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_191]
        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$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:205) ~[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:1149) [?:1.8.0_191]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_191]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_191]
Caused by: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "id" (class org.graylog2.bundles.ConfigurationBundle), not marked as ignorable (12 known properties: "outputs", "streams", "lookup_data_adapters", "lookup_caches", "inputs", "lookup_tables", "name", "description", "category", "dashboards", "grok_patterns", "_id"])
 at [Source: de.undercouch.bson4jackson.io.LittleEndianInputStream@2d488ed; pos: 62] (through reference chain: org.graylog2.bundles.ConfigurationBundle["id"])
        at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:62) ~[graylog.jar:?]
        at com.fasterxml.jackson.databind.DeserializationContext.handleUnknownProperty(DeserializationContext.java:834) ~[graylog.jar:?]
        at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:1093) ~[graylog.jar:?]
        at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:1478) ~[graylog.jar:?]
        at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownVanilla(BeanDeserializerBase.java:1456) ~[graylog.jar:?]
        at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:282) ~[graylog.jar:?]
        at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:140) ~[graylog.jar:?]
        at com.fasterxml.jackson.databind.ObjectMapper._readValue(ObjectMapper.java:3786) ~[graylog.jar:?]
        at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2181) ~[graylog.jar:?]
        at org.mongojack.internal.stream.JacksonDBDecoder.decode(JacksonDBDecoder.java:77) ~[graylog.jar:?]
        at org.mongojack.internal.stream.JacksonDBDecoder.decode(JacksonDBDecoder.java:64) ~[graylog.jar:?]```
edmundoa commented 5 years ago

Hello @S1L3NC3,

We need a few more details to be able to help you. Is this happening on a new setup or did you upgrade your existing one? Also, would you be so kind as to share with us the Content Packs in your Graylog setup?

Thank you!

S1L3NC3 commented 5 years ago

Thanks for ur answer @edmundoa . It's a new install via github repository. Since "loading" stage appers, I can't see the Content Packs installed by default. Under "Select Content Packs" there isn't anything, just "loading...". I had tried to get them with the following mongodb sentence:

db.content_packs.find({ "id" : { "$exists" : true } });

I attached the parse .txt

parse_mongodb_test.txt

Kind Regards, thanks!

S1L3NC3 commented 5 years ago

Hi again: I ckecked u pointed this issue as "bug". Can this be solved? Thanks!

kmerz commented 5 years ago

@S1L3NC3 could it be that you used your DB to test an upgrade with 3.0? The content pack collection does have output of 3.0 migrations. If yes, then all you can do now is remove the 3.0 content packs from your collection and remove the id field from your pre 3.0 content packs.

S1L3NC3 commented 5 years ago

Thanks for the response @kmerz . I checked the parse .txt and i saw there are 6 content packs with reference 3.0, but this was a new installation. Strange...

Since Content Pack page is permanently loading I cannot erase them from Graylog web.

Just I did a backup to the machine and then I erased them within mongodb with the following sentence:

db.content_packs.remove({ "category" : { "$exists" : false } });

This erased 6 content packs, but problem still goes on.

I will check this again tomorrow :) Thanks in advance.

dostoevskoy commented 5 years ago

Hi,

I met the same issue, when "Content packs" stucks in "loading". But my situation was a little bit another. It appeared after I had upgraded my graylog container from 3.0.0 to 3.0.1.

Environment: OS: Docker graylog/graylog Graylog ver: 3.0.1 Mongdb ver: 3.4

Error: graylog_1 | Caused by: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "requires" (class org.graylog2.contentpacks.model.AutoValue_ContentPackV1$Builder), not marked as ignorable (13 known properties: "entities", "rev", "summary", "vendor", "created_at", "name", "url", "v", "_id", "id", "description", "parameters", "server_version"]) graylog_1 | at [Source: de.undercouch.bson4jackson.io.LittleEndianInputStream@7e4adf0d; pos: 610] (through reference chain: org.graylog2.contentpacks.model.AutoValue_ContentPackV1$Builder["requires"]) I compeared content_packs from a fresh installation of graylog:3.0.1 and upgraded one and find, that upgrade process changed items into this collection and added additional field "requires". You can find the example below. An item from the fresh installation: { "_id" : ObjectId("5cb84b513b3af5000f35f2cc"), "id" : "1794d39d-077f-7360-b92b-95411b05fbce", "rev" : 1, "v" : "1", "name" : "Whois - Threat Intel Plugin", "summary" : "The Whois Lookup Table of the Threat Intel Plugin", "description" : "This content pack is part of the [Graylog Threat Intel Plugin](http://github.com/graylog-labs/graylog-plugin-threatintel).\n\n*Please do not delete it manually if you consider to use the Threat Intel Plugin's functions. It contains important resources required by the plugin.*\n\nThis is the lookup table for the WHOIS database, listing registered users of Internet resources like IPs, Netblocks or Domain Names. This lookup table is used internally by Graylog's Threat Intel Plugin. Do not delete it manually.", "vendor" : "Graylog <hello@graylog.com>", "url" : "https://github.com/Graylog2/graylog2-server", "created_at" : ISODate("2019-04-18T10:02:57.800Z"), "server_version" : "3.0.1+de74b68", "parameters" : [ ], "entities" : [ { "id" : "5ac762873d274666e34eca83", "type" : { "name" : "lookup_adapter", "version" : "1" }, "v" : "1", "data" : { "configuration" : { "connect_timeout" : { "@type" : "integer", "@value" : 1000 }, "read_timeout" : { "@type" : "integer", "@value" : 1000 }, "registry" : { "@type" : "string", "@value" : "ARIN" }, "type" : { "@type" : "string", "@value" : "whois" } }, "description" : { "@type" : "string", "@value" : "This is the data adapter for the WHOIS database, listing registered users of Internet resources like IPs, Netblocks or Domain Names. This adapter is used internally by Graylog's Threat Intel Plugin. Do not delete it manually." }, "name" : { "@type" : "string", "@value" : "whois" }, "title" : { "@type" : "string", "@value" : "Whois" } }, "constraints" : [ { "type" : "plugin-version", "plugin" : "org.graylog.plugins.threatintel.ThreatIntelPlugin", "version" : ">=3.0.0-alpha.2" }, { "type" : "server-version", "version" : ">=3.0.0-alpha.2+af8d8e0" } ] }, { "id" : "5ac762873d274666e34eca7c", "type" : { "name" : "lookup_cache", "version" : "1" }, "v" : "1", "data" : { "configuration" : { "expire_after_access" : { "@type" : "long", "@value" : 0 }, "expire_after_access_unit" : { "@type" : "string", "@value" : "DAYS" }, "expire_after_write" : { "@type" : "long", "@value" : 1 }, "expire_after_write_unit" : { "@type" : "string", "@value" : "DAYS" }, "max_size" : { "@type" : "integer", "@value" : 1000 }, "type" : { "@type" : "string", "@value" : "guava_cache" } }, "description" : { "@type" : "string", "@value" : "This is the cache for the WHOIS database, listing registered users of Internet resources like IPs, Netblocks or Domain Names. This cache is used internally by Graylog's Threat Intel Plugin. Do not delete it manually." }, "name" : { "@type" : "string", "@value" : "whois-cache" }, "title" : { "@type" : "string", "@value" : "Whois Cache" } }, "constraints" : [ { "type" : "plugin-version", "plugin" : "org.graylog.plugins.threatintel.ThreatIntelPlugin", "version" : ">=3.0.0-alpha.2" }, { "type" : "server-version", "version" : ">=3.0.0-alpha.2+af8d8e0" } ] }, { "id" : "5ac762873d274666e34eca90", "type" : { "name" : "lookup_table", "version" : "1" }, "v" : "1", "data" : { "cache_name" : { "@type" : "string", "@value" : "5ac762873d274666e34eca7c" }, "data_adapter_name" : { "@type" : "string", "@value" : "5ac762873d274666e34eca83" }, "default_multi_value" : { "@type" : "string", "@value" : "" }, "default_multi_value_type" : { "@type" : "string", "@value" : "NULL" }, "default_single_value" : { "@type" : "string", "@value" : "" }, "default_single_value_type" : { "@type" : "string", "@value" : "NULL" }, "description" : { "@type" : "string", "@value" : "This is the lookup table for the WHOIS database, listing registered users of Internet resources like IPs, Netblocks or Domain Names. This lookup table is used internally by Graylog's Threat Intel Plugin. Do not delete it manually." }, "name" : { "@type" : "string", "@value" : "whois" }, "title" : { "@type" : "string", "@value" : "Whois" } }, "constraints" : [ { "type" : "plugin-version", "plugin" : "org.graylog.plugins.threatintel.ThreatIntelPlugin", "version" : ">=3.0.0-alpha.2" }, { "type" : "server-version", "version" : ">=3.0.0-alpha.2+af8d8e0" } ] } ] } An item after the uprgading process: { "_id" : ObjectId("5c5193b3e64ada0001b56930"), "id" : "1794d39d-077f-7360-b92b-95411b05fbce", "rev" : 1, "v" : "1", "name" : "Whois - Threat Intel Plugin", "summary" : "The Whois Lookup Table of the Threat Intel Plugin", "description" : "This content pack is part of the [Graylog Threat Intel Plugin](http://github.com/graylog-labs/graylog-plugin-threatintel).\n\n*Please do not delete it manually if you consider to use the Threat Intel Plugin's functions. It contains important resources required by the plugin.*\n\nThis is the lookup table for the WHOIS database, listing registered users of Internet resources like IPs, Netblocks or Domain Names. This lookup table is used internally by Graylog's Threat Intel Plugin. Do not delete it manually.", "vendor" : "Graylog <hello@graylog.com>", "url" : "https://github.com/Graylog2/graylog2-server", "requires" : [ { "type" : "plugin-version", "plugin" : "org.graylog.plugins.threatintel.ThreatIntelPlugin", "version" : ">=3.0.0-alpha.2" }, { "type" : "server-version", "version" : ">=3.0.0-alpha.2+af8d8e0" } ], "parameters" : [ ], "entities" : [ { "id" : "5ac762873d274666e34eca83", "type" : { "name" : "lookup_adapter", "version" : "1" }, "v" : "1", "data" : { "configuration" : { "connect_timeout" : { "type" : "integer", "value" : 1000 }, "read_timeout" : { "type" : "integer", "value" : 1000 }, "registry" : { "type" : "string", "value" : "ARIN" }, "type" : { "type" : "string", "value" : "whois" } }, "description" : { "type" : "string", "value" : "This is the data adapter for the WHOIS database, listing registered users of Internet resources like IPs, Netblocks or Domain Names. This adapter is used internally by Graylog's Threat Intel Plugin. Do not delete it manually." }, "name" : { "type" : "string", "value" : "whois" }, "title" : { "type" : "string", "value" : "Whois" } } }, { "id" : "5ac762873d274666e34eca7c", "type" : { "name" : "lookup_cache", "version" : "1" }, "v" : "1", "data" : { "configuration" : { "expire_after_access" : { "type" : "long", "value" : 0 }, "expire_after_access_unit" : { "type" : "string", "value" : "DAYS" }, "expire_after_write" : { "type" : "long", "value" : 1 }, "expire_after_write_unit" : { "type" : "string", "value" : "DAYS" }, "max_size" : { "type" : "integer", "value" : 1000 }, "type" : { "type" : "string", "value" : "guava_cache" } }, "description" : { "type" : "string", "value" : "This is the cache for the WHOIS database, listing registered users of Internet resources like IPs, Netblocks or Domain Names. This cache is used internally by Graylog's Threat Intel Plugin. Do not delete it manually." }, "name" : { "type" : "string", "value" : "whois-cache" }, "title" : { "type" : "string", "value" : "Whois Cache" } } }, { "id" : "5ac762873d274666e34eca90", "type" : { "name" : "lookup_table", "version" : "1" }, "v" : "1", "data" : { "cache_name" : { "type" : "string", "value" : "5ac762873d274666e34eca7c" }, "data_adapter_name" : { "type" : "string", "value" : "5ac762873d274666e34eca83" }, "default_multi_value" : { "type" : "string", "value" : "" }, "default_multi_value_type" : { "type" : "string", "value" : "NULL" }, "default_single_value" : { "type" : "string", "value" : "" }, "default_single_value_type" : { "type" : "string", "value" : "NULL" }, "description" : { "type" : "string", "value" : "This is the lookup table for the WHOIS database, listing registered users of Internet resources like IPs, Netblocks or Domain Names. This lookup table is used internally by Graylog's Threat Intel Plugin. Do not delete it manually." }, "name" : { "type" : "string", "value" : "whois" }, "title" : { "type" : "string", "value" : "Whois" } } } ] }

I don't know if this information can be helpful, the issue is still open as I can see. Probably, I've made the upgrade in the wrong way. I've just increased the version of the graylog container and load a new one.