Page MenuHomePhabricator

Database error when installing Flow
Closed, ResolvedPublic

Description

I tried to install Flow in a wiki running 1.21.1 and there where critical problems when running the upgrade script. Perhaps others want to check in 1.21.2 or 1.22.*?

Running the script the first time ("espiral_b" is the name of the database, the actual server paths are being cut here just in case):

Creating flow_revision table ...
An error occurred:
A database query syntax error has occurred.
The last attempted database query was:
"CREATE UNIQUE INDEX flow_definition_unique_name ON flow_definition
(definition_wiki, definition_name)
"
from within function "DatabaseBase::sourceFile(
.../extensions/Flow/flow.sql )".
Database returned error "1146: Table 'espiral_b.flow_definition' doesn't
exist (localhost)"
Backtrace:
#0
.../includes/db/Database.php(983):
DatabaseBase->reportQueryError('Table 'espiral_...', 1146, 'CREATE
UNIQUE I...', 'DatabaseBase::s...', false)
#1
.../includes/db/Database.php(3409): DatabaseBase->query('CREATE
UNIQUE I...', 'DatabaseBase::s...')
#2
.../includes/db/Database.php(3322): DatabaseBase->sourceStream(Resource
id #345, false, false, 'DatabaseBase::s...', false)
#3
.../includes/installer/DatabaseUpdater.php(639):
DatabaseBase->sourceFile('/srv/data/web/v...')
#4
.../includes/installer/DatabaseUpdater.php(661):
DatabaseUpdater->applyPatch('/srv/data/web/v...', true, 'Creating
flow_r...')
#5 [internal function]: DatabaseUpdater->addTable('flow_revision',
'/srv/data/web/v...', true)
#6
.../includes/installer/DatabaseUpdater.php(435):
call_user_func_array(Array, Array)
#7
.../includes/installer/DatabaseUpdater.php(391):
DatabaseUpdater->runUpdates(Array, true)
#8
.../includes/installer/DatabaseInstaller.php(274):
DatabaseUpdater->doUpdates()
#9
.../includes/installer/WebInstallerPage.php(552):
DatabaseInstaller->doUpgrade()
#10
.../includes/installer/WebInstaller.php(270):
WebInstaller_Upgrade->execute()
#11 .../mw-config/index.php(65):
WebInstaller->execute(Array)
#12 .../mw-config/index.php(33):
wfInstallerMain()
#13 {main}
Purging caches...done.

Then, running the upgrade script a second time without changing anything:

Creating flow_revision table ...
An error occurred:
A database query syntax error has occurred.
The last attempted database query was:
"CREATE TABLE espiral_bflow_definition (

definition_id binary(16) NOT NULL,
definition_wiki varchar(32) binary NOT NULL,
definition_name varchar(32) binary NOT NULL,
definition_type varchar(32) binary NOT NULL,
definition_options BLOB NULL, -- should instead be revisioned blob
PRIMARY KEY (definition_id)
) ENGINE=InnoDB, DEFAULT CHARSET=binary

"
from within function "DatabaseBase::sourceFile(
.../extensions/Flow/flow.sql )".
Database returned error "1050: Table 'espiral_bflow_definition' already
exists (localhost)"
Backtrace:
#0
.../includes/db/Database.php(983):
DatabaseBase->reportQueryError('Table 'espiral_...', 1050, 'CREATE TABLE
`e...', 'DatabaseBase::s...', false)
#1
.../includes/db/Database.php(3409): DatabaseBase->query('CREATE
TABLE `e...', 'DatabaseBase::s...')
#2
.../includes/db/Database.php(3322): DatabaseBase->sourceStream(Resource
id #345, false, false, 'DatabaseBase::s...', false)
#3
.../includes/installer/DatabaseUpdater.php(639):
DatabaseBase->sourceFile('/srv/data/web/v...')
#4
.../includes/installer/DatabaseUpdater.php(661):
DatabaseUpdater->applyPatch('/srv/data/web/v...', true, 'Creating
flow_r...')
#5 [internal function]: DatabaseUpdater->addTable('flow_revision',
'/srv/data/web/v...', true)
#6
.../includes/installer/DatabaseUpdater.php(435):
call_user_func_array(Array, Array)
#7
.../includes/installer/DatabaseUpdater.php(391):
DatabaseUpdater->runUpdates(Array, true)
#8
.../includes/installer/DatabaseInstaller.php(274):
DatabaseUpdater->doUpdates()
#9
.../b/includes/installer/WebInstallerPage.php(552):
DatabaseInstaller->doUpgrade()
#10
.../includes/installer/WebInstaller.php(270):
WebInstaller_Upgrade->execute()
#11 .../mw-config/index.php(65):
WebInstaller->execute(Array)
#12 .../mw-config/index.php(33):
wfInstallerMain()
#13 {main}
Purging caches...done.

After this the extension appears as installed in Special:Version but it's not functional.


Version: master
Severity: critical

Details

Reference
bz54076

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:12 AM
bzimport set Reference to bz54076.

Change 84297 had a related patch set uploaded by Spage:
Add a missing /*_*/ prefix on a CREATE INDEX

https://gerrit.wikimedia.org/r/84297

Quim, We don't claim Flow works on 1.21, please update Extension_talk:Flow with your experiences.

It sounds like your database is using $wgDBprefix. My gerrit patch guesses at a fix, can you could try it?

You may have problems because upgrade thinks it ran the maintenance script. If so, as well as dropping all flow tables, in mysql

use espiral_b;
delete from updatelog where ul_key = 'FlowInsertDefaultDefinitions' LIMIT 1;

then rerun upgrade.

Change 84297 merged by EBernhardson (WMF):
Add a missing /*_*/ prefix on a CREATE INDEX

https://gerrit.wikimedia.org/r/84297

Tested with the last snapshot and now the installation goes fine. Or at least no error is reported during the upgrade, and the extension appears at Special:Version.

(Now I'm stuck at https://www.mediawiki.org/wiki/Extension_talk:Flow#Internal_errors_32348 but that seems to be an unrelated problem)