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

[Bug in v 0.3.0] java.lang.NullPointerException: null #18

Open
sonnylaskar opened this issue Aug 4, 2017 · 3 comments
Open

[Bug in v 0.3.0] java.lang.NullPointerException: null #18

sonnylaskar opened this issue Aug 4, 2017 · 3 comments

Comments

@sonnylaskar
Copy link

sonnylaskar commented Aug 4, 2017

Hi,

I am using Graylog v2.3 and installed the plugin version 0.3.0 on CentOs 6.6
I downloaded the VMWare MIB files as mentioned in the README file.

I have only 1 MIB file:
/usr/share/mibs/1/VMWARE-ROOT-MIB.mib

When I start Graylog and start sending Snmp traps, I get the below error:

2017-08-03T18:48:18.130+05:30 ERROR [SnmpMibsLoader] Error loading MIB file: /usr/share/mibs/1/VMWARE-ROOT-MIB.mib
java.lang.NullPointerException: null
at net.percederberg.grammatica.parser.ReaderBuffer.ensureCapacity(ReaderBuffer.java:348) ~[graylog-plugin-snmp-0.3.0.jar:?]
at net.percederberg.grammatica.parser.ReaderBuffer.ensureBuffered(ReaderBuffer.java:320) ~[graylog-plugin-snmp-0.3.0.jar:?]
at net.percederberg.grammatica.parser.ReaderBuffer.peek(ReaderBuffer.java:222) ~[graylog-plugin-snmp-0.3.0.jar:?]
at net.percederberg.grammatica.parser.TokenStringDFA.match(TokenStringDFA.java:114) ~[graylog-plugin-snmp-0.3.0.jar:?]
at net.percederberg.grammatica.parser.Tokenizer$StringDFAMatcher.match(Tokenizer.java:507) ~[graylog-plugin-snmp-0.3.0.jar:?]
at net.percederberg.grammatica.parser.Tokenizer.nextToken(Tokenizer.java:327) ~[graylog-plugin-snmp-0.3.0.jar:?]
at net.percederberg.grammatica.parser.Tokenizer.next(Tokenizer.java:287) ~[graylog-plugin-snmp-0.3.0.jar:?]
at net.percederberg.grammatica.parser.Parser.peekToken(Parser.java:629) ~[graylog-plugin-snmp-0.3.0.jar:?]
at net.percederberg.grammatica.parser.Parser.nextToken(Parser.java:566) ~[graylog-plugin-snmp-0.3.0.jar:?]
at net.percederberg.grammatica.parser.RecursiveDescentParser.parseAlternative(RecursiveDescentParser.java:230) ~[graylog-plugin-snmp-0.3.0.jar:?]
at net.percederberg.grammatica.parser.RecursiveDescentParser.parsePattern(RecursiveDescentParser.java:198) ~[graylog-plugin-snmp-0.3.0.jar:?]
at net.percederberg.grammatica.parser.RecursiveDescentParser.parseElement(RecursiveDescentParser.java:261) ~[graylog-plugin-snmp-0.3.0.jar:?]
at net.percederberg.grammatica.parser.RecursiveDescentParser.parseAlternative(RecursiveDescentParser.java:227) ~[graylog-plugin-snmp-0.3.0.jar:?]
at net.percederberg.grammatica.parser.RecursiveDescentParser.parsePattern(RecursiveDescentParser.java:198) ~[graylog-plugin-snmp-0.3.0.jar:?]
at net.percederberg.grammatica.parser.RecursiveDescentParser.parseStart(RecursiveDescentParser.java:162) ~[graylog-plugin-snmp-0.3.0.jar:?]
at net.percederberg.grammatica.parser.Parser.parse(Parser.java:394) ~[graylog-plugin-snmp-0.3.0.jar:?]
at net.percederberg.mibble.MibLoader$MibSource.parseMib(MibLoader.java:972) ~[graylog-plugin-snmp-0.3.0.jar:?]
at net.percederberg.mibble.MibLoader.loadQueue(MibLoader.java:724) ~[graylog-plugin-snmp-0.3.0.jar:?]
at net.percederberg.mibble.MibLoader.load(MibLoader.java:550) ~[graylog-plugin-snmp-0.3.0.jar:?]
at net.percederberg.mibble.MibLoader.load(MibLoader.java:479) ~[graylog-plugin-snmp-0.3.0.jar:?]
at org.graylog.snmp.oid.SnmpMibsLoader.loadMibsFromPath(SnmpMibsLoader.java:80) [graylog-plugin-snmp-0.3.0.jar:?]
at org.graylog.snmp.oid.SnmpMibsLoader.(SnmpMibsLoader.java:36) [graylog-plugin-snmp-0.3.0.jar:?]
at org.graylog.snmp.SnmpCommandResponder.(SnmpCommandResponder.java:38) [graylog-plugin-snmp-0.3.0.jar:?]
at org.graylog.snmp.codec.SnmpCodec.decode(SnmpCodec.java:61) [graylog-plugin-snmp-0.3.0.jar:?]
at org.graylog2.shared.buffers.processors.DecodingProcessor.processMessage(DecodingProcessor.java:146) [graylog.jar:?]
at org.graylog2.shared.buffers.processors.DecodingProcessor.onEvent(DecodingProcessor.java:87) [graylog.jar:?]
at org.graylog2.shared.buffers.processors.ProcessBufferProcessor.onEvent(ProcessBufferProcessor.java:74) [graylog.jar:?]
at org.graylog2.shared.buffers.processors.ProcessBufferProcessor.onEvent(ProcessBufferProcessor.java:42) [graylog.jar:?]
at com.lmax.disruptor.WorkProcessor.run(WorkProcessor.java:143) [graylog.jar:?]
at com.codahale.metrics.InstrumentedThreadFactory$InstrumentedRunnable.run(InstrumentedThreadFactory.java:66) [graylog.jar:?]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_111]

