When removing a group from a contact I get: Error - DB Constraint Violation - GroupContact, get API
This bug seems to occur on old (i.e. version 2.x) installations, due to an error in an old upgrade script that removed the location_id field from the civicrm_group_contact table.

You can fix it using this sql:

ALTER TABLE civicrm_group_contact ADD COLUMN `location_id` int(10) unsigned DEFAULT NULL COMMENT 'Optional location to associate with this membership'


Credit for the solution goes to Eileen, via this commit:

https://github.com/wikimedia/wikimedia-fundraising-crm/commit/e5b853cd55ebf83b68a783a86bf3274dcf20dfb9

Credit for the original issue linked in the question above goes to Lizz Trudeau.