Thanks for reply..
Actually we have run some cli admin commands like,
Fix orphaned question categories
--------------------------------------
admin/cli/fix_orphaned_question_categories.php --fix
Fix course/module sequences
-----------------------------------
php admin/cli/fix_course_sequence.php -c=* --fix
After this we are running cron.
Does the above command like can create a problem which justify your statement "The issue suggests to me a Quiz or Quiz attempt record that does not relate back to a course module."
Actually we have run some cli admin commands like,
Fix orphaned question categories
--------------------------------------
admin/cli/fix_orphaned_question_categories.php --fix
Fix course/module sequences
-----------------------------------
php admin/cli/fix_course_sequence.php -c=* --fix
After this we are running cron.
Does the above command like can create a problem which justify your statement "The issue suggests to me a Quiz or Quiz attempt record that does not relate back to a course module."
Thanks for tips on backup, we are using git checkout -- * to undo changes.