Charts not working since moving to 2.2

I migrated to OH 2.2 last month. Most everything is working as it was, except charts. They strangely started working for a few days, then after a reboot last Monday, stopped again. The charts appear, just no data. As with everything else, I’m using the same config and persistence files. I’ve verified there is data in the mysql tables using the same user that OH is configured to use. mySQL persistence is installed(it never would have worked without this). I see these errors in the logs:

2018-01-10 16:49:43.953 [ERROR] [.core.internal.folder.FolderObserver] - Error handling update of file '/etc/openhab2/persistence/mysql.persist': null.


  2018-01-10 14:40:21.103 [WARN ] [eclipse.jetty.servlet.ServletHandler] - /chart
javax.imageio.IIOException: I/O error writing PNG file!
at com.sun.imageio.plugins.png.PNGImageWriter.write(PNGImageWriter.java:1168) [?:?]
at javax.imageio.ImageWriter.write(ImageWriter.java:615) [?:?]
at javax.imageio.ImageIO.doWrite(ImageIO.java:1612) [?:?]
at javax.imageio.ImageIO.write(ImageIO.java:1492) [?:?]
at org.eclipse.smarthome.ui.internal.chart.ChartServlet.doGet(ChartServlet.java:302) [155:org.eclipse.smarthome.ui:0.10.0.b1]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) [31:javax.servlet-api:3.1.0]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [31:javax.servlet-api:3.1.0]
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:848) [88:org.eclipse.jetty.servlet:9.3.22.v20171030]
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:584) [88:org.eclipse.jetty.servlet:9.3.22.v20171030]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71) [191:org.ops4j.pax.web.pax-web-jetty:6.0.7]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [87:org.eclipse.jetty.server:9.3.22.v20171030]
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548) [85:org.eclipse.jetty.security:9.3.22.v20171030]
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226) [87:org.eclipse.jetty.server:9.3.22.v20171030]
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180) [87:org.eclipse.jetty.server:9.3.22.v20171030]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:284) [191:org.ops4j.pax.web.pax-web-jetty:6.0.7]
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512) [88:org.eclipse.jetty.servlet:9.3.22.v20171030]
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) [87:org.eclipse.jetty.server:9.3.22.v20171030]
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112) [87:org.eclipse.jetty.server:9.3.22.v20171030]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [87:org.eclipse.jetty.server:9.3.22.v20171030]
at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80) [191:org.ops4j.pax.web.pax-web-jetty:6.0.7]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134) [87:org.eclipse.jetty.server:9.3.22.v20171030]
at org.eclipse.jetty.server.Server.handle(Server.java:534) [87:org.eclipse.jetty.server:9.3.22.v20171030]
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:333) [87:org.eclipse.jetty.server:9.3.22.v20171030]
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251) [87:org.eclipse.jetty.server:9.3.22.v20171030]
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:283) [79:org.eclipse.jetty.io:9.3.22.v20171030]
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:108) [79:org.eclipse.jetty.io:9.3.22.v20171030]
at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93) [79:org.eclipse.jetty.io:9.3.22.v20171030]
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303) [90:org.eclipse.jetty.util:9.3.22.v20171030]
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148) [90:org.eclipse.jetty.util:9.3.22.v20171030]
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136) [90:org.eclipse.jetty.util:9.3.22.v20171030]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671) [90:org.eclipse.jetty.util:9.3.22.v20171030]
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589) [90:org.eclipse.jetty.util:9.3.22.v20171030]
at java.lang.Thread.run(Thread.java:748) [?:?]
Caused by: org.eclipse.jetty.io.EofException
at org.eclipse.jetty.io.ChannelEndPoint.flush(ChannelEndPoint.java:199) ~[79:org.eclipse.jetty.io:9.3.22.v20171030]
at org.eclipse.jetty.io.WriteFlusher.flush(WriteFlusher.java:420) ~[79:org.eclipse.jetty.io:9.3.22.v20171030]
at org.eclipse.jetty.io.WriteFlusher.write(WriteFlusher.java:313) ~[79:org.eclipse.jetty.io:9.3.22.v20171030]
at org.eclipse.jetty.io.AbstractEndPoint.write(AbstractEndPoint.java:147) ~[79:org.eclipse.jetty.io:9.3.22.v20171030]
at org.eclipse.jetty.server.HttpConnection$SendCallback.process(HttpConnection.java:739) ~[87:org.eclipse.jetty.server:9.3.22.v20171030]
at org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:241) ~[90:org.eclipse.jetty.util:9.3.22.v20171030]
at org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:224) ~[90:org.eclipse.jetty.util:9.3.22.v20171030]
at org.eclipse.jetty.server.HttpConnection.send(HttpConnection.java:519) ~[87:org.eclipse.jetty.server:9.3.22.v20171030]
at org.eclipse.jetty.server.HttpChannel.sendResponse(HttpChannel.java:750) ~[87:org.eclipse.jetty.server:9.3.22.v20171030]
at org.eclipse.jetty.server.HttpChannel.write(HttpChannel.java:801) ~[87:org.eclipse.jetty.server:9.3.22.v20171030]
at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:235) ~[87:org.eclipse.jetty.server:9.3.22.v20171030]
at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:219) ~[87:org.eclipse.jetty.server:9.3.22.v20171030]
at org.eclipse.jetty.server.HttpOutput.flush(HttpOutput.java:355) ~[87:org.eclipse.jetty.server:9.3.22.v20171030]
at   

  javax.imageio.stream.FileCacheImageOutputStream.flushBefore(FileCacheImageOutputStream.java:258) ~[?:?]
