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

o.g.p.usagestatistics.UsageStatsNodePeriodical - NullPointerException: Null platformName #1737

Closed
SjonHortensius opened this Issue Jan 29, 2016 · 12 comments

Comments

Projects
None yet
3 participants
@SjonHortensius

SjonHortensius commented Jan 29, 2016

2016-01-23 12:21:32,349 ERROR: org.graylog.plugins.usagestatistics.UsageStatsNodePeriodical - Uncaught exception in periodical
java.lang.NullPointerException: Null platformName
at org.graylog.plugins.usagestatistics.dto.AutoValue_Os.<init>(AutoValue_Os.java:32)
at org.graylog.plugins.usagestatistics.dto.Os.create(Os.java:29)
at org.graylog.plugins.usagestatistics.collectors.NodeCollector.buildOsInfo(NodeCollector.java:140)
at org.graylog.plugins.usagestatistics.collectors.NodeCollector.buildNodeInfo(NodeCollector.java:133)
at org.graylog.plugins.usagestatistics.collectors.NodeCollector.getNodeDataSet(NodeCollector.java:120)
at org.graylog.plugins.usagestatistics.UsageStatsNodeService$1.get(UsageStatsNodeService.java:51)
at org.graylog.plugins.usagestatistics.UsageStatsNodeService$1.get(UsageStatsNodeService.java:48)
at com.google.common.base.Suppliers$ExpiringMemoizingSupplier.get(Suppliers.java:192)
at org.graylog.plugins.usagestatistics.UsageStatsNodeService.buildNodeDataSet(UsageStatsNodeService.java:57)
at org.graylog.plugins.usagestatistics.UsageStatsNodePeriodical.buildPayload(UsageStatsNodePeriodical.java:96)
at org.graylog.plugins.usagestatistics.UsageStatsPeriodical.doRun(UsageStatsPeriodical.java:93)
at org.graylog2.plugin.periodical.Periodical.run(Periodical.java:83)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

How does Graylog determine the platformName on a Linux machine? I could add a file if checks that. This machine has a /etc/os-release that describes the distr

@joschi

This comment has been minimized.

Contributor

joschi commented Jan 29, 2016

We're using os-platform-finder to determine the platform Graylog is running on.

Could you please provide the contents of your /etc/os-release file and tell us which operating system (exact version, if possible) you're using?

@SjonHortensius

This comment has been minimized.

SjonHortensius commented Jan 29, 2016

Looking at os-platform-finder it actually uses lsb-release instead, which contains:

LSB_VERSION=1.4
DISTRIB_ID=Arch
DISTRIB_RELEASE=rolling
DISTRIB_DESCRIPTION="Arch Linux"

Since Arch is a rolling distro, it doesn't have a version

@joschi

This comment has been minimized.

Contributor

joschi commented Jan 29, 2016

@SjonHortensius

This comment has been minimized.

SjonHortensius commented Jan 29, 2016

Yes, os-release is for systemd machines but as demonstrated we have an lsb-release as well. Also; UsageStatsNodePeriodical shouldn't fail if it can't determine the platform. So imo this is 2 bugs and 1 feature request ;)

@joschi

This comment has been minimized.

Contributor

joschi commented Jan 29, 2016

I agree that the plugin shouldn't crash with a NullPointerException.

Unfortunately the /etc/os-release file distributed with Arch Linux is invalid according to the specification. Quickly sampling Ubuntu Linux, CentOS, and Gentoo Linux, it seems that those Linux distributions are shipping a valid /etc/os-release file.

@joschi joschi self-assigned this Jan 29, 2016

@joschi joschi added the bug label Jan 29, 2016

joschi added a commit to graylog-labs/os-platform-finder that referenced this issue Jan 29, 2016

@SjonHortensius

This comment has been minimized.

SjonHortensius commented Jan 29, 2016

Please re-read #1737 (comment) I didn't post os-release, I posted lsb-release Fwiw; Arch's os-release contains

NAME="Arch Linux"
ID=arch
PRETTY_NAME="Arch Linux"
ANSI_COLOR="0;36"
HOME_URL="https://www.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://bugs.archlinux.org/"

joschi added a commit to Graylog2/graylog-plugin-anonymous-usage-statistics that referenced this issue Jan 29, 2016

joschi added a commit to Graylog2/graylog-plugin-anonymous-usage-statistics that referenced this issue Jan 29, 2016

joschi added a commit that referenced this issue Jan 29, 2016

joschi added a commit that referenced this issue Jan 29, 2016

joschi added a commit that referenced this issue Jan 29, 2016

@joschi

This comment has been minimized.

Contributor

joschi commented Jan 29, 2016

@SjonHortensius Would you mind downloading the latest version of the plugin from https://repo.maven.apache.org/maven2/org/graylog/plugins/usage-statistics/1.2.2/usage-statistics-1.2.2.jar and check, if this resolves your problem on Arch Linux? Just replace the old plugin JAR file in the plugin directory of Graylog with the new version.

@SjonHortensius

This comment has been minimized.

SjonHortensius commented Feb 2, 2016

@joschi I've tried that and it didn't work. I did find a machine with the same OS where version 1.2.1 works fine however. I didn't find the difference between the two installs, they use the same packages/os yet one results in:

org.graylog2.bootstrap.ServerBootstrap - Graylog server 1.3.3 (0fda9dc) starting up
org.graylog2.bootstrap.ServerBootstrap - JRE: Oracle Corporation 1.8.0_72 on Linux 4.1.13-1-lts
org.graylog2.bootstrap.ServerBootstrap - Deployment: unknown
org.graylog2.bootstrap.ServerBootstrap - OS: null
org.graylog2.bootstrap.ServerBootstrap - Arch: amd64

The other one outputs:

org.graylog2.bootstrap.ServerBootstrap - Graylog server 1.3.3 (0fda9dc) starting up
org.graylog2.bootstrap.ServerBootstrap - JRE: Oracle Corporation 1.8.0_72 on Linux 4.2.5-1-ARCH
org.graylog2.bootstrap.ServerBootstrap - Deployment: unknown
org.graylog2.bootstrap.ServerBootstrap - OS: Arch Linux
org.graylog2.bootstrap.ServerBootstrap - Arch: amd64

Both these machines do not have an lsb-release file

@joschi

This comment has been minimized.

Contributor

joschi commented Feb 2, 2016

@SjonHortensius First, these systems are using different kernels at least, so maybe other packages are different as well.

Second, does the error you've posted initially still appear?

ERROR: org.graylog.plugins.usagestatistics.UsageStatsNodePeriodical - Uncaught exception in periodical
java.lang.NullPointerException: Null platformName
@SjonHortensius

This comment has been minimized.

SjonHortensius commented Feb 2, 2016

@joschi; I'll investigate the difference between those two machines further; if I find anything else I'll let you know.

The NullPointer no longer occurs, can I verify it's reporting the correct OS?

@joschi

This comment has been minimized.

Contributor

joschi commented Feb 2, 2016

@SjonHortensius You can verify the data collected by the Anonymous Statistics plugin via the following HTTP resource in the Graylog REST API: http://127.0.0.1:12900/plugins/org.graylog.plugins.usagestatistics/node (replace 127.0.0.1 with the actual hostname or IP address of your Graylog server node).

@kroepke kroepke added S4 P3 labels Feb 4, 2016

@SjonHortensius

This comment has been minimized.

SjonHortensius commented Feb 5, 2016

seems to work fine

@kroepke kroepke added the triaged label Sep 21, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment