javaapache-flinkoshi

Flink oshi-core Exception


I added dependencies for system monitoring according to this to lib folder

wget https://repo1.maven.org/maven2/com/github/oshi/oshi-core/3.4.0/oshi-core-3.4.0.jar
wget https://repo1.maven.org/maven2/net/java/dev/jna/jna-platform/4.2.2/jna-platform-4.2.2.jar
wget https://repo1.maven.org/maven2/net/java/dev/jna/jna/4.2.2/jna-4.2.2.jar

But show this exception for me:

WARN  org.apache.flink.runtime.metrics.MetricRegistryImpl           - Error while reporting metrics
java.lang.NoSuchMethodError: org.apache.flink.metrics.influxdb.shaded.okio.BufferedSource.getBuffer()Lorg/apache/flink/metrics/influxdb/shaded/okio/Buffer;
    at org.apache.flink.metrics.influxdb.shaded.com.squareup.moshi.JsonUtf8Reader.<init>(JsonUtf8Reader.java:97)
    at org.apache.flink.metrics.influxdb.shaded.com.squareup.moshi.JsonReader.of(JsonReader.java:196)
    at org.apache.flink.metrics.influxdb.shaded.com.squareup.moshi.JsonAdapter.fromJson(JsonAdapter.java:40)
    at org.apache.flink.metrics.influxdb.shaded.org.influxdb.InfluxDBException.buildExceptionForErrorState(InfluxDBException.java:172)
    at org.apache.flink.metrics.influxdb.shaded.org.influxdb.impl.InfluxDBImpl.execute(InfluxDBImpl.java:821)
    at org.apache.flink.metrics.influxdb.shaded.org.influxdb.impl.InfluxDBImpl.write(InfluxDBImpl.java:460)
    at org.apache.flink.metrics.influxdb.InfluxdbReporter.report(InfluxdbReporter.java:118)
    at org.apache.flink.runtime.metrics.MetricRegistryImpl$ReporterTask.run(MetricRegistryImpl.java:441)
    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:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

Solution

  • This is a Flink bug which has been introduced with FLINK-12147. The problem is that we bumped a dependency version without bumping a transitive dependency as well. I have created the issue FLINK-16635 to fix this problem. This issue also contains more details about what caused the problem.

    Update

    The problem has been fixed with Flink 1.10.1 and 1.11.0.