This is most likely because your upgrade to 1.7 was not successfuly. The context table might not have been set up properly (you can check to see if you have a mdl_context table). I would suggest you try to roll back to 1.6 and try the upgrade again. Have you changed anything significantly in your Moodle?
Roles and permissions
Unknown Context on all logins on 1.7+
This discussion has been locked because a year has elapsed since the last post. Please start a new discussion topic.