For a while now, since like version 3.x (I can't recall exactly which one but around the one where Data requests got implemented) up to 4.2+ I have been having an issue.
Whenever I approve user deletion requests (Users > Data request) I get spammed on email about the following exception:
Exception occurred during privacy data processing
An exception occurred when calling core_analytics\privacy\provider::get_contexts_for_userid.
This means that the core_analytics plugin has not finished processing the data. The following information from the exception can be passed on to the plugin developer:
Coding error detected and should be fixed by a developer: Model 2 indicators can not be read
#0 ../analytics/classes/model.php(283): core_analytics\model->get_indicators()
}#1 ../analytics/classes/model.php(268): core_analytics\model->init_analyser(Array)
#2 ../analytics/classes/privacy/provider.php(466): core_analytics\model->get_analyser(Array)
#3 ../analytics/classes/privacy/provider.php(133): core_analytics\privacy\provider::get_models_with_user_data()
#4 ../lib/moodlelib.php(8144): core_analytics\privacy\provider::get_contexts_for_userid(5277)
#5 ../privacy/classes/manager.php(578): component_class_callback('core_analytics
...', 'get_contexts_fo...', Array)
#6 ../privacy/classes/manager.php(611): core_privacy\manager::component_class_callback('core_analytics', 'core_privacy
lo...', 'get_contexts_fo...', Array)
#7 ../privacy/classes/manager.php(238): core_privacy\manager->handled_component_class_callback('core_analytics', 'core_privacy
lo...', 'get_contexts_fo...', Array)
#8 ../admin/tool/dataprivacy/classes/task/process_data_request_task.php(94): core_privacy\manager->get_contexts_for_userid(5277)
#9 ../lib/classes/cron.php(508): tool_dataprivacy\task\process_data_request_task->execute()
#10 ../lib/classes/cron.php(302): core\cron::run_inner_adhoc_task(Object(tool_dataprivacy\task\process_data_request_task))
#11 ../lib/classes/cron.php(128): core\cron::run_adhoc_tasks(1684934825, 0, true, 1684934822)
#12 ../admin/cli/cron.php(186): core\cron::run_main_process('0')
#13 {main}
This issue has persisted even after updates (it went through like 4 or 5 version updates). It really gets annoying as I get like one email for every user it tries to process (sometimes up to hundreds).
The user data seems to be successfully removed though (at least they are shown as approved and processed). I hardly check analytics then not sure if this issue has caused issues somewhere else.
I can provide more details if needed.