Influxdb not saving data

Hello everyone,

I installed influxdb + grafana as shown in the tutorial, but i can’t find my data saved in the database, i got this logging:

2018-08-29 01:18:00.160 [ERROR] [org.influxdb.impl.BatchProcessor ] - Batch could not be sent. Data will be lost
retrofit.RetrofitError: unexpected url: http(s)://192.168.137.246:8086/write?u=openhabs&p=AnotherSuperbPassword456-&db=openhab_db&rp=autogen&precision=n&consistency=one
at retrofit.RetrofitError.unexpectedError(RetrofitError.java:44) ~[225:org.openhab.persistence.influxdb:1.12.0]
at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:400) [225:org.openhab.persistence.influxdb:1.12.0]
at retrofit.RestAdapter$RestHandler.invoke(RestAdapter.java:240) [225:org.openhab.persistence.influxdb:1.12.0]
at org.influxdb.impl.$Proxy136.writePoints(Unknown Source) [225:org.openhab.persistence.influxdb:1.12.0]
at org.influxdb.impl.InfluxDBImpl.write(InfluxDBImpl.java:151) [225:org.openhab.persistence.influxdb:1.12.0]
at org.influxdb.impl.BatchProcessor.write(BatchProcessor.java:171) [225:org.openhab.persistence.influxdb:1.12.0]
at org.influxdb.impl.BatchProcessor$1.run(BatchProcessor.java:144) [225:org.openhab.persistence.influxdb:1.12.0]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:?]
atjava.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) [?:?]
Caused by: java.lang.IllegalArgumentException: unexpected url: http(s)://192.168.137.246:8086/write?u=openhabs&p=AnotherSuperbPassword456-&db=openhab_db&rp=autogen&precision=n&consistency=one
at com.squareup.okhttp.Request$Builder.url(Request.java:157) ~[?:?]
at retrofit.client.OkClient.createRequest(OkClient.java:58) ~[?:?]
at retrofit.client.OkClient.execute(OkClient.java:53) ~[?:?]
at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:326) ~[?:?]
… 12 more

Also in the ssh when i try to check if my created database is working, I don’t have the authorization to check it:

[00:24:38] openhabian@openHABianPi:~$ influx -username admin -password SuperSecretPassword123+ -host localhost
Connected to http://localhost:8086 version 1.6.0
InfluxDB shell version: 1.6.0

show databases
ERR: authorization failed
Warning: It is possible this error is due to not setting a database.
Please set a database with the command “use ”.

Please let me know if anyone faced this problem. and thanks :smiley:

In openhab influxdb.conf you have setup the user as openhab
In your terminal you use admin succesfully
Use the correct password for the user openhab
Or change the user to admin

Hello Vincent,
thank you for your answer. I’m using the correct password for openhab as I think. I couldn’t understand your point of changing the user to admin, could you explain how ? (sorry am still noobi in influxdb :smile: ) thanks :smiley:

No you’re not because OH cannot log in the database

So that OH can log in the database
in your influxdb.conf, change the user to admin:

# The name of the database user, e.g. openhab.
# Defaults to: openhab
user=admin

Hi, I got the same error even when i changed the user and password, would you mind checking the loggings:

2018-08-29 07:07:35.608 [ERROR] [.internal.InfluxDBPersistenceService] - database connection error unexpected url: http(s)://192.168.137.29:8086/ping
2018-08-29 07:07:35.611 [ERROR] [.internal.InfluxDBPersistenceService] - database connection does not work for now, will retry to use the database.

2018-08-29 07:08:00.085 [ERROR] [org.influxdb.impl.BatchProcessor ] - Batch could not be sent. Data will be lost
retrofit.RetrofitError: unexpected url: http(s)://192.168.137.29:8086/write?u=admin&p=SuperSecretPassword123%2B&db=openhab_db&rp=autogen&precision=n&consistency=one
at retrofit.RetrofitError.unexpectedError(RetrofitError.java:44) ~[225:org.openhab.persistence.influxdb:1.12.0]

Do you have any idea how I can reset everything on influxdb? I can’t even create any user now or delete or any action, everytime I have the ERR: authorization failed…

Your ip and port for the database is incorrect

Yeah You are right I forgot to remove the (s) in http(s), I can’t see this error again now, but the authorization is still failing :frowning:

2018-08-29 07:33:00.630 [ERROR] [org.influxdb.impl.BatchProcessor ] - Batch could not be sent. Data will be lost

java.lang.RuntimeException: {“error”:“authorization failed”}
at org.influxdb.impl.InfluxDBErrorHandler.handleError(InfluxDBErrorHandler.java:19) [225:org.openhab.persistence.influxdb:1.12.0]
at retrofit.RestAdapter$RestHandler.invoke(RestAdapter.java:242) [225:org.openhab.persistence.influxdb:1.12.0]
at org.influxdb.impl.$Proxy135.writePoints(Unknown Source) [225:org.openhab.persistence.influxdb:1.12.0]
at org.influxdb.impl.InfluxDBImpl.write(InfluxDBImpl.java:151) [225:org.openhab.persistence.influxdb:1.12.0]
at org.influxdb.impl.BatchProcessor.write(BatchProcessor.java:171) [225:org.openhab.persistence.influxdb:1.12.0]
at org.influxdb.impl.BatchProcessor$1.run(BatchProcessor.java:144) [225:org.openhab.persistence.influxdb:1.12.0]
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) [?:?]

I suggest that you remove influxdb and start again

I deleted it and reinstalled and it worked in the first time when i logged without authorization but once I restarted the service I found again the same authorization error. Do you know how to reset all the users? they still all exist after deleting influxdb

Do it again but don’t log in without auth
Make sure you follow:

set-by step
That’s what I did and it worked for me first time
DONT MISS A STEP