Extension talk:MaintenanceShell/Archive

Successfuly working with MediaWiki 1.??.?
It works fine on Mediawiki 1.14.0. Thanks! Enzo // Same on 1.13.4. Al Maghi

Hey, great idea!
Hey, great idea! Exactly what i was looking for to run on my rather restricted server. stupid university sysadmins :(

I dunno if this discussion page is the right place to post this, but nevermind.

I think I found some minor glitches:


 * MaintenanceShell_body.php, line 50: the & and ? are in the wrong order, swap them in order to get the list of maintenance scripts on Special:MaintenanceShell functional again
 * MaintenanceShell.php, line 41: it should say 'Location: http:// ', otherwise it renders the URL unusable
 * MaintenanceShell.php, line 50: this looks like a remainder of v0.1.0's password system to me?

Unfortunately I could not get it to run. After filling the form with, let's say checkImages and command line "--fix" and submitting, the script just returns to Special:MaintenanceShell without any further ado...

Any ideas? Any Feedback would be greatly appreciated. Please mail me in an electronically manner to user PHIL at the hostname METAPHIL in country DE :-)
 * Hi Phil.. sorry it didn't work for you.. I'm not sure why. I will look into the bugs you posted.  I really appreciate your feedback and hopefully we'll get it working for you :) What version of MediaWiki are you using?  I can only verify it should work on 1.14.0  --Frantik 23:13, 31 May 2009 (UTC)
 * I followed up with Phil and I think we've got his problem solved... The user rights must be placed before the script call. --Frantik 19:55, 1 June 2009 (UTC)
 * v0.2.1 addresses the bugs mentioned above --Frantik 02:57, 2 June 2009 (UTC)

Where to go in order to use it
Stupid question but where do you actually go to use MaintenanceShell once installed?--86.28.134.69 11:27, 4 June 2009 (UTC)
 * Thats a great question actually lol.. you can see it on Special:SpecialPages under Wiki data and tools, or its own page Special:MaintenanceShell --Frantik 00:55, 5 June 2009 (UTC)

How to get a NULL setting ? ( "" or ' ' not working)
I run the command  php userOptions.php gadget-HotCat --new 1 --old  ''

Result:

''The script is about to change the skin for ALL USERS in the database. Users with option =  will be made to use '1'.

but it doesn't get the NULL setting from old ''. Doesn't work either with old "".

--almaghi 10:09, 10 June 2009 (UTC)
 * I'm not 100% sure.. does this command work as expected from the command line? (though I assume you're using this extension because you can't access the command line) --Frantik 19:47, 11 June 2009 (UTC)
 * Ok it seems I'm not handling quote marks properly. i will update it --Frantik 19:51, 11 June 2009 (UTC)
 * Yeah it does work as expected from command line. --almaghi 15:47, 15 June 2009 (UTC)
 * Ok. Thks for your update & your extension, good job is done here ! --almaghi 15:47, 15 June 2009 (UTC)
 * Thanks! I will release the update soon :) --Frantik 00:21, 16 June 2009 (UTC)
 * v0.2.2 should solve this issue :) --Frantik 01:14, 19 June 2009 (UTC)
 * v0.2.2 test: The " " works, it give a NULL value. The  ' '  doesn't work. I think this last bug is not inconvenient: when  ' '  doesn't work the first idea that come is to test with " ". --almaghi 08:32, 19 June 2009 (UTC)
 * cool, that is expected. I will add support for single quotes next time.  Glad to know it works --Frantik 08:56, 19 June 2009 (UTC)

Problem with skin chance command
I installed this on 1.13 and was executing the skin change command: userOptions.php skin --old "monobook" --new "modern" It executed and it stated that it actually performed the action. However, when I went into the accounts to check, it actually didn't work. The user skin was not changed. Could it be an issue with writing to the database? Why would it say it completed OK if it didn't make any database changes?--Valiot 11:11, 18 July 2009 (UTC)
 * Hi, I didn't notice your comment. Unfortunately I can't give help on the individual scripts, I've only created the interface to access them.  Honestly I don't even know what half of them do!  --Frantik 17:19, 15 August 2009 (UTC)

Working directories
Hi, I want to use maintenanceShell to install FlaggedRevs and for this, i need to change the working dir to something like /wiki/maintenance/archives/ and to /wiki/extensions/FlaggedRevs/ to get the scripts from there.

Where and how should change the $wgMaintenanceShellDir ?
 * You set it in your LocalSettings.php file. Right now the script doesn't support Maintenance shell scripts outside of the mainenance folder. --Frantik 16:41, 31 July 2009 (UTC)
 * The easiest way to run scripts in those other folders is to copy them into the main maintenance folder. the next version I release will support the subfolders --Frantik 15:20, 10 August 2009 (UTC)

