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

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 21386 - Can't commit edits to Postgres because relation "text_old_id_seq" does not exist?
Can't commit edits to Postgres because relation "text_old_id_seq" does not ex...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
1.16.x
All All
: Normal major (vote)
: ---
Assigned To: Greg Sabino Mullane
:
: 24738 (view as bug list)
Depends on:
Blocks: postgres
  Show dependency treegraph
 
Reported: 2009-11-02 14:14 UTC by Niels Olson
Modified: 2012-08-04 20:48 UTC (History)
4 users (show)

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


Attachments

Description Niels Olson 2009-11-02 14:14:10 UTC
I can't seem to commit any transactions to the database. The backtrace is below. Postgres IRC member oicu said 

"You might be able to cure it with something like "create sequence text_old_id_seq" if you're lucky. You'll also need to grant select and update privs on that sequence appropriately."

Any thoughts on this? Am I in a situation where this is a database that needs a growing pile of transactions rolled back, or is there something in mediawiki's transaction code that's jamming up postgres each time? FWIW, I ran VACUUM on tables as recommended by pgAdmin3 and I still get the same traceback.

--------

Warning: pg_query(): Query failed: ERROR: relation "text_old_id_seq" does not exist in /opt/local/apache2/htdocs/w/includes/db/DatabasePostgres.php on line 580 Warning: pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block in /opt/local/apache2/htdocs/w/includes/db/DatabasePostgres.php on line 580 Warning: pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block in /opt/local/apache2/htdocs/w/includes/db/DatabasePostgres.php on line 580 Warning: pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block in /opt/local/apache2/htdocs/w/includes/db/DatabasePostgres.php on line 580 Warning: pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block in /opt/local/apache2/htdocs/w/includes/db/DatabasePostgres.php on line 580 Warning: Invalid argument supplied for foreach() in /opt/local/apache2/htdocs/w/includes/SpecialPage.php on line 603 Warning: Invalid argument supplied for foreach() in /opt/local/apache2/htdocs/w/includes/SpecialPage.php on line 603 Warning: pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block in /opt/local/apache2/htdocs/w/includes/db/DatabasePostgres.php on line 580 Warning: pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block in /opt/local/apache2/htdocs/w/includes/db/DatabasePostgres.php on line 580 Warning: pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block in /opt/local/apache2/htdocs/w/includes/db/DatabasePostgres.php on line 580 Warning: pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block in /opt/local/apache2/htdocs/w/includes/db/DatabasePostgres.php on line 580 Warning: pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block in /opt/local/apache2/htdocs/w/includes/db/DatabasePostgres.php on line 580 Warning: Invalid argument supplied for foreach() in /opt/local/apache2/htdocs/w/includes/SpecialPage.php on line 603 Warning: pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block in /opt/local/apache2/htdocs/w/includes/db/DatabasePostgres.php on line 580 Warning: Invalid argument supplied for foreach() in /opt/local/apache2/htdocs/w/includes/SpecialPage.php on line 603 Warning: pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block in /opt/local/apache2/htdocs/w/includes/db/DatabasePostgres.php on line 580 Warning: Invalid argument supplied for foreach() in /opt/local/apache2/htdocs/w/includes/SpecialPage.php on line 603 Warning: pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block in /opt/local/apache2/htdocs/w/includes/db/DatabasePostgres.php on line 580 Warning: pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block in /opt/local/apache2/htdocs/w/includes/db/DatabasePostgres.php on line 580 Warning: Invalid argument supplied for foreach() in /opt/local/apache2/htdocs/w/includes/SpecialPage.php on line 603 Warning: pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block in /opt/local/apache2/htdocs/w/includes/db/DatabasePostgres.php on line 580 Warning: pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block in /opt/local/apache2/htdocs/w/includes/db/DatabasePostgres.php on line 580 Warning: Invalid argument supplied for foreach() in /opt/local/apache2/htdocs/w/includes/SpecialPage.php on line 603 Warning: pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block in /opt/local/apache2/htdocs/w/includes/db/DatabasePostgres.php on line 580 Warning: pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block in /opt/local/apache2/htdocs/w/includes/db/DatabasePostgres.php on line 580 Warning: pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block in /opt/local/apache2/htdocs/w/includes/db/DatabasePostgres.php on line 580 MediaWiki internal error.

