I got this error when uninstalling User Relationships module. I don't have the full error message but it had a reference to the Drupal Chat module. I didn't remove any of the UR settings before uninstalling so perhaps that was the problem but in any case this shouldn't happen. It was a really annoying bug too since after the error I couldn't access any admin page anymore. I eventually removed the Drupal Chat module folder and then continued with the UR uninstall.