@joschi
Copy link
Contributor

joschi commented Aug 4, 2017

@sonnylaskar Please attach the MIB file.

@sonnylaskar
Copy link
Author

sonnylaskar commented Aug 4, 2017

I cleaned up everything to ensure that I have only 1 MIB file.
Now Error is about IndexOutOfBounds:

2017-08-04T17:18:14.453+05:30 ERROR [SnmpMibsLoader] Error loading MIB file: /usr/share/snmp/mibs/1/VMWARE-ROOT-MIB.mib
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        at java.util.ArrayList.rangeCheck(ArrayList.java:653) ~[?:1.8.0_111]
        at java.util.ArrayList.remove(ArrayList.java:492) ~[?:1.8.0_111]
        at net.percederberg.grammatica.parser.Parser.nextToken(Parser.java:569) ~[graylog-plugin-snmp-0.3.0.jar:?]
        at net.percederberg.grammatica.parser.Parser.nextToken(Parser.java:594) ~[graylog-plugin-snmp-0.3.0.jar:?]
        at net.percederberg.grammatica.parser.RecursiveDescentParser.parseElement(RecursiveDescentParser.java:257) ~[graylog-plugin-snmp-0.3.0.jar:?]
        at net.percederberg.grammatica.parser.RecursiveDescentParser.parseAlternative(RecursiveDescentParser.java:227) ~[graylog-plugin-snmp-0.3.0.jar:?]
        at net.percederberg.grammatica.parser.RecursiveDescentParser.parsePattern(RecursiveDescentParser.java:198) ~[graylog-plugin-snmp-0.3.0.jar:?]
        at net.percederberg.grammatica.parser.RecursiveDescentParser.parseElement(RecursiveDescentParser.java:261) ~[graylog-plugin-snmp-0.3.0.jar:?]
        at net.percederberg.grammatica.parser.RecursiveDescentParser.parseAlternative(RecursiveDescentParser.java:227) ~[graylog-plugin-snmp-0.3.0.jar:?]
        at net.percederberg.grammatica.parser.RecursiveDescentParser.parsePattern(RecursiveDescentParser.java:198) ~[graylog-plugin-snmp-0.3.0.jar:?]
        at net.percederberg.grammatica.parser.RecursiveDescentParser.parseElement(RecursiveDescentParser.java:261) ~[graylog-plugin-snmp-0.3.0.jar:?]
        at net.percederberg.grammatica.parser.RecursiveDescentParser.parseAlternative(RecursiveDescentParser.java:227) ~[graylog-plugin-snmp-0.3.0.jar:?]
        at net.percederberg.grammatica.parser.RecursiveDescentParser.parsePattern(RecursiveDescentParser.java:198) ~[graylog-plugin-snmp-0.3.0.jar:?]
        at net.percederberg.grammatica.parser.RecursiveDescentParser.parseStart(RecursiveDescentParser.java:162) ~[graylog-plugin-snmp-0.3.0.jar:?]
        at net.percederberg.grammatica.parser.Parser.parse(Parser.java:394) ~[graylog-plugin-snmp-0.3.0.jar:?]
        at net.percederberg.mibble.MibLoader$MibSource.parseMib(MibLoader.java:972) ~[graylog-plugin-snmp-0.3.0.jar:?]
        at net.percederberg.mibble.MibLoader.loadQueue(MibLoader.java:724) ~[graylog-plugin-snmp-0.3.0.jar:?]
        at net.percederberg.mibble.MibLoader.load(MibLoader.java:550) ~[graylog-plugin-snmp-0.3.0.jar:?]
        at net.percederberg.mibble.MibLoader.load(MibLoader.java:479) ~[graylog-plugin-snmp-0.3.0.jar:?]
        at org.graylog.snmp.oid.SnmpMibsLoader.loadMibsFromPath(SnmpMibsLoader.java:80) [graylog-plugin-snmp-0.3.0.jar:?]
        at org.graylog.snmp.oid.SnmpMibsLoader.<init>(SnmpMibsLoader.java:36) [graylog-plugin-snmp-0.3.0.jar:?]
        at org.graylog.snmp.SnmpCommandResponder.<init>(SnmpCommandResponder.java:38) [graylog-plugin-snmp-0.3.0.jar:?]
        at org.graylog.snmp.codec.SnmpCodec.decode(SnmpCodec.java:61) [graylog-plugin-snmp-0.3.0.jar:?]
        at org.graylog2.shared.buffers.processors.DecodingProcessor.processMessage(DecodingProcessor.java:146) [graylog.jar:?]
        at org.graylog2.shared.buffers.processors.DecodingProcessor.onEvent(DecodingProcessor.java:87) [graylog.jar:?]
        at org.graylog2.shared.buffers.processors.ProcessBufferProcessor.onEvent(ProcessBufferProcessor.java:74) [graylog.jar:?]
        at org.graylog2.shared.buffers.processors.ProcessBufferProcessor.onEvent(ProcessBufferProcessor.java:42) [graylog.jar:?]
        at com.lmax.disruptor.WorkProcessor.run(WorkProcessor.java:143) [graylog.jar:?]
        at com.codahale.metrics.InstrumentedThreadFactory$InstrumentedRunnable.run(InstrumentedThreadFactory.java:66) [graylog.jar:?]
        at java.lang.Thread.run(Thread.java:745) [?:1.8.0_111]