Original exception: exception 'DBUnexpectedError' with message 'A database error has occurred
Query: SELECT nextval('text_old_id_seq')
Function:
Error: 1 ERROR: relation "text_old_id_seq" does not exist
' in /opt/local/apache2/htdocs/w/includes/db/DatabasePostgres.php:1114
Stack trace:
#0 /opt/local/apache2/htdocs/w/includes/db/Database.php(533): DatabasePostgres->reportQueryError('ERROR: relatio...', 1, 'SELECT nextval(...', '', false)
#1 /opt/local/apache2/htdocs/w/includes/db/DatabasePostgres.php(968): DatabaseBase->query('SELECT nextval(...')
#2 /opt/local/apache2/htdocs/w/includes/Revision.php(829): DatabasePostgres->nextSequenceValue('text_old_id_seq')
#3 /opt/local/apache2/htdocs/w/includes/Article.php(1934): Revision->insertOn(Object(DatabasePostgres))
#4 /opt/local/apache2/htdocs/w/includes/Article.php(1765): Article->doEdit('25 kcal/kilo??*...', '', 98)
#5 /opt/local/apache2/htdocs/w/includes/EditPage.php(1065): Article->updateArticle('25 kcal/kilo??*...', '', false, false, false, '')
#6 /opt/local/apache2/htdocs/w/includes/EditPage.php(2541): EditPage->internalAttemptSave(false, false)
#7 /opt/local/apache2/htdocs/w/includes/EditPage.php(470): EditPage->attemptSave()
#8 /opt/local/apache2/htdocs/w/includes/EditPage.php(355): EditPage->edit()
#9 /opt/local/apache2/htdocs/w/extensions/FCKeditor/FCKeditor.body.php(161): EditPage->submit()
#10 [internal function]: FCKeditor_MediaWiki->onCustomEditor(Object(Article), Object(StubUser))
#11 /opt/local/apache2/htdocs/w/includes/Hooks.php(133): call_user_func_array(Array, Array)
#12 /opt/local/apache2/htdocs/w/includes/Wiki.php(533): wfRunHooks('CustomEditor', Array)
#13 /opt/local/apache2/htdocs/w/includes/Wiki.php(70): MediaWiki->performAction(Object(OutputPage), Object(Article), Object(Title), Object(User), Object(WebRequest))
#14 /opt/local/apache2/htdocs/w/index.php(117): MediaWiki->performRequestForTitle(Object(Title), Object(Article), Object(OutputPage), Object(User), Object(WebRequest))
#15 {main}

