Last modified: 2014-05-08 10:36:55 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 T48533, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 46533 - CentralNotice has a broken database updater
CentralNotice has a broken database updater
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
CentralNotice (Other open bugs)
master
All All
: Normal normal (vote)
: ---
Assigned To: Antoine "hashar" Musso (WMF)
:
Depends on:
Blocks: 46382
  Show dependency treegraph
 
Reported: 2013-03-25 11:50 UTC by Antoine "hashar" Musso (WMF)
Modified: 2014-05-08 10:36 UTC (History)
6 users (show)

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


Attachments

Description Antoine "hashar" Musso (WMF) 2013-03-25 11:50:25 UTC
Spotted on beta:


mwdeploy@deployment-bastion:~$ mwscript update.php --wiki=dewiki --quick --quiet
PHP Warning:  call_user_func_array() expects parameter 1 to be a valid callback, function 'CNDatabasePatcher' not found or invalid function name in /data/project/apache/common-local/php-master/includes/Hooks.php on line 255

Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'CNDatabasePatcher' not found or invalid function name in /data/project/apache/common-local/php-master/includes/Hooks.php on line 255
Detected bug in an extension! Hook CNDatabasePatcher failed to return a value; should return true to continue hook processing or false to abort.
Backtrace:
#0 /data/project/apache/common-local/php-master/includes/GlobalFunctions.php(3883): Hooks::run('LoadExtensionSc...', Array)
#1 /data/project/apache/common-local/php-master/includes/installer/DatabaseUpdater.php(111): wfRunHooks('LoadExtensionSc...', Array)
#2 /data/project/apache/common-local/php-master/includes/installer/DatabaseUpdater.php(162): DatabaseUpdater->__construct(Object(DatabaseMysql), false, Object(UpdateMediaWiki))
#3 /data/project/apache/common-local/php-master/maintenance/update.php(149): DatabaseUpdater::newForDB(Object(DatabaseMysql), false, Object(UpdateMediaWiki))
#4 /data/project/apache/common-local/php-master/maintenance/doMaintenance.php(110): UpdateMediaWiki->execute()
#5 /data/project/apache/common-local/php-master/maintenance/update.php(192): require_once('/data/project/a...')
#6 /data/project/apache/common-local/multiversion/MWScript.php(85): require_once('/data/project/a...')
#7 {main}

---

Aka:

Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'CNDatabasePatcher' not found or invalid function name in /data/project/apache/common-local/php-master/includes/Hooks.php on line 255
Detected bug in an extension! Hook CNDatabasePatcher failed to return a value; should return true to continue hook processing or false to abort.
Comment 1 Antoine "hashar" Musso (WMF) 2013-03-25 11:52:21 UTC
I guess the root cause is https://gerrit.wikimedia.org/r/#/c/52913/
Comment 2 Antoine "hashar" Musso (WMF) 2013-03-25 11:56:29 UTC
Once per hour, Jenkins will run update.php on the 'enwiki' database of the beta cluster.  The job dashboard is https://integration.wikimedia.org/ci/job/beta-updatedb-enwiki/

It started breaking on March 21st https://integration.wikimedia.org/ci/job/beta-updatedb-enwiki/42/
Comment 3 Antoine "hashar" Musso (WMF) 2013-03-25 12:39:44 UTC
-$wgHooks[ 'LoadExtensionSchemaUpdates' ][ ] = array( 'CNDatabasePatcher', 'applyUpdates' );
+$wgHooks[ 'LoadExtensionSchemaUpdates' ][ ] = 'CNDatabasePatcher::applyUpdates';

That fix it on my install.
Comment 4 Antoine "hashar" Musso (WMF) 2013-03-25 12:42:36 UTC
 https://gerrit.wikimedia.org/r/55567
Comment 5 Antoine "hashar" Musso (WMF) 2013-03-25 12:46:40 UTC
Bah I did my test on sqlite, not mysql. Reopening.
Comment 6 Antoine "hashar" Musso (WMF) 2013-03-25 13:26:54 UTC
Did some cleanup on beta and now I got:


Creating cn_controller_mixins table ...A database query syntax error has occurred.
The last attempted database query was:
"ALTER TABLE `cn_notices`
 DROP COLUMN `not_language`,
 DROP COLUMN `not_project`,
 ADD COLUMN `not_weight` int(11) NOT NULL DEFAULT '100',
 ADD COLUMN `not_mobile_carrier` tinyint(1) NOT NULL DEFAULT '0',
 ADD COLUMN `not_archived` tinyint(1) NOT NULL DEFAULT '0'
"
from within function "DatabaseBase::sourceFile( /data/project/apache/common-local/php-master/extensions/CentralNotice/patches/patch-centralnotice-2_3.sql )".
Database returned error "1091: Can't DROP 'not_language'; check that column/key exists (10.4.0.53)"
Comment 7 Antoine "hashar" Musso (WMF) 2013-03-25 13:51:06 UTC
When bootstrapping a new wiki CentralNotice.sql does not create:
- table cn_controller_mixins
- cn_notices.not_language and cn_notices.not_project 

The absence of table cn_controller_mixins triggers the run of patches/patch-centralnotice-2_3.sql which attempt drop the two non existent columns, hence the stack trace.
Comment 8 Antoine "hashar" Musso (WMF) 2013-03-25 14:06:05 UTC
For the column bug, see https://gerrit.wikimedia.org/r/55579
Comment 9 Antoine "hashar" Musso (WMF) 2013-03-25 14:25:20 UTC
Next issue:

The last attempted database query was:
"ALTER TABLE `cn_notices`
 DROP COLUMN `not_language`,
 DROP COLUMN `not_project`,
 ADD COLUMN `not_weight` int(11) NOT NULL DEFAULT '100',
 ADD COLUMN `not_mobile_carrier` tinyint(1) NOT NULL DEFAULT '0',
 ADD COLUMN `not_archived` tinyint(1) NOT NULL DEFAULT '0'
"
from within function "DatabaseBase::sourceFile( /data/project/apache/common-local/php-master/extensions/CentralNotice/patches/patch-centralnotice-2_3.sql )".
Database returned error "1060: Duplicate column name 'not_weight' (10.4.0.53)"


Wich is a similar issue: the patch attempt to add columns which have already been populated by the main patch.
Comment 10 Antoine "hashar" Musso (WMF) 2013-03-25 14:55:22 UTC
I have reverted the whole patchset with https://gerrit.wikimedia.org/r/#/c/55587/ .  Pinging authors by email.
Comment 11 Antoine "hashar" Musso (WMF) 2013-04-08 20:34:10 UTC
The patch has been reimplemented with https://gerrit.wikimedia.org/r/55695 :-]

I still have to test it out but beta is no more broken so I am lowering the priority for this issue.
Comment 12 Ori Livneh 2013-06-08 08:50:58 UTC
This patch should be back-ported to the release branch. A user just logged on IRC to report that this issue broke his/her MediaWiki instance after upgrading to RHEL_1_21.
Comment 13 Andre Klapper 2013-06-08 21:42:24 UTC
(In reply to comment #12)
> This patch should be back-ported to the release branch.

-->  Backport_to_Stable flag set to "?"
Comment 14 Andre Klapper 2013-08-14 14:39:36 UTC
(In reply to comment #13)
> -->  Backport_to_Stable flag set to "?"

hexmode: ping?
Comment 15 Mark A. Hershberger 2014-05-08 10:36:55 UTC
Doesn't cleanly cherry pick.

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


Navigation
Links