I might be seeing the same thing. It’s a long known issue in OH 2 that the startup order is not predictable and sometimes things will start (e.g. Rules) before they are ready to run (e.g. Items have not yet loaded). But what you describe is more extreme than usual.
Sometimes when I upgrade to a new SNAPSHOT I’ll see a bunch of exceptions in the log that I’ve not yet had a chance to review and on my sitemap I’ll see Item names instead of their labels (that’s usually how I discover things didn’t go well). A restart of OH almost always clears things up. Only once did I have to restart twice.
There appear to be some limitations to how Karaf loads bundles that makes this exceptionally difficult if not impossible. This is why the issue has been open forever without a viable fix.
That’s a classic symptom of a Rule being triggered before the Rule itself has been fully loaded. I’ve even seen errors like “no such symbol ON” and the like.
There is a work around that is built into openHABian I think that will copy the .rules files into the rules folder only after OH has come online. Thus the Rules can’t start triggering before they are ready.
This is not surprising actually. When you clear the cache OH has to go out and download and reinstall all the bindings which adds more load on the system and definitely interferes with the rest of the startup. Personally, after I upgrade or clear the cache I wait for the logs to quiet down and then restart by default.
Anyway, back to the original error. Are you using addons.cfg by chance?