Quantcast
Channel: Backup and restore
Viewing all articles
Browse latest Browse all 6815

Restore error: Duplicate key value violates uniqueness constraint

$
0
0
by Ricardo Caiado.  

Hi,

When I try to restore a course, this error message appears at the end:

Debug info: ERRO: Duplicate key value violates uniqueness constraint "mdl_coursect_cousec_uix"
DETAIL: Chave (course, section)=(156197, 0) já existe.
INSERT INTO mdl_course_sections (course,section,summary,summaryformat,sequence,name,visible,availability,component,itemid,timemodified) VALUES($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11) RETURNING id
[array (
'course' => '156197',
'section' => 0,
'summary' => '',
'summaryformat' => '1',
'sequence' => '',
'name' => NULL,
'visible' => 1,
'availability' => NULL,
'component' => NULL,
'itemid' => NULL,
'timemodified' => 1743729958,
)]
Error code: dmlwriteexception

Stack trace:

line 500 of /lib/dml/moodle_database.php: dml_write_exception thrown
line 293 of /lib/dml/moodle_read_slave_trait.php: call to moodle_database->query_end()
line 358 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->read_slave_query_end()
line 1149 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
line 1197 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->insert_record_raw()
line 62 of /course/format/classes/local/sectionactions.php: call to pgsql_native_moodle_database->insert_record()
line 171 of /course/format/classes/local/sectionactions.php: call to core_courseformat\local\sectionactions->create_from_object()
line 196 of /course/format/classes/local/sectionactions.php: call to core_courseformat\local\sectionactions->create()
line 532 of /course/lib.php: call to core_courseformat\local\sectionactions->create_if_missing()
line 328 of /course/view.php: call to course_create_sections_if_missing()


Any Idea?

Moodle 4.5+
PHP 8.3
PostgreSQL 16
Ubuntu 24.04

Ricardo

Viewing all articles
Browse latest Browse all 6815

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>