Exception caught inside exception handler: exception 'DBUnexpectedError' with message 'SQL error: ERROR: current transaction is aborted, commands ignored until end of transaction block' in /opt/local/apache2/htdocs/w/includes/db/DatabasePostgres.php:631
Stack trace:
#0 /opt/local/apache2/htdocs/w/includes/WatchedItem.php(45): DatabasePostgres->numRows(false)
#1 /opt/local/apache2/htdocs/w/includes/User.php(2257): WatchedItem->isWatched()
#2 /opt/local/apache2/htdocs/w/includes/Title.php(1004): User->isWatched(Object(Title))
#3 /opt/local/apache2/htdocs/w/includes/SkinTemplate.php(836): Title->userIsWatching()
#4 /opt/local/apache2/htdocs/w/includes/SkinTemplate.php(471): SkinTemplate->buildContentActionUrls()
#5 /opt/local/apache2/htdocs/w/includes/OutputPage.php(1244): SkinTemplate->outputPage(Object(OutputPage))
#6 /opt/local/apache2/htdocs/w/includes/Exception.php(164): OutputPage->output()
#7 /opt/local/apache2/htdocs/w/includes/Exception.php(191): MWException->reportHTML()
#8 /opt/local/apache2/htdocs/w/includes/Exception.php(289): MWException->report()
#9 /opt/local/apache2/htdocs/w/includes/Exception.php(348): wfReportException(Object(DBUnexpectedError))
#10 [internal function]: wfExceptionHandler(Object(DBUnexpectedError))
#11 {main}
Comment 1 Niels Olson 2009-11-02 14:16:08 UTC
Also, the postgres is from MacPorts, version 8.3.6, and the mediawiki is svn trunk. The error seems to have started with my latest checkout, which had a couple weeks of changes in it (due to being out service range in the middle of the Texas desert with a pack on my back)
Comment 2 Niels Olson 2009-11-02 15:46:29 UTC
Turns out this was due to mediawiki changing the names of several sequences in the database. Refreshed all with pgAdmin, and everything works again. Wish that had been in the release notes or something. Was it and I'm just not seeing it? If so, where?
Comment 3 Greg Sabino Mullane 2009-11-15 22:03:06 UTC
I'm not clear on the history of events? What version was it created with, and did the upgrade a couple weeks later give any errors? (the upgrade command that is).
Comment 4 OverlordQ 2010-03-01 01:24:22 UTC
r58262 and r58263

Seems it missed release notes, did you run update? If the updaters didn't update the fields correctly then yes that's likely a bug, but afaik it worked fine during testing.
Comment 5 Chad H. 2010-09-01 19:23:47 UTC
*** Bug 24738 has been marked as a duplicate of this bug. ***
Comment 6 OverlordQ 2010-09-01 20:14:04 UTC
the update script uses RENAME SEQUENCE which appears to be 8.3+ instead of the more backwards compatible ALTER TABLE RENAME
Comment 7 OverlordQ 2010-09-03 21:24:50 UTC
Should be fixed with r72314 on master.

Not yet merged to the 1.16 branch.
Comment 8 Michael Tutty 2011-02-03 21:24:58 UTC
The revision referenced above doesn't appear to work properly with my PG 8.1.21.  Specifically, the ALTER TABLE <tablename> RENAME <sequencename> TO <newseqname> seems to be written wrong.  I was able to get the following to work:

ALTER TABLE rev_rev_id_val RENAME TO revision_rev_id_seq;
ALTER TABLE revision ALTER COLUMN rev_id SET DEFAULT NEXTVAL('revision_rev_id_seq');
	
ALTER TABLE text_old_id_val RENAME TO text_old_id_seq;
ALTER TABLE pagecontent ALTER COLUMN old_id SET DEFAULT nextval('text_old_id_seq');
	
ALTER TABLE category_id_seq RENAME TO category_cat_id_seq;
ALTER TABLE category ALTER COLUMN cat_id SET DEFAULT nextval('category_cat_id_seq');
	
ALTER TABLE ipblocks_ipb_id_val RENAME TO ipblocks_ipb_id_seq;
ALTER TABLE ipblocks ALTER COLUMN ipb_id SET DEFAULT nextval('ipblocks_ipb_id_seq');
	
ALTER TABLE rc_rc_id_seq RENAME TO recentchanges_rc_id_seq;
ALTER TABLE recentchanges ALTER COLUMN rc_id SET DEFAULT nextval('recentchanges_rc_id_seq');
	
ALTER TABLE log_log_id_seq RENAME TO logging_log_id_seq;
ALTER TABLE logging ALTER COLUMN log_id SET DEFAULT nextval('logging_log_id_seq');
	
ALTER TABLE pr_id_val RENAME TO page_restrictions_pr_id_seq;
ALTER TABLE page_restrictions ALTER COLUMN pr_id SET DEFAULT nextval('page_restrictions_pr_id_seq');
Comment 9 Tim Landscheidt 2011-12-31 20:43:22 UTC
Thanks for your report.  PostgreSQL 8.1 reached its end of life in November 2010.  While MediaWiki 1.16 may have been released before that time, this bug is now a dead horse.

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


Navigation
Links