Page MenuHomePhabricator

null value in column "user_id" violates not-null constraint on PostgreSQL ("user_newtalk" table)
Closed, ResolvedPublic

Description

When importing into almost empty PostgreSQL MediaWiki 4d6439e343559944fb5e31c4f90760020ca4ce97

Import file: plwikimedia-20170220-pages-meta-current.xml.bz2

`
Query: INSERT INTO "user_newtalk" (user_ip,user_last_timestamp) VALUES ('83.21.68.80',NULL) Function: User::updateNewtalk Error: 23502 ERROR:  null value in column "user_id" violates not-null constraint
`
`[bd13c3795c1bd2cd8ad2e8d4] [no req]   DBQueryError from line 1060 of /usr/home/saper/public_html/pg/w/includes/libs/rdbms/database/Database.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading?
Query: INSERT INTO "user_newtalk" (user_ip,user_last_timestamp) VALUES ('83.21.68.80',NULL)
Function: User::updateNewtalk
Error: 23502 ERROR:  null value in column "user_id" violates not-null constraint


Backtrace:
#0 /usr/home/saper/public_html/pg/w/includes/libs/rdbms/database/DatabasePostgres.php(252): Database->reportQueryError(string, string, string, string, boolean)
#1 /usr/home/saper/public_html/pg/w/includes/libs/rdbms/database/Database.php(918): DatabasePostgres->reportQueryError(string, string, string, string, SavepointPostgres)
#2 /usr/home/saper/public_html/pg/w/includes/libs/rdbms/database/DatabasePostgres.php(634): Database->query(string, string, SavepointPostgres)
#3 /usr/home/saper/public_html/pg/w/includes/user/User.php(2370): DatabasePostgres->insert(string, array, string, string)
#4 /usr/home/saper/public_html/pg/w/includes/user/User.php(2423): User->updateNewtalk(string, string, Revision)
#5 /usr/home/saper/public_html/pg/w/includes/page/WikiPage.php(2284): User->setNewtalk(boolean, Revision)
#6 /usr/home/saper/public_html/pg/w/includes/import/WikiRevision.php(551): WikiPage->doEditUpdates(Revision, User, array)
#7 /usr/home/saper/public_html/pg/w/includes/import/WikiImporter.php(346): WikiRevision->importOldRevision()
#8 [internal function]: WikiImporter->importRevision(WikiRevision)
#9 /usr/home/saper/public_html/pg/w/maintenance/importDump.php(187): call_user_func(array, WikiRevision)
#10 [internal function]: BackupReader->handleRevision(WikiRevision, WikiImporter)
#11 /usr/home/saper/public_html/pg/w/includes/import/WikiImporter.php(483): call_user_func_array(array, array)
#12 /usr/home/saper/public_html/pg/w/includes/import/WikiImporter.php(905): WikiImporter->revisionCallback(WikiRevision)
#13 /usr/home/saper/public_html/pg/w/includes/import/WikiImporter.php(827): WikiImporter->processRevision(array, array)
....
`

Event Timeline

saper triaged this task as Low priority.
saper renamed this task from null value in column "user_id" violates not-null constraint on PostgreSQL to null value in column "user_id" violates not-null constraint on PostgreSQL ("user_newtalk" table).Mar 2 2017, 1:01 AM

What does this have to do with T146585?

What does this have to do with T146585?

Well, not really. Removed - thanks!

saper removed saper as the assignee of this task.May 25 2017, 8:18 PM
Pchelolo claimed this task.
Pchelolo added a subscriber: Pchelolo.

Both user_id and user_ip in Postgres now have default values, so this should be fixed. See https://gerrit.wikimedia.org/r/c/mediawiki/core/+/589345