CSV Adapter cannot parse file, but Lookup still works


(Philipp Ruland) #1

Hey,

I just noticed this in my Graylog logfiles:

2017-07-11T17:57:09.379+02:00 INFO  [LookupTableService] Data Adapter cisco-mnemonics/5964ec0f8773ef433de0754c [@5cbf248b] RUNNING
2017-07-11T17:57:09.379+02:00 INFO  [LookupDataAdapterRefreshService] Adding job for <cisco-mnemonics/5964ec0f8773ef433de0754c/@5cbf248b> [interval=30000ms]
2017-07-11T17:57:09.379+02:00 INFO  [LookupTableService] Starting lookup table cisco-mnemonics/5964ed388773ef433de07691 [@105138fd] using cache do-not-cache/5964ed1a8773ef433de0766e [@469b316d], data adapter cisco-mnemonics/5964ec0f8773ef433de0754c [@5cbf248b]
2017-07-11T17:57:09.380+02:00 INFO  [LookupTableService] Replaced previous lookup table cisco-mnemonics [@2875e8ac]
2017-07-11T17:57:09.381+02:00 INFO  [LookupTableService] Data Adapter cisco-mnemonics/5964ec0f8773ef433de0754c [@3c573f3] STOPPING, was RUNNING
2017-07-11T17:57:09.381+02:00 INFO  [LookupDataAdapterRefreshService] Removing job for <cisco-mnemonics/5964ec0f8773ef433de0754c/@3c573f3>
2017-07-11T17:57:09.382+02:00 INFO  [LookupTableService] Data Adapter cisco-mnemonics/5964ec0f8773ef433de0754c [@3c573f3] TERMINATED, was STOPPING
2017-07-11T17:57:39.380+02:00 ERROR [CSVFileDataAdapter] Couldn't parse CSV file /usr/share/graylog-server/lookups/csv/ciscoMnemomics.csv (settings separator=<;> quotechar=<"> key_column=<key> value_column=<value>)
java.lang.ArrayIndexOutOfBoundsException: 1
        at org.graylog2.lookup.adapters.CSVFileDataAdapter.parseCSVFile(CSVFileDataAdapter.java:153) ~[graylog.jar:?]
        at org.graylog2.lookup.adapters.CSVFileDataAdapter.doRefresh(CSVFileDataAdapter.java:108) ~[graylog.jar:?]
        at org.graylog2.plugin.lookup.LookupDataAdapter.refresh(LookupDataAdapter.java:89) ~[graylog.jar:?]
        at org.graylog2.lookup.LookupDataAdapterRefreshService.lambda$schedule$0(LookupDataAdapterRefreshService.java:145) ~[graylog.jar:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_121]
        at java.util.concurrent.FutureTask.runAndReset(Unknown Source) [?:1.8.0_121]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) [?:1.8.0_121]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) [?:1.8.0_121]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_121]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_121]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_121]
2017-07-11T17:58:09.380+02:00 ERROR [LookupDataAdapter] Couldn't refresh data adapter <cisco-mnemonics/5964ec0f8773ef433de0754c/@5cbf248b>
java.lang.NullPointerException: null
        at org.graylog2.lookup.adapters.CSVFileDataAdapter.doRefresh(CSVFileDataAdapter.java:101) ~[graylog.jar:?]
        at org.graylog2.plugin.lookup.LookupDataAdapter.refresh(LookupDataAdapter.java:89) ~[graylog.jar:?]
        at org.graylog2.lookup.LookupDataAdapterRefreshService.lambda$schedule$0(LookupDataAdapterRefreshService.java:145) ~[graylog.jar:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_121]
        at java.util.concurrent.FutureTask.runAndReset(Unknown Source) [?:1.8.0_121]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) [?:1.8.0_121]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) [?:1.8.0_121]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_121]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_121]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_121]
2017-07-11T17:58:39.380+02:00 ERROR [LookupDataAdapter] Couldn't refresh data adapter <cisco-mnemonics/5964ec0f8773ef433de0754c/@5cbf248b>
java.lang.NullPointerException: null
        at org.graylog2.lookup.adapters.CSVFileDataAdapter.doRefresh(CSVFileDataAdapter.java:101) ~[graylog.jar:?]
        at org.graylog2.plugin.lookup.LookupDataAdapter.refresh(LookupDataAdapter.java:89) ~[graylog.jar:?]
        at org.graylog2.lookup.LookupDataAdapterRefreshService.lambda$schedule$0(LookupDataAdapterRefreshService.java:145) ~[graylog.jar:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_121]
        at java.util.concurrent.FutureTask.runAndReset(Unknown Source) [?:1.8.0_121]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) [?:1.8.0_121]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) [?:1.8.0_121]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_121]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_121]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_121]

Looking at the Graylog Source Code, the first traced line (l. 153) is a closing } of an if-clause and the second trace (l. 101) starts a try { block. I guess the code changed between 2.3.0beta1 and now, right?

I don’t see any configuration error or malformed csv (tried with and without trailing ;), but the best thing is, the lookup still works! :smiley:
"key";"value" "UPDOWN";"true" "FAN_LOW_RPM";"true" "MACFLAP_NOTIF";"true" "IPACCESSLOGP";"true" "ADDRESS_ASSIGN";"true" "CONFIG_I";"true"

Does anybody have the same issue, or is it just me? I’ll open a github issue if this isn’t a fault of my stupidness :smiley:

Greetings - Phil


(Jochen) #2

Please create an issue for this bug at https://github.com/Graylog2/graylog2-server/issues/ if it still occurs on Graylog 2.3.0-rc.1.

That’s what tags are for :wink:


(Philipp Ruland) #3

Will do after the update tomorrow :slight_smile:

Welp, I thought I selected it :smiley: Of course my stupidness messes with me again :smiley:

Greetings - Phil


(Philipp Ruland) #4

Hey @jochen,

the release candidate solved the error btw. :slight_smile:
This topic can be closed :slight_smile:

Greetings - Phil


(Jochen) #5