file_exists Error
I'm trying to run  in MaintenanceShell (without any arguments at this stage) and get the following error:   --Agrestis 09:49, 6 October 2009 (UTC)
 * this is an error in commandLine.inc (not part of my extension).. it seems like it's left over from Wikipedia since it's referencing a specific file. You can safely ignore it as it has no effect on the actual maintenance scripts --Frantik 05:04, 12 October 2009 (UTC)
 * btw, are you using 15.1? i noticed i had to do another tweak to get this extension to work on 15.1 so i need to release an update --Frantik 05:08, 12 October 2009 (UTC)
 * Thanks, I wasn't sure if the error was the extension or Mediawiki itself. For reference I'm using Mediawiki 1.14.0 with MaintenanceShell 0.2.2 --Agrestis 19:51, 12 October 2009 (UTC)

PHP Notice: Undefined index: extension in /var/www/html/extensions/MaintenanceShell/MaintenanceShell_body.php on line 58, referer: http://wikiserver/Special:MaintenanceShell
replace line 58 in maintenanceshell_body.php with {	if (($arr = pathinfo($v)) && array_key_exists('extension', $arr) && ($arr['extension'] == 'php') && (strpos($v, '.inc') === false))

i believe this is being caused by the sub directories in this folder or possibly some of the files that do not have extensions.
 * oops.. thanks for the heads up on that one --Frantik 14:25, 14 November 2009 (UTC)

nice
Installed and works nice. Two suggestions, though. Change the folders name. It's confusing and would save the extra step of changing it after the wiki goes off because something's wrong in localsettings. And two... can you specify more clearly how to use options. if you're using -r, for example, you just wrote -r or something else is needed? You mentioned something about using quotes in the main page. Other than this, kudos. Really usefull tool for all mediawikians.--Mark 03:45, 11 December 2009 (UTC)
 * A couple more things: The go back to maintenance shell is broken in Spanish (and probably other languages). In the Spanish case the link is to "Especial:". Also, for those using shared hosting, you need to set up your AdminSettings.php with the password and login to your database. Some scripts are timing out, but I'm still testing. Will be back here. --Mark 04:15, 11 December 2009 (UTC)
 * Refresh Links script times out in about a minute+. This is the message.

Refreshing links table. Starting from page_id 0 of 13706. 0 ï»¿100 200 300 400 500 600 700 800 900 1000 1100 1200 1300 ï»¿1400 1500 --Mark 04:24, 11 December 2009 (UTC)
 * checkUserNames doesn't run at all.--Mark 08:14, 11 December 2009 (UTC)
 * Hi Mark - this extension is mostly just a wrapper, I can't really provide help on how to use the various scripts or even guarantee all scripts work correctly. I will look into checkusernames when I get a chance.  --Frantik 11:03, 16 December 2009 (UTC)

"Return to Maintenance Shell" bug
On the "run script" page, there is a link to "Return to the Maintenance Shell". That link is busted...it points to "index.php&title=Special:MaintenanceShell". It should be a question mark instead of an ampersand before the "title" parameter. --Duke33 19:57, 16 December 2009 (UTC)
 * thanks, this has been corrected for the next release --Frantik 00:15, 17 December 2009 (UTC)

Recaptcha bug
If Extension:reCAPTCHA is installed you get the following message when trying to run any maintanance script: "You need to set $recaptcha_private_key and $recaptcha_public_key in LocalSettings.php to use the reCAPTCHA plugin. You can sign up for a key here." Those lines are of course present and reCAPTCHA works fine everywhere else, so probably something about the way this script is calling others.
 * Is the command to load MaintenanceShell the VERY LAST line in LocalSettings.php?

require_once("$IP/extensions/MaintenanceShell/MaintenanceShell.php");
 * 1) Place this on the VERY LAST line of your Localsettings.php file:
 * I suspect you are setting the recapcha values after calling maintenanceshell... --Frantik 22:25, 24 January 2010 (UTC)

Localisation for German
Hi Frantik,

I have localised your extension into German with regard to MaintenanceShell.php.

$messages['de'] = array( 	'maintenanceshell' => 'Wartungs-Shell', 	'maintenanceshell-desc' => 'Erg&auml;nzt eine Spezialseite mit hilfreichen Links zu Wartungsskripten f&uuml;r die Systemadministration.', 	'right-maintenanceshell' => 'Wartungsskripte über die Wartungs-Shell ausf&uuml;hren.', );

