Exception encountered in event observer '\local_edwiserreports\observers\event_observer::user_loggedin': Error writing to database (ERROR: duplicate key value violates unique constraint "mdl_edwrauth_use_uix"
DETAIL: Key (userid)=(1) already exists.
INSERT INTO mdl_edwreports_authentication (userid,secret) VALUES($1,$2) RETURNING id
[array (
'userid' => 1,
'secret' => '4aQeTHDeIG',
)])
- line 346 of /lib/dml/moodle_read_replica_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_replica_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 76 of /local/edwiserreports/classes/controller/authentication.php: call to pgsql_native_moodle_database->insert_record()
- line 49 of /local/edwiserreports/classes/observers/authentication.php: call to local_edwiserreports\controller\authentication->create_secret_key()
- line ? of unknownfile: call to local_edwiserreports\observers\event_observer::user_loggedin()
- line 155 of /lib/classes/event/manager.php: call to call_user_func()
- line 75 of /lib/classes/event/manager.php: call to core\event\manager::process_buffers()
- line 795 of /lib/classes/event/base.php: call to core\event\manager::dispatch()
- line 4120 of /lib/moodlelib.php: call to core\event\base->trigger()
- line 2316 of /lib/moodlelib.php: call to complete_user_login()
- line 84 of /course/section.php: call to require_login()