Grafana stops working?

I’ve setup InfluxDB and Grafana based on the great tutorials and using OpenHABianPi.

It works great most of the time but I’ve found it seems to stop working after a while. I think it’s after some inactivity.
None of the graphs embedded in my sitemap work anymore until I go to the Grafana admin page and login. Once logged in the charts start working again.

Is there a setting somewhere I need to change or something?

Are you sure you enabled anymous access?

Quoted from InfluxDB+Grafana persistence and graphing :

Disable user signup and enable anonymous access (for later image export) in the configuration92 file /etc/grafana/grafana.ini:

# disable user signup / registration
allow_sign_up = false
# enable anonymous access
enabled = true

Yeah I’m sure I did that, but I will double check.
It’s like the service goes to sleep or something.

I think Miika has the right idea. I don’t think the service is going to sleep, I think your user’s login is timing out. If the service were going to sleep you wouldn’t be able to relog back in.

If I leave everything for a while and then open up the Basic UI and look at a page in my sitemap that has grafana charts on it the charts don’t load up. If I try too many time I think the Pi reboots because I then get an email to say my openhab rules have reloaded (I have a rule that sends me an email).

I took a look at the OpenHAB logs at the time and I get this which doesn’t look good?

2017-10-14 10:24:18.764 [WARN ] [org.eclipse.jetty.server.HttpChannel] - //openhabianpi:8080/chart?groups=KwHDay_Chart&period=h&theme=bright&t=1507929853794

javax.servlet.ServletException: javax.imageio.IIOException: I/O error writing PNG file!

	at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle( [171:org.ops4j.pax.web.pax-web-jetty:6.0.6]

	at org.eclipse.jetty.server.handler.HandlerWrapper.handle( [84:org.eclipse.jetty.server:9.3.14.v20161028]

	at org.eclipse.jetty.server.Server.handle( [84:org.eclipse.jetty.server:9.3.14.v20161028]

	at org.eclipse.jetty.server.HttpChannel.handle( [84:org.eclipse.jetty.server:9.3.14.v20161028]

	at org.eclipse.jetty.server.HttpConnection.onFillable( [84:org.eclipse.jetty.server:9.3.14.v20161028]

	at$ReadCallback.succeeded( []

	at []

	at$ []

	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume( [87:org.eclipse.jetty.util:9.3.14.v20161028]

	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume( [87:org.eclipse.jetty.util:9.3.14.v20161028]

	at [87:org.eclipse.jetty.util:9.3.14.v20161028]

	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob( [87:org.eclipse.jetty.util:9.3.14.v20161028]

	at org.eclipse.jetty.util.thread.QueuedThreadPool$ [87:org.eclipse.jetty.util:9.3.14.v20161028]

	at [?:?]

Caused by: javax.imageio.IIOException: I/O error writing PNG file!

	at com.sun.imageio.plugins.png.PNGImageWriter.write( ~[?:?]

	at javax.imageio.ImageWriter.write( ~[?:?]

OK, I’m going to guess that either your SD card is failing, or some cron job is running and mucking with the permissions on whatever folder the PNG file it wants to write goes so it no longer has permission to write to it.

If this used to work just fine I’m going to guess it is the SD card.

It’s a new SD card and openHABian setup I’ve had running for about a week. So hopefully SD card is not failing yet.

I haven’t noticed any other strange behavior, just these issues with Grafana charts.

CORRECTION : I’ve disabled all my grafana charts and it’s actually the standard OH charts using my rrd4j persistence that is causing those errors. The charts do show though so from the UI it appears to be working okay but the log file goes nuts.

What happens if you try it the other way around. Stop all default graphing and use only grafana?

You said that you are using rrd4j. Then i remembered this topic Too many open files Can you try with other browsers?