I would link to suggest as an enhancement that you make MaintenanceShell_body.php localisable as well. I have done the German localisation. In case you need it... :-)

Cheers and thank you for your good work. --kgh 23:18, 11 April 2010 (UTC)
 * I agree.. this is a bad habit I have as a native english speaker.. :( I will address this in the next release (when i get a chance to release it) thanks for your help :) --Frantik 08:33, 17 April 2010 (UTC)
 * No worries. The main thing is, that the extension is available. Since English is a standard, there is nothing wrong about providing an extension in English, especially with regard to site administrators. However, localised extensions spread more easily. Cheers --kgh 10:00, 17 April 2010 (UTC)
 * You should be able to set all text now with 0.2.3 :) --Frantik 00:59, 8 May 2010 (UTC)
 * That's great news! Thank you! I now provide the localisaton for ‚de‘ and ‚de-formal‘ as promised:

/** German (Deutsch) * @author kghbln */ $messages['de'] = array(  'maintenanceshell'         => 'Wartungs-Shell',   'maintenanceshell-desc'    => 'Erg&auml;nzt eine Spezialseite mit hilfreichen Links zu Wartungsskripten f&uuml;r die Systemadministration.',   'maintshell-pagename'      => 'Special:Wartungs-Shell',   'right-maintenanceshell'   => 'Wartungsskripte &uuml;ber die Wartungs-Shell ausf&uuml;hren.',   'maintshell-installfail'   => "Das Benutzergruppenrecht maintenanceshell, das f&uuml;r die Verwendung der Wartungs-Shell ben&ouml;tigt wird, wurde keiner Benutzergruppe zugeordnet.

Weitere Hinweise hierzu gibt es in der Dokumentation zur Wartungs-Shell.",  'maintshell-installfail2'  => "Die Wartungs-Shell wurde fehlerhaft konfiguriert. Das Benutzergruppenrecht maintenanceshell muss in der Datei LocalSettings.php einer Benutzergruppe zugewiesen werden, bevor dort die Softwareerweiterung Wartungs-Shell aufgerufen wird.

Weitere Hinweise hierzu gibt es in der Dokumentation zur Wartungs-Shell.",  'maintshell-installfail3'  => 'Um die Wartungs-Shell zu aktivieren, muss folgender Code in der allerletzten Zeile der Datei LocalSettings.php eingef&uuml;gt werden: require_once( "$IP/extensions/MaintenanceShell/MaintenanceShell.php" );',   'maintshell-return'        => 'R&uuml;ckkehr zur Wartungs-Shell',   'maintshell-noexist'       => "Das Skript '$1' ist nicht vorhanden!",   'maintshell-warning'       => ' Achtung: Setze diese Skripte sorgf&auml;ltig ein. Dies wird zudem nur Systemadministratoren und fortgeschrittenen Nutzern empfohlen.',   'maintshell-links'         => '			            <a class="external" href="http://www.mediawiki.org/wiki/Manual:Maintenance_scripts">Nutzeranleitung f&uuml;r die Wartungs-Shell (englisch)</a></li> <li><a class="external" href="http://www.mediawiki.org/wiki/Extension:MaintenanceShell">Hompage zur Wartungs-Shell (englisch) </a></li> </ul> ',  'maintshell-available'     => ' Verf&uuml;gbare Wartungsskripte:', 'maintshell-scriptname'   => 'Name des Skrips', 'maintshell-commandline'  => 'Zus&auml;tzliche Kommandos', 'maintshell-runscript'    => 'Skript ausf&uuml;hren', );

/** German (formal address) (Deutsch (Sie-Form)) * @author kghbln */ $messages['de-formal'] = array( 'maintshell-warning'      => ' Achtung: Setzen Sie diese Skripte sorgf&auml;ltig ein. Dies wird zudem nur Systemadministratoren und fortgeschrittenen Nutzern empfohlen.', );
 * Please copy it from the edit page due to the Germanic umlauts. Did you ever think of getting you extensions to SVN? Thus the localisation files would be automatically provided to „translate.net“ which would very much increase the chance of further localisations. --kgh 12:28, 8 May 2010 (UTC)
 * Awesome, I will include this in the release. I've been meaning to get an SVN account to add extensions.. this will probably be the motivation I need --Frantik 18:48, 8 May 2010 (UTC)
 * Your welcome. I hope to see it on SVN :) --kgh 23:58, 8 May 2010 (UTC)
 * Great.. I added your contribution to the release and have also submitted my request for SVN access. Cheers --Frantik 02:41, 9 May 2010 (UTC)
 * :-) Wonderful news. However, there is on thing about SVN. I do not think, that it is possible to see how many use or at least downloaded the extension. I hope you do not have second thoughts now. On the other hand extensions on SVN may be regarded much higher in status. Cheers --kgh 08:35, 9 May 2010 (UTC)
 * Yes that one one reason I like to keep the files on my server, so I can keep track of the # of downloads. But as you say, SVN extensions are regarded more highly.. plus it's easier for people to install i believe. --22:15, 9 May 2010 (UTC)
 * I think, if you keep on offering the package for download, as you do now, you will still be getting most of them. --kgh 10:16, 10 May 2010 (UTC)

