Page MenuHomePhabricator

CheckUser causes foreign key constraint violation on page delete on PostgreSQL (insert or update on table "cu_changes" violates foreign key constraint "cu_changes_cuc_page_id_fkey")
Closed, DuplicatePublic

Description

MediaWiki 1.27.1
PHP 5.5.9-1ubuntu4.20
PostgreSQL 9.3.14

I get an error when I attempt to delete a page. I get the following error:

Query:

INSERT INTO "cu_changes" (cuc_id,cuc_namespace,cuc_title,cuc_minor,cuc_user,cuc_user_text,cuc_actiontext,cuc_comment,cuc_this_oldid,cuc_last_oldid,cuc_type,cuc_timestamp,cuc_ip,cuc_ip_hex,cuc_xff,cuc_xff_hex,cuc_agent,cuc_page_id) VALUES ('6481','0','Deletetest','0','2','Tynian','Tynian deleted page Deletetest','Deletion test','0','0','3','2016-10-31 05:35:33 GMT','68.106.57.89','446A3959',0,NULL,'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/53.0.2785.143 Chrome/53.0.2785.143 Safari/537.36','4364')

Function: CheckUserHooks::updateCheckUserData
Error: 23503 ERROR: insert or update on table "cu_changes" violates foreign key constraint "cu_changes_cuc_page_id_fkey" DETAIL: Key (cuc_page_id)=(4364) is not present in table "page".

If I comment out the CheckUser extension, I am able to delete the page. I have upgraded CheckUser from Git, but get the same results.

Event Timeline

Aklapper renamed this task from Database Error: CheckUser & Postgresql to Database error on PostgreSQL: insert or update on table "cu_changes" violates foreign key constraint "cu_changes_cuc_page_id_fkey".Nov 4 2016, 10:26 AM

Thanks for reporting this! Which exact CU version is this about (see Special:Version)?

@Yetanotherusername that is a really old commit, please update to the latest in branch REL1_27.

Yes, sorry. I had forgotten I was running an older snapshot for testing purposes.

Did a git update. Now running 2.4 (2577b23) 14:40, November 1, 2016.

Same result.

saper renamed this task from Database error on PostgreSQL: insert or update on table "cu_changes" violates foreign key constraint "cu_changes_cuc_page_id_fkey" to CheckUser causes foreign key constraint violation on page delete on PostgreSQL (insert or update on table "cu_changes" violates foreign key constraint "cu_changes_cuc_page_id_fkey").Jan 3 2020, 1:05 PM