Failure to restart on 2.2.0-SNAPSHOT #1072

I just loaded a fresh Ubuntu install of OH2 snapshot to do some testing on. It works just fine first time out of the box. If I try to stop the process, I get a bunch of errors saying:

[WARN ] [ore.internal.events.OSGiEventManager] - Could not find an Event Factory for the event type ‘ThingRemovedEvent’.

The number of warnings correlates to the number of things I have added via PaperUI. If I try to start the OH2 service again, I get this sequence:

2017-11-02 20:21:50.990 [INFO ] [.dashboard.internal.DashboardService] - Started dashboard at http://10.x.x.x:8080
2017-11-02 20:21:50.990 [INFO ] [.dashboard.internal.DashboardService] - Started dashboard at https://10.x.x.x:8443
2017-11-02 20:21:51.034 [INFO ] [b.core.service.AbstractActiveService] - HTTP Refresh Service has been started
2017-11-02 20:21:51.224 [INFO ] [basic.internal.servlet.WebAppServlet] - Started Basic UI at /basicui/app
2017-11-02 20:21:51.243 [INFO ] [arthome.ui.paper.internal.PaperUIApp] - Started Paper UI at /paperui
2017-11-02 20:21:56.016 [INFO ] [basic.internal.servlet.WebAppServlet] - Stopped Basic UI
2017-11-02 20:21:56.028 [INFO ] [arthome.ui.paper.internal.PaperUIApp] - Stopped Paper UI
2017-11-02 20:21:56.037 [INFO ] [b.core.service.AbstractActiveService] - HTTP Refresh Service has been shut down
2017-11-02 20:22:15.452 [WARN ] [ore.internal.events.OSGiEventManager] - Could not find an Event Factory for the event type 'ThingRemovedEvent'.
2017-11-02 20:22:15.452 [WARN ] [ore.internal.events.OSGiEventManager] - Could not find an Event Factory for the event type 'ThingRemovedEvent'.
2017-11-02 20:22:15.453 [WARN ] [ore.internal.events.OSGiEventManager] - Could not find an Event Factory for the event type 'ThingRemovedEvent'.
2017-11-02 20:22:15.482 [INFO ] [.dashboard.internal.DashboardService] - Stopped dashboard

I noticed through troubleshooting that if I ran “apt-get remove openhab2 openhab2-addons openhab2-addons-legacy && apt-get install openhab2 openhab2-addons openhab2-addons-legacy” then I can start it back up again once. If I shutdown or restart, it goes back to the broken state. Digging deeper, it looks like something is getting stale in the cache. If I stop the service, run “rm -rf /var/lib/openhab2/cache/”, I can then restart the service cleanly.

I’ve dug through the forums and I’ve not found anything that really explains this. Posting in the hopes that others have seen it and that this may help until a bug fix has been applied.

Please post an issue on the Eclipse SmartHome Github repo.

This is consistent enough behavior and clearly a bug of some sort.