Error from CiviCRM code when I try to install other Drupal modules
It looks like CiviCRM is trying to insert some "Managed Entities" which already exist in the DB. Certain actions within the Drupal CMS will trigger CiviCRM to attempt this, and enabling / disabling modules is one of them.

What I might do in this situation (if I had to fix it without upgrading CiviCRM) is:


Make a backup of your DB. Make two.
Look in CiviCRM's debug logfile for ManagedEntities_failed - this has additional information to the Exception message you posted above.
Review the entry which CiviCRM was unable to insert to the DB (because a conflicting entry already existed).
If the entry CiviCRM tried to insert matches closely to an entry in the DB, then remove the DB entry you find and hope that when CiviCRM re-inserts the same, it "sticks" the second time around.
You might need to repeat this process, so pay attention to any new errors in the same logfile, and see if they are clashing with new entries or the same one ...