Forum .LRN Q&A: Agregando un usuario a un curso - Error

Request notifications

Buen dia:

Un usuario, estaba queriendo agregar un participante "pablo" a su curso en dotlrn, al parecer no existía en la base de datos el usuario "pablo" que se deseaba agregar al curso, y dio este mensaje.

Qué sucede ? Tengo que trabajar algo en la bd ?

Database operation "0o1row" failed
(exception ERROR, "ERROR: llave duplicada viola restricción unique acs_object_rels_un")
CONTEXT: sentencia SQL: insert into acs_rels (rel_id, rel_type, objetc_id_one,object_id_two) values ($1, $2, $3, $4)
PL/pgSQL function "acs_rel_new" line 25 at SQL statment
PL/pgSQL function "membership_rel_new" line 11 at assignment
PL/pgSQL function"dotlrn_member_rel_new" line 12 at assignment
PL/pgSQL function "dotlrn_student_rel_new" line 12 assignment
")

pqerror was: "ERROR: llave duplicada viola restricción unique acs_object_rels_un"
CONTEXT: sentencia SQL: insert into acs_rels (rel_id, rel_type, object_id_one, object_id_two) values ( $1 , $2 , $3, $4)

PL/pgSQL function "acs_rel_new" line 25 at SQL statment
PL/pgSQL function "membership_rel_new" line 11 at assignment
PL/pgSQL function"dotlrn_member_rel_new" line 12 at assignment
PL/pgSQL function "dotlrn_student_rel_new" line 12 assignment
"
(Status of PQexec call: PGRES_FATAL_ERROR)
SQL:

select dotlrn_student_rel_new(NULL,'dotlrn_student_rel',NULL,'3125740','227487','needs approval','3047796','190.53.37.100')

Gracias

Collapse
Posted by Antonio Pisano on
Dear Menocal,

looks like an entry into acs_rels for your tern (user_id, group_id, rel_type) already exist.

Please try the following query in postgres shell, replacing :user_id and :group_id with your actual integer ids:

select * from acs_rels
where object_id_one = :group_id
and object_id_two = :user_id
and rel_type = 'dotlrn_student_rel'

Hopefully you will obtain the entry that is preventing you from inserting the user again.

P.S. I could understand your question, but unfortunately my knowledge of spanish is not sufficient for a proper answer...

Collapse
Posted by Massiel Menocal on
You're so kind.

Thanks for your answer.

Regards.