Unfortunately, this bug seems to have been triggered by the "workaround" offered in bug 1511466, which disabled FK constraints and broke the model linkage between InstanceExtra and Instance. Doing so breaks a lot of code that assumes this linkage, and this bug is one manifestation of the problem.
The referenced change to this bug does not fix the problem, but logs a warning to the user explaining what is going on. To get yourself out of the jam, you need to delete the orphaned instance_extra records (i.e. the ones that have instance_uuid that does not reference something in the instances table).
Unfortunately, this bug seems to have been triggered by the "workaround" offered in bug 1511466, which disabled FK constraints and broke the model linkage between InstanceExtra and Instance. Doing so breaks a lot of code that assumes this linkage, and this bug is one manifestation of the problem.
The referenced change to this bug does not fix the problem, but logs a warning to the user explaining what is going on. To get yourself out of the jam, you need to delete the orphaned instance_extra records (i.e. the ones that have instance_uuid that does not reference something in the instances table).