2017-08-04T17:18:14.469+05:30 WARN  [SnmpMibsLoader] Error parsing MIB file: /usr/share/snmp/mibs/1/VMWARE-ROOT-MIB.mib
 - unexpected token ""201601022000Z"" <QUOTED_STRING>, expected "DEFINITIONS"

Attaching the only
VMWARE-ROOT-MIB.txt

MIB file in the directory

@sonnylaskar
Copy link
Author

Attached is the MIB file which gave java.lang.NullPointerException exception
mib-rfc1907.txt

2017-08-04T17:50:17.605+05:30 ERROR [SnmpMibsLoader] Error loading MIB file: /usr/share/snmp/mibs/mib-rfc1907.txt
java.lang.NullPointerException: null
        at net.percederberg.grammatica.parser.TokenNFA.match(TokenNFA.java:194) ~[graylog-plugin-snmp-0.3.0.jar:?]
        at net.percederberg.grammatica.parser.Tokenizer$NFAMatcher.match(Tokenizer.java:560) ~[graylog-plugin-snmp-0.3.0.jar:?]
        at net.percederberg.grammatica.parser.Tokenizer.nextToken(Tokenizer.java:328) ~[graylog-plugin-snmp-0.3.0.jar:?]
        at net.percederberg.grammatica.parser.Tokenizer.next(Tokenizer.java:287) ~[graylog-plugin-snmp-0.3.0.jar:?]
        at net.percederberg.grammatica.parser.Parser.peekToken(Parser.java:629) ~[graylog-plugin-snmp-0.3.0.jar:?]
        at net.percederberg.grammatica.parser.LookAheadSet$Sequence.isNext(LookAheadSet.java:750) ~[graylog-plugin-snmp-0.3.0.jar:?]
        at net.percederberg.grammatica.parser.LookAheadSet.isNext(LookAheadSet.java:184) ~[graylog-plugin-snmp-0.3.0.jar:?]
        at net.percederberg.grammatica.parser.RecursiveDescentParser.isNext(RecursiveDescentParser.java:306) ~[graylog-plugin-snmp-0.3.0.jar:?]
        at net.percederberg.grammatica.parser.RecursiveDescentParser.parsePattern(RecursiveDescentParser.java:197) ~[graylog-plugin-snmp-0.3.0.jar:?]
        at net.percederberg.grammatica.parser.RecursiveDescentParser.parseStart(RecursiveDescentParser.java:162) ~[graylog-plugin-snmp-0.3.0.jar:?]
        at net.percederberg.grammatica.parser.Parser.parse(Parser.java:394) ~[graylog-plugin-snmp-0.3.0.jar:?]
        at net.percederberg.mibble.MibLoader$MibSource.parseMib(MibLoader.java:972) ~[graylog-plugin-snmp-0.3.0.jar:?]
        at net.percederberg.mibble.MibLoader.loadQueue(MibLoader.java:724) ~[graylog-plugin-snmp-0.3.0.jar:?]
        at net.percederberg.mibble.MibLoader.load(MibLoader.java:550) ~[graylog-plugin-snmp-0.3.0.jar:?]
        at net.percederberg.mibble.MibLoader.load(MibLoader.java:479) ~[graylog-plugin-snmp-0.3.0.jar:?]
        at org.graylog.snmp.oid.SnmpMibsLoader.loadMibsFromPath(SnmpMibsLoader.java:80) [graylog-plugin-snmp-0.3.0.jar:?]
        at org.graylog.snmp.oid.SnmpMibsLoader.<init>(SnmpMibsLoader.java:36) [graylog-plugin-snmp-0.3.0.jar:?]
        at org.graylog.snmp.SnmpCommandResponder.<init>(SnmpCommandResponder.java:38) [graylog-plugin-snmp-0.3.0.jar:?]
        at org.graylog.snmp.codec.SnmpCodec.decode(SnmpCodec.java:61) [graylog-plugin-snmp-0.3.0.jar:?]
        at org.graylog2.shared.buffers.processors.DecodingProcessor.processMessage(DecodingProcessor.java:146) [graylog.jar:?]
        at org.graylog2.shared.buffers.processors.DecodingProcessor.onEvent(DecodingProcessor.java:87) [graylog.jar:?]
        at org.graylog2.shared.buffers.processors.ProcessBufferProcessor.onEvent(ProcessBufferProcessor.java:74) [graylog.jar:?]
        at org.graylog2.shared.buffers.processors.ProcessBufferProcessor.onEvent(ProcessBufferProcessor.java:42) [graylog.jar:?]
        at com.lmax.disruptor.WorkProcessor.run(WorkProcessor.java:143) [graylog.jar:?]
        at com.codahale.metrics.InstrumentedThreadFactory$InstrumentedRunnable.run(InstrumentedThreadFactory.java:66) [graylog.jar:?]
        at java.lang.Thread.run(Thread.java:745) [?:1.8.0_111]
2017-08-04T17:50:17.628+05:30 WARN  [SnmpMibsLoader] Error parsing MIB file: /usr/share/snmp/mibs/mib-rfc1907.txt
 - unexpected token "1" <NUMBER_STRING>, expected "DEFINITIONS"

 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants