Continuous updates has challenged my Tutor instance and I’m facing more errors than usual. When upgrading and launching the discovery service I now get a duplicate entry error:
django.db.utils.IntegrityError: (1062, "Duplicate entry 'discovery.localhost' for key 'django_site_domain_a2e37b91_uniq'")
I would prefer not to delete the database folder and I’m seeking a best-practice type of way of dealing with these. I guess disabling plugins don’t remove their settings / database entries from the platform configuration? Should I manually delete the db entry?
This is a development instance where I test things (like updates, xblocks) before doing the same on the production server. I rsync the production data to the dev server, then run all the updates and tests, before doing the same to the production server.
This was discovery v.0.1.14. I upgraded from 0.1.9, I believe.
You should never use “localhost” as the LMS or Studio host name, even in development. On my machine, I just set it to “myopenedx.com”. Actually, I need to modify Tutor to check the validity of this value.
Can you try to delete the discovery user from the Django administration panel? Here is the url: /admin/oauth2/client/
Then, attempt to run tutor local init again.
Having upgraded to tutor-discovery 10.0.0 and tutor-openedx 10.0.1, I encounter the error “Found existing user” and that “the email addresses do not match”. I probably used another email address in the setup?
It’s the same problem as above, but the user is no longer located at /admin/oauth2/client/, but at admin/auth/user/.
However, when attempting to delete the user, I get a 500-error with the following log-output:
lms_1 | django.db.utils.IntegrityError: (1451, 'Cannot delete or update a parent row: a foreign key constraint fails (`openedx`.`oauth2_accesstoken`, CONSTRAINT `oauth2_accesstoken_user_id_bcf4c395_fk_auth_user_id` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`))')