at com.sun.imageio.plugins.png.ChunkStream.finish(PNGImageWriter.java:140) ~[?:?]
at com.sun.imageio.plugins.png.PNGImageWriter.writeIEND(PNGImageWriter.java:951) ~[?:?]
at com.sun.imageio.plugins.png.PNGImageWriter.write(PNGImageWriter.java:1164) ~[?:?]
... 32 more

Here is my mysql.persist:

Strategies {
default = everyChange

}

Items {
* : strategy = everyChange, everyDay, restoreOnStartup

Inside_* : strategy = every5Minutes, restoreOnStartup
PorchLight_Switch: strategy = every5Minutes, restoreOnStartup
GarageLight_Switch: strategy = every5Minutes, restoreOnStartup
PatioLight_Switch: strategy = every5Minutes, restoreOnStartup
LRWindowLight_Switch: strategy = every5Minutes, restoreOnStartup
DeskLight_Switch: strategy = every5Minutes, restoreOnStartup
Utility_Switch: strategy = every5Minutes, restoreOnStartup
DeskLight_Switch: strategy = every5Minutes, restoreOnStartup
Humidity : strategy = every5Minutes, restoreOnStartup
PressureDisplay : strategy = every5Minutes, restoreOnStartup
TempDisplay : strategy = every5Minutes, restoreOnStartup
Sunrise : strategy = every5Minutes, restoreOnStartup
Sunset : strategy = every5Minutes, restoreOnStartup
Daylength : strategy = every5Minutes, restoreOnStartup
StairBattery_level: strategy = every5Minutes, restoreOnStartup
stair_light_level: strategy = every5Minutes, restoreOnStartup
back_door_1_level: strategy = every5Minutes, restoreOnStartup
window_light_level: strategy = every5Minutes, restoreOnStartup
StairBattery_level: strategy = every5Minutes, restoreOnStartup
DoorSensor_Battery: strategy = every5Minutes, restoreOnStartup
WallMote_Battery: strategy = every5Minutes, restoreOnStartup
}

Here is my mysql.cfg:

url=jdbc:mysql://localhost:3306/openhab
user=xxxxxx
password=xxxxxx

I don’t use the other options. They’re all commented out. I’m running on a Rpi3 with the latest build. I have ample disk space, only 30% in use.
Any ideas?

It looks like it was an issue for people with OH 2.0.0 as well: OH2: Java exception instead of chart - why?.

Maybe you are also using an OpenJDK JVM instead of Oracle or Zulu JVM?

Its Oracle

java version "1.8.0_141"
Java(TM) SE Runtime Environment (build 1.8.0_141-b15)
Java HotSpot(TM) Client VM (build 25.141-b15, mixed mode)

I also have this error on startup:

2018-01-10 19:36:57.652 [ERROR] [g.eclipse.smarthome.core.persistence] -    [org.eclipse.smarthome.core.persistence.internal.PersistenceManagerImpl(75)] The   addPersistenceService method has thrown an exception
java.lang.NullPointerException: null

You are using a Strategie which haven’t been defined (every5minutes, everyday).

I’m not sure what you mean by this. Can you elaborate? This is the same .persist file I was using before upgrading and persistence worked just fine. Also, although charts were not working after the upgrade, they eventually started working, but stopped working after a reboot.

As far as I understand you need to define the strategies used , however if you did use the same file before those 2 might be defined as defaults. In that case disregard my statement. I learned something new.

If they need to be defined, where would they be defined. I may have missed something when I did the migration.

“My Break-Dancing days are over, but there’s always the Funky Chicken” – The Full Monty

In the “strategies” section of the. persist file.

i got it working again after dump the DB, dropping it, re-adding it and then importing the dump file. I also had to grant rights to the openhab user again. Charts were still working after a reboot of the Rpi. So I guess this is solved, although a rather heavy handed way of doing it.

This also helped. i had jdbc-mysql install as well.

https://community.openhab.org/t/mysql-restoreonstartup/25366