error/moodle/invalidrecord
From MoodleDocs
To fix this problem, try running the cron lots of times until you see a message like "Running clean-up tasks..." near the top of the output. See the discussion Can not find data record in database table context for further advice.