Undefined index in civicrm_member_roles_sync
What you've found is that the error appears whenever your sync runsTwo things:


This is a PHP notice, which is a very low-importance message to receive.  Nothing is breaking; this is just something to say that something mildly improper is going on in the code.  Notices like this are actually something you should suppress on a production site: in the Drupal menu, go to Configuration, then under Development click Logging and Errors.  Select none under Error messages to display.  That will make the error quit appearing on screen, but it will still probably appear in your log, so it's worth getting to the bottom of it.
It does reflect an actual bug (albeit small) in CiviCRM's code.  Basically, this line of code asks whether the item in the $memberroles array for a contact's membership's membership type is an array.  Well, it's possible that the $memberroles array doesn't have an item for that membership type: it's only populated with the membership types for which you've got sync rules set up.  Apparently, in your case, at least someone has a membership of a type that doesn't sync with a Drupal role.  This is normal and okay; the code just doesn't consider this situation.


Apparently, the problem still exists in the development version of the code.  Please log in at issues.civicrm.org and log an issue for this.  The fix will take no time, but it's good to have a record of the bug there.