problem with latest mediawiki
MaintenanceShell's last version doesn't work with mediawiki's last dump. 90.25.28.52 09:43, 17 May 2010 (UTC)

Well, in fact, no version of MaintenanceShell works with mediawiki's last dump.

Warning: array_key_exists [function.array-key-exists]: The second argument should be either an array or an object in /extensions/MaintenanceShell/MaintenanceShell.php on line 142
 * thanks.. though i'm pretty sure I added that code in last two versions of MaintenanceShell. The last version in 2009 should work fine.   What version of Mediawiki specifically are you using? --Frantik 13:03, 18 May 2010 (UTC)
 * I looked into it more.. it's kind of strange that $messages isn't an array.. it means the language file hasn't been loaded, which is unlikely considering there is a line loading the script which defines $messages as an array --Frantik 13:10, 18 May 2010 (UTC)
 * Also, do you get any script output? or just the warning message?  For some reason I'm experiencing no output on one site out of 3, and i had to change ob_start;  to ob_start; ob_start;  .. it might be due to a bug in a certain version of PHP or something so please provide your php version number as well.  thanks --Frantik 14:55, 18 May 2010 (UTC)

Hello, I am getting the same with my installation of the extension. I used the laest version of the extension and i still get this warning messages when i acces to my media wiki. does some budy have a solution ?????
 * what version of Mediawiki and MaintenanceShell are you using? --Frantik 09:38, 27 May 2010 (UTC)

Maintenance Shell on SVN
This is no longer an issue as the code on SVN has been removed until I have commit access --Frantik 18:15, 23 May 2010 (UTC)

I have no control over the code at SVN at this time. This extension was added there by User:Devunt. Unfortunately s/he did not contact me before hand, so that version is effectively a fork.

--Frantik 11:17, 23 May 2010 (UTC)
 * Extensions hosted at the Wikimedia SVN repository have the benefits of translations via translatewiki and better chances to be taken into account when changes to core affecting extensions are considered. Devunt should have really contacted you first but please remember that it's a free software and GPL allowed him to do so. If you don't mind to continue development on our SVN server, please apply for access here, otherwise we could mark out copy as fork. Max Semenik 11:51, 23 May 2010 (UTC)
 * I requested access a week or two ago, so I'm just waiting on a response. Until then, I have no control over the code. I have no idea what changes were made before it was committed, and I can see that changes were made after it was committed.  As you say, this is free software under the GNU GPL, but as the preamble to that license states: GPL requires that modified versions be marked as changed.
 * This event certainly does make me think twice about using GNU GPL again though.. i mean I want people to have it for free and don't care if people distribute the source. I was planning on committing my own version to the MW SVN as soon as I had write access, but now there is some other version there with my name on it but no indication that I have no control over any of changes that have been made.
 * --Frantik 12:22, 23 May 2010 (UTC)

Register warning
Question: with MaintenanceShell 3.0 (downloaded from ) on MediaWiki 1.15 I get "Warning: register_shutdown_function [function.register-shutdown-function]: Invalid shutdown callback 'exit_callback' passed in /mediawiki/extensions/MaintenanceShell/MaintenanceShell.php on line 199". MS is definitely invoked on the last line of my LocalSettings. Any ideas? IsambardBrunel 12:12, 30 May 2010 (UTC)
 * Hm I moved where that function is defined.. i guess I'll need to move it back. This is a very minor error though and will not affect the usability of the script. --Frantik 23:16, 31 May 2010 (UTC)


 * Same issue here. FYI I am using MW 1.16B2.  Not sure which version you made the change so instead of diff manually I'll wait for an update :) Can't wait to try out this extension though!  - Gomeztogo 21:05, 2 June 2010 (UTC)
 * This should not affect the ability of the script to function, though I will update it soon. You can still use it and just ignore the warning.  --Frantik 12:04, 3 June 2010 (UTC)
 * Unfortunately the warning does not include an option to ignore the error. - Gomeztogo 21:36, 3 June 2010 (UTC)
 * A warning should not halt script execution. There might be another problem though if you're not seeing any other output.  I will release an update in the next few days.  You could try with an older version of MaintenanceShell but they have security issues so you should not leave it installed on your system after testing.  --Frantik 02:21, 4 June 2010 (UTC)
 * Version 0.3.1 fixes this problem --Frantik 11:59, 6 June 2010 (UTC)

Mediawiki 1.16 users, please let me know your experience with MaintenanceShell
I've heard reports that MaintenanceShell sometimes doesn't work right with 1.16; If this is true for you, please let me know the symptoms of the problem and also the version of MaintenanceShell, Mediawiki and PHP you are using. You can get this info from the Special:Version page on your wiki. Thanks --Frantik 12:01, 6 June 2010 (UTC)


 * This extension is problematic with 1.16. Running any of the scripts returns this:

"Warning: register_shutdown_function [function.register-shutdown-function]: Invalid shutdown callback 'exit_callback' passed in ...\extensions\MaintenanceShell\MaintenanceShell.php on line 199"


 * Some other scripts seem to work OK, though again that error pops up everytime.


 * However, deleteOldrevisions (for one) does not work. Here is the error:

Limiting to `mwiki_page`.page_id IN Searching for active revisions... A database query syntax error has occurred. The last attempted database query was: "SELECT page_latest FROM `mwiki_page` WHERE page_id IN " from within function "". Database returned error "1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 (xxxxx)"


 * I'd love a working version of this extension, as my host doesn't allow shell/command line access.


 * PHP 5.2.10, MW 1.16.0beta2, MaintenanceShell 0.3.0
 * -- DoubleSuitedChris 20:10, 14 June 2010 (UTC)


 * Got rid of the warning by downloading .3.1. Didn't realize there was a new one! Otherwise, same problem with the DOR script.
 * Glad to hear that is working properly for the most part.  Some of the individual scripts might not work but it's not the fault of the shell, at least in the case of the DOR script you are running based on the error message.  Thanks for providing feedback --Frantik 20:35, 14 June 2010 (UTC)


 * Any suggestions on what I might try to get deleteOldRevisions working? I am only just a tad above novice when it comes to both PHP and mySQL. -- DoubleSuitedChris 21:02, 14 June 2010 (UTC)
 * Unfortunately I don't have any suggestions.. the deleteOldrevisions script itself might be outdated.. --Frantik 09:01, 15 June 2010 (UTC)

MaintenanceShell.0.3.1 fails, if you use a different language then english
If you click on one of the hyperlink, the specialpage is not found.

e.g. changepassword ....index.php?title=Special:MaintenanceShell&script=changePassword <-- works ....index.php?title=Special:Wartungs-Shell&script=changePassword <-- doesnt work ^^^^^^^^^^^^^^
 * Can you change line 37 of MaintenanceShell.i18n.php from

'maintshell-pagename'     => 'Special:Wartungs-Shell', to 'maintshell-pagename'     => 'Special:MaintenanceShell',


 * and let me know if it works?--Frantik 00:40, 12 June 2010 (UTC)

Make sure not to copy MaintenanceShell dir to maintenance dir but to extensions dir
This can help avoid PHP Warning and Fatal error, such as in the following example:

Warning: require_once(/home/*somedomain*/public_html/en/w/extensions/MaintenanceShell/MaintenanceShell.php) [function.require-once]: failed to open stream: No such file or directory in /home/*somedomain*/public_html/en/w/LocalSettings.php on line 150

Fatal error: require_once [function.require]: Failed opening required '/home/*somedomain*/public_html/en/w/extensions/MaintenanceShell/MaintenanceShell.php' (include_path='/home/*somedomain*/public_html/en/w: /home/*somedomain*/public_html/en/w/includes: /home/*somedomain*/public_html/en/w/languages: .: /usr/lib/php:/usr/local/lib/php') in /home/*somedomain*/public_html/en/w/LocalSettings.php on line 150

This may be of some help for someone, who install extensions for the first time. 8-) ProSvet 15:48, 13 June 2010 (UTC)

last dump
Nothing works with mediawiki's last dump. For all versions, there is only a blank page.
 * what version of MW is the "last dump" ? I'm not planning on addressing 1.16 until it is out of beta.  Apparently in 1.16 there is a safer way to call maintenance scripts so it may require a total rewrite anyways.  --Frantik 11:02, 24 June 2010 (UTC)

1.16
I am not encountering any errors, but attempting to run any script results in a blank result (nothing happens). This is 1.16b3 and 0.3.1. Thorncrag 20:59, 13 July 2010 (UTC)