senx / warp10-platform

The Most Advanced Time Series Platform
https://warp10.io/
Apache License 2.0
385 stars 53 forks source link

etc/conf.d/80--plugins.conf is not correct for influxdb extension #830

Closed nsteinmetz closed 4 years ago

nsteinmetz commented 4 years ago

Hello,

By default, in etc/conf.d/80--plugins.conf there is a reference to influxdb plugin:

#warp10.plugin.influxdb = io.warp10.plugins.influxdb.InfluxDBWarp10Plugin

but if you look at the warp10-ext-influxdb extension page, the correct syntax is:

warpscript.extension.influxdb = io.warp10.script.ext.influxdb.InfluxDBWarpScriptExtension

So either we should have the correct syntax or remove the line to avoid confusion. Especially as decommenting this line leads to warp10 failing to start.

##
## Warp 10 listens on 127.0.0.1:8080
##
2020-09-17 10:53:37.113:INFO:iwsjoejs.Server:jetty-8.y.z-SNAPSHOT
2020-09-17 10:53:37.135:INFO:iwsjoejs.AbstractConnector:Started SelectChannelConnector@127.0.0.1:44389
Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: java.net.MalformedURLException
    at io.warp10.warp.sdk.AbstractWarp10Plugin.registerPlugins(AbstractWarp10Plugin.java:157)
    at io.warp10.standalone.Warp.main(Warp.java:506)
Caused by: java.lang.RuntimeException: java.net.MalformedURLException
    at io.warp10.plugins.influxdb.InfluxDBWarp10Plugin.init(InfluxDBWarp10Plugin.java:99)
    at io.warp10.warp.sdk.AbstractWarp10Plugin.registerPlugins(AbstractWarp10Plugin.java:153)
    ... 1 more
Caused by: java.net.MalformedURLException
    at java.net.URL.<init>(URL.java:645)
    at java.net.URL.<init>(URL.java:508)
    at java.net.URL.<init>(URL.java:457)
    at io.warp10.plugins.influxdb.InfluxDBWarp10Plugin.init(InfluxDBWarp10Plugin.java:97)
    ... 2 more
Caused by: java.lang.NullPointerException
    at java.net.URL.<init>(URL.java:550)
    ... 5 more

Start failed! - See /opt/warp10/logs/warp10.log for more details

I can provide a patch if you tell me which solution you prefer :-)

nsteinmetz commented 4 years ago

@hbs just told me there are 2 things :

So it seems more there is a bug with 2.7.0 once we enable the influxdb plugins

Worflow was:

nsteinmetz commented 4 years ago

Ok as seen with Mathias: once influxdb.warp10.endpoint is set, it works as expected.

Ex:

influxdb.warp10.endpoint = http://localhost:8080/api/v0/update

Sorry for the confusion between plugin & extension ;-)