HTTP 500 error when trying to open Basic UI

I’ve seen this fixed by:

Stopping OH
Deleting the contents of /var/lib/openhab2/cache and /var/lib/openhab2/tmp
Starting openHAB