Last modified: 2012-08-04 20:48:54 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T37358, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 35358 - DB error while importing on Postgres
DB error while importing on Postgres
Status: NEW
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
unspecified
All All
: Low normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: postgres
  Show dependency treegraph
 
Reported: 2012-03-20 16:48 UTC by Mark A. Hershberger
Modified: 2012-08-04 20:48 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Mark A. Hershberger 2012-03-20 16:48:28 UTC
While trying to import a dump (simplewiki-20120313-pages-meta-history.xml.bz2) into a Pg-based wiki with several extensions, I got the following a backtrace:

PHP Warning:  pg_query(): Query failed: ERROR:  insert or update on table "revision" violates foreign key constraint "revision_rev_page_fkey"
DETAIL:  Key (rev_page)=(943) is not present in table "page". in .../includes/db/DatabasePostgres.php on line 323
PHP Stack trace:
PHP   1. {main}() .../maintenance/importDump.php:0
PHP   2. require_once() .../maintenance/importDump.php:287
PHP   3. BackupReader->execute() .../maintenance/doMaintenance.php:105
PHP   4. BackupReader->importFromFile() .../maintenance/importDump.php:91
PHP   5. BackupReader->importFromHandle() .../maintenance/importDump.php:241
PHP   6. WikiImporter->doImport() .../maintenance/importDump.php:282
PHP   7. WikiImporter->handlePage() .../includes/Import.php:425
PHP   8. WikiImporter->handleRevision() .../includes/Import.php:559
PHP   9. WikiImporter->processRevision() .../includes/Import.php:607
PHP  10. WikiImporter->revisionCallback() .../includes/Import.php:649
PHP  11. call_user_func_array() .../includes/Import.php:310
PHP  12. BackupReader->handleRevision() .../includes/Import.php:310
PHP  13. call_user_func() .../maintenance/importDump.php:161
PHP  14. WikiImporter->importRevision() .../maintenance/importDump.php:161
PHP  15. DatabaseBase->deadlockLoop() .../includes/Import.php:223
PHP  16. DatabaseBase->commit() .../includes/db/Database.php:2797
PHP  17. DatabaseBase->query() .../includes/db/Database.php:2887
PHP  18. DatabasePostgres->doQuery() .../includes/db/Database.php:877
PHP  19. pg_query() .../includes/db/DatabasePostgres.php:323
A database query syntax error has occurred.
The last attempted database query was:
"COMMIT"
from within function "DatabaseBase::deadlockLoop".
Database returned error "1: ERROR:  insert or update on table "revision" violates foreign key constraint "revision_rev_page_fkey"
DETAIL:  Key (rev_page)=(943) is not present in table "page"."
Backtrace:
#0 .../includes/db/DatabasePostgres.php(332): DatabaseBase->reportQueryError('ERROR:  insert ...', 1, 'COMMIT', 'DatabaseBase::d...', false)
#1 .../includes/db/Database.php(904): DatabasePostgres->reportQueryError('ERROR:  insert ...', 1, 'COMMIT', 'DatabaseBase::d...', false)
#2 .../includes/db/Database.php(2887): DatabaseBase->query('COMMIT', 'DatabaseBase::d...')
#3 .../includes/db/Database.php(2797): DatabaseBase->commit('DatabaseBase::d...')
#4 .../includes/Import.php(223): DatabaseBase->deadlockLoop(Array)
#5 [internal function]: WikiImporter->importRevision(Object(WikiRevision))
#6 .../maintenance/importDump.php(161): call_user_func(Array, Object(WikiRevision))
#7 [internal function]: BackupReader->handleRevision(Object(WikiRevision), Object(WikiImporter))
#8 .../includes/Import.php(310): call_user_func_array(Array, Array)
#9 .../includes/Import.php(649): WikiImporter->revisionCallback(Object(WikiRevision))
#10 .../includes/Import.php(607): WikiImporter->processRevision(Array, Array)
#11 .../includes/Import.php(559): WikiImporter->handleRevision(Array)
#12 .../includes/Import.php(425): WikiImporter->handlePage()
#13 .../maintenance/importDump.php(282): WikiImporter->doImport()
#14 .../maintenance/importDump.php(241): BackupReader->importFromHandle(Resource id #76)
#15 .../maintenance/importDump.php(91): BackupReader->importFromFile('...')
#16 .../maintenance/doMaintenance.php(105): BackupReader->execute()
#17 .../maintenance/importDump.php(287): require_once('...')
#18 {main}
Comment 1 Mark A. Hershberger 2012-03-20 16:52:03 UTC
This is the second time that has happened, by the way.

Extensions installed: timeline, wikihiero, SiteMatrix, CharInsert, CheckUser, ParserFunctions, Cite, InputBox, ExpandTemplates, ImageMap, SyntaxHighlight_GeSHi, Poem, CategoryTree, UploadBlacklist, OggHandler, AssertEdit, GlobalBlocking, TrustedXFF, SecurePoll, OAI, Renameuser, AntiBot, TorBlock, Oversight, AntiSpoof, WikimediaMessages, SwiftCloudFiles, SimpleAntiSpam, Gadgets
Comment 2 Mark A. Hershberger 2012-03-20 16:59:41 UTC
Hrm... may be my modifications... Testing w/o them.
Comment 3 Mark A. Hershberger 2012-03-20 18:13:38 UTC
reverted my modifications and it failed again, but this time on page 944... trying again with a completely fresh install.
Comment 4 Mark A. Hershberger 2012-03-21 20:19:40 UTC
happened again on a fresh install. Now to track this down.  Is it the import file or the code?  And if it is the file, it seems like the code should handle this.
Comment 5 Marcin Cieślak 2012-03-21 22:40:37 UTC
I just successfully imported a smaller 

http://dumps.wikimedia.org/plwikimedia/20120316/plwikimedia-20120316-pages-meta-history.xml.bz2

Trying now with simplewiki.

I have some local changes in the tree (waiting for the git dust to settle) but they affect only updater, so should not be relevant to imports done on a fresh database.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links