We are running in to what would appear to be an SQL transactional type of error with importing of course completion records. Totara 2.5.10
With debugging enabled, after attempting to import completion records:
Debug info: Duplicate entry '15-3' for key 'mdl_courcomp_usecou_uix'
INSERT INTO mdl_course_completions (rpl,rplgrade,status,timeenrolled,timestarted,timecompleted,reaggregate,userid,course) VALUES (?,?,?,?,?,?,?,?,?)
[array (
0 => 'Completion history import - imported grade = 92',
1 => '92',
2 => 75,
3 => 1267419600,
4 => 1267419600,
5 => 1267419600,
6 => 0,
7 => '15',
8 => '3',
Error code: dmlwriteexception
I have a suspicion this could possibly be low-level database transaction related.
With sql logging enabled, we see the transaction followed by a rollback when this error occurs:
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED
ROLLBACK