Project:Support desk

From MediaWiki.org
(Redirected from Support Desk)
Jump to: navigation, search
vde   This page is for questions relating to the MediaWiki software.

Welcome to MediaWiki.org's Support desk, the central on-wiki place to ask MediaWiki questions!

The greater purpose of this page is to make our Manual and other available help so good that you do not have to come here to ask questions, or making them easier to find.

There are other ways for of communication as well (IRC, mailing lists etc.). Read more here.

Before you post

Post a new question

  1. To help us answer your questions, please always indicate which versions you are using:
    • MediaWiki (reported by your wiki's Special:Version page)
    • PHP (likewise)
    • Database (likewise, e.g. MySQL 5.5)
  2. Please include the URL of your wiki unless you absolutely can't. It's often a lot easier for us to identify the source of the problem if we can look for ourselves.
  3. To start a new thread, click "Start a new discussion".

Archiving topics

Topics are automatically archived when they have been inactive for three weeks. If a question you have asked is approaching this limit and still has not been answered, please 'bump' it to prevent it being archived. However do not 'bump' for other reasons.

First page
First page
Previous page
Previous page
Last page
Last page

How to upgrade my viki?

Hi there.

I am use Mediawiki 1.8.4. I want to use MobileFrontend extension but this extension requires minimum 1.9 version. How i easily upgrade my wiki? Please detailed information. I am not experienced SSH usage. Thank you!

85.104.144.15321:23, 29 July 2014

Hi!

Upgrading MediaWiki usually is not hard. :-) However, especially when you are not experienced in these things, please make absolutely sure that you have a working backup of your site (files and database)!

Amongst other things it will be important that you check, which PHP and MySQL version you use and which are available on your server - the MediaWiki version you can use depends on the PHP and MySQL versions you have.

The rest is explained on the page Upgrade, which we wrote in the hope that it is also understandable for non-tech people. :-)

If you have any questions, you can ask here!

88.130.91.3922:00, 29 July 2014

There is any method for upgrade on FTP? I dont know SSH usage.

85.104.144.15322:46, 29 July 2014
 

I am just want to upgrade 1.8.4 to 1.9.

85.104.144.15322:48, 29 July 2014

Yes, there is: For extracting the tarball locally see Upgrade#FTP_or_graphical and for the database update see Upgrade#Web_browser!

You find the tarballs in the folders at http://releases.wikimedia.org/mediawiki/. Please note that MediaWiki 1.9 is already really, really old. It has known security holes and it is no longer supported. There will be no updates and also no security fixes for it! If at all possible, you should upgrade to a current version. These are MediaWiki 1.19, which has Long Term Support, and MediaWiki 1.23, which is the newest available.

88.130.91.3923:03, 29 July 2014

OK than i will update my wiki 1.23. Thank you for answers. I will write again. :)

85.104.144.15323:34, 29 July 2014
 

How i do it?

You may need to run the command as sudo if you don't have full write permissions to the wiki install directories under your current user. When untarring a tarball package normally a new directory for the new wiki version will be created and you will have to copy the old configuration files and images directory from your old installation directory:

$ tar xvzf mediawiki-1.23.1.tar.gz -C /path/to/your/new/installation/ --strip-components=1

85.104.144.15302:34, 30 July 2014

This passage is only relevant, if you do have shell access to the server. In that case, this is the command to extract the tarball.

If like in your case, you do not have shell access, you can extract the tarball on your local PC and then upload the extracted files. Upload will then take some time.

88.130.91.3903:01, 30 July 2014
 
 
 
 
 

Syntax errors after installation when accessing the mainpage. Database: Oracle

I've been trying to find answers to this bug but I'm simply not getting anywhere. I'm using an oracle backend and it installs correctly. But the minute I access index.php it gives me the following error (This is after enabling sqlerrors in my LocalSettings.php file)

A database query error has occurred. This may indicate a bug in the software.

Query: INSERT INTO /*Q*/L10N_CACHE (lc_lang,lc_key,lc_value) VALUES (:lc_lang, :lc_key, ) Function: DatabaseOracle::insertOneRow Error: 936 ORA-00936: missing expression

I ran the update.php in the maintenance folder and it updated fine.

These are the results which I get when I run eval.php and the following commands: var_dump( $wgContLang ); var_dump( Language::factory( 'da' ) );

object(Language)#7 (14) {

 ["mConverter"]=>
 object(FakeConverter)#8 (1) {
   ["mLang"]=>
   *RECURSION*
 }
 ["mVariants"]=>
 NULL
 ["mCode"]=>
 string(2) "en"
 ["mLoaded"]=>
 bool(false)
 ["mMagicExtensions"]=>
 array(0) {
 }
 ["mMagicHookDone"]=>
 bool(false)
 ["mHtmlCode":"Language":private]=>
 NULL
 ["mParentLanguage":"Language":private]=>
 bool(false)
 ["dateFormatStrings"]=>
 array(0) {
 }
 ["mExtendedSpecialPageAliases"]=>
 NULL
 ["namespaceNames":protected]=>
 NULL
 ["mNamespaceIds":protected]=>
 NULL
 ["namespaceAliases":protected]=>
 NULL
 ["transformData"]=>
 array(0) {
 }

}

PHP Warning: strpos() expects parameter 1 to be string, object given in /var/www/html/devinsample/mediawiki-1.23.1/includes/db/DatabaseOracle.php on line 1308 PHP Warning: strpos() expects parameter 1 to be string, object given in /var/www/html/devinsample/mediawiki-1.23.1/includes/db/DatabaseOracle.php on line 1304 PHP Warning: substr() expects parameter 1 to be string, object given in /var/www/html/devinsample/mediawiki-1.23.1/includes/db/DatabaseOracle.php on line 1304 Caught exception DBQueryError: A database error has occurred. Did you forget to run maintenance/update.php after upgrading? See: https://www.mediawiki.org/wiki/Manual:Upgrading#Run_the_update_script Query: INSERT INTO /*Q*/L10N_CACHE (lc_lang,lc_key,lc_value) VALUES (:lc_lang, :lc_key, ) Function: DatabaseOracle::insertOneRow Error: 936 ORA-00936: missing expression

  1. 0 /var/www/html/devinsample/mediawiki-1.23.1/includes/db/DatabaseOracle.php(709): DatabaseOracle->reportQueryError('ORA-00936: miss...', 936, 'INSERT INTO /*Q...', 'DatabaseOracle:...')
  2. 1 /var/www/html/devinsample/mediawiki-1.23.1/includes/db/DatabaseOracle.php(576): DatabaseOracle->insertOneRow('l10n_cache', Array, 'LCStoreDB::set')
  3. 2 /var/www/html/devinsample/mediawiki-1.23.1/includes/cache/LocalisationCache.php(1229): DatabaseOracle->insert('l10n_cache', Array, 'LCStoreDB::set')
  4. 3 /var/www/html/devinsample/mediawiki-1.23.1/includes/cache/LocalisationCache.php(963): LCStoreDB->set('messages:nov', 'nov')
  5. 4 /var/www/html/devinsample/mediawiki-1.23.1/includes/cache/LocalisationCache.php(452): LocalisationCache->recache('da')
  6. 5 /var/www/html/devinsample/mediawiki-1.23.1/includes/cache/LocalisationCache.php(326): LocalisationCache->initLanguage('da')
  7. 6 /var/www/html/devinsample/mediawiki-1.23.1/includes/cache/LocalisationCache.php(260): LocalisationCache->loadItem('da', 'fallback')
  8. 7 /var/www/html/devinsample/mediawiki-1.23.1/languages/Language.php(4146): LocalisationCache->getItem('da', 'fallback')
  9. 8 /var/www/html/devinsample/mediawiki-1.23.1/languages/Language.php(237): Language::getFallbacksFor('da')
  10. 9 /var/www/html/devinsample/mediawiki-1.23.1/languages/Language.php(196): Language::newFromCode('da')
  11. 10 /var/www/html/devinsample/mediawiki-1.23.1/maintenance/eval.php(81) : eval()'d code(1): Language::factory('da')
  12. 11 /var/www/html/devinsample/mediawiki-1.23.1/maintenance/eval.php(81): eval()
  13. 12 {main}


And finally these are my error logs

[Tue Jul 29 22:55:08 2014] [error] [client 10.168.54.77] PHP Warning: strpos() expects parameter 1 to be string, object given in /var/www/html/devinsample/mediawiki-1.23.1/includes/db/DatabaseOracle.php on line 1308 [Tue Jul 29 22:55:08 2014] [error] [client 10.168.54.77] PHP Warning: strpos() expects parameter 1 to be string, object given in /var/www/html/devinsample/mediawiki-1.23.1/includes/db/DatabaseOracle.php on line 1304 [Tue Jul 29 22:55:08 2014] [error] [client 10.168.54.77] PHP Warning: substr() expects parameter 1 to be string, object given in /var/www/html/devinsample/mediawiki-1.23.1/includes/db/DatabaseOracle.php on line 1304 [Tue Jul 29 22:55:08 2014] [error] [client 10.168.54.77] PHP Warning: strpos() expects parameter 1 to be string, object given in /var/www/html/devinsample/mediawiki-1.23.1/includes/db/DatabaseOracle.php on line 1308 [Tue Jul 29 22:55:08 2014] [error] [client 10.168.54.77] PHP Warning: strpos() expects parameter 1 to be string, object given in /var/www/html/devinsample/mediawiki-1.23.1/includes/db/DatabaseOracle.php on line 1304 [Tue Jul 29 22:55:08 2014] [error] [client 10.168.54.77] PHP Warning: substr() expects parameter 1 to be string, object given in /var/www/html/devinsample/mediawiki-1.23.1/includes/db/DatabaseOracle.php on line 1304 [Tue Jul 29 22:55:08 2014] [error] [client 10.168.54.77] PHP Warning: strpos() expects parameter 1 to be string, object given in /var/www/html/devinsample/mediawiki-1.23.1/includes/db/DatabaseOracle.php on line 1308 [Tue Jul 29 22:55:08 2014] [error] [client 10.168.54.77] PHP Warning: strpos() expects parameter 1 to be string, object given in /var/www/html/devinsample/mediawiki-1.23.1/includes/db/DatabaseOracle.php on line 1304 [Tue Jul 29 22:55:08 2014] [error] [client 10.168.54.77] PHP Warning: substr() expects parameter 1 to be string, object given in /var/www/html/devinsample/mediawiki-1.23.1/includes/db/DatabaseOracle.php on line 1304


Could anyone please help me with starting MediaWiki using this very same Oracle backend as I can't use mySQL? Or are these just bugs in the software which might take time to fix? There was a post pretty similar to mine but even though its tagged resolved but it isn't... http://www.mediawiki.org/wiki/Thread:Project:Support_desk/Fatal_Error_after_installation/reply_(5)

Arjun r (talk)23:06, 29 July 2014

How do I change the logo hover/tooltip text "Visit the main page"

I am redirecting back to the home page of my wesbite and need to know how to change the default hover or tooltip text.

Thank you in advanced :)

Mpjbay (talk)06:18, 28 July 2014

Did you search the content of the files for the string shown in the tooltip text already?

AKlapper (WMF) (talk)09:09, 28 July 2014

This is the text, which is shown when you hover your wiki's logo and this text is coming from the page MediaWiki:Tooltip-p-logo. Change this page to change the text!

88.130.76.19809:29, 28 July 2014

Perfect thank you. I am still learning how everything works.

Mpjbay (talk)18:15, 28 July 2014

The trick with interface texts like this one is to open a page of the wiki with &uselang=qqx appended to the URL. Then you will see all the label names, which themselves correspond to the same page in the MediaWiki namespace.

88.130.96.17521:04, 28 July 2014

Very handy trick. Thank you!

Mpjbay (talk)02:48, 29 July 2014
 
 
 
 
 

{{!}} no longer works

Edited by another user.
Last edit: 08:27, 6 July 2014

Hello,

till now I use a template ! → Help:Magic_words#Other

I use Mediawiki 1.23.1 and this template no langer works. But I don't like to wait for 1.24.



for == [[1st word {{!}} 2nd word]] == was
the result in the past (right) == [[1st word|2nd word]] ==


the result now (wrong)
== [[1st word|2nd word]] ==


What can I do for the correct result?


best regards

s.net08:04, 6 July 2014

Hi! I see now change from past and now?! For now (with 1.23) you need a template to reach this, see for example this:

https://en.wikipedia.org/wiki/Template:!

Florianschmidtwelzow (talk)14:37, 6 July 2014

Hi Flo,
someone hero has changed my first post. Please take a look into the history so you can see the different.

Best regards

s.net15:05, 6 July 2014

There isn't a difference, sorry. The "hero" has only fixed the markup ;)

See:

https://www.mediawiki.org/w/index.php?title=Thread%3AProject%3ASupport_desk%2F_no_longer_works&diff=1059719&oldid=1059713

Or what you mean?

Florianschmidtwelzow (talk)15:17, 6 July 2014

because the fix delete the difference. (weil durch das verändern des quellcodes der unterschied eliminiert wurde.)

https://www.mediawiki.org/w/index.php?title=Thread:Project:Support_desk/_no_longer_works&oldid=1059713

there can you see the old situation (a heading) and the new situation (a link with "==" as prefix and suffix) (alte variante führte zu einer überschrift und nun nach dem update hat man einen link, der von je 2 = eingebettet ist)

mediawiki doesn't create now a heading


best regards

s.net20:52, 29 July 2014
 
 
 

Works for me

Ciencia Al Poder (talk)17:44, 6 July 2014
 

Easy way to add media (photos, audio, video) when creating an article?

I have searched the extensions and have not found an easy way for users to add a photo or other media and files to articles.

Does anyone know a way to accomplish this? Is there an extension I have not found?

Thank you!

Mpjbay (talk)18:19, 28 July 2014

No need for a seperate extensions; file uploads are supported by MediaWiki itself. What do you want that isn't offered by the default MediaWiki file uploads?

DaSt1986 (talk)20:17, 29 July 2014
 

Page error

Good morning.

My page is wiki.westeros.pl

I don't know but now it is not working. There is some error. Could somebody help me?

Thank You

TraaBBIT (talk)18:19, 28 July 2014

When like in your case you get several errors, always solve the first one first.

In your case that is

> Warning: include_once(../wiki_settings.php) [function.include-once]: failed to open stream: No such file or directory in /home/trouse/domains/westeros.pl/public_html/wiki/LocalSettings.php on line 17

In LocalSettings.php on line 17 you are trying to include a file, which is not there. Either fix the include patch or move/rename the file accordingly (or do both)!

88.130.96.17521:07, 28 July 2014
 

Looks like your MediaWiki isn't installed correctly, is missing some files, or you are including files in the wrong directory. How did you install the MediaWiki and what version?

DaSt1986 (talk)20:16, 29 July 2014
 

Add svg to permited files

please add svg to permited type of file allowed to upload please. I get this error

Permitted file types: png, gif, jpg, jpeg, ogg, ogv, oga, flac, wav, webm.

151.225.137.14515:38, 29 July 2014

See Manual:Configuring_file_uploads#Configuring_file_types and Manual:$wgFileExtensions. In short: Add

$wgFileExtensions[] = 'svg';

to LocalSettings.php.

88.130.91.3916:56, 29 July 2014

Thanks but could they add it to the default settings please.

86.173.54.17418:44, 29 July 2014

You can add it by yourself :) Just register a developer access account:

https://www.mediawiki.org/wiki/Developer_access

But please explain in detail, what's the value of adding svg to defaultsettings :)

If you don't want to do that, you can enter a bug as feature request, too: Bugzilla

Florianschmidtwelzow (talk)20:11, 29 July 2014
 
 
 

Help with skin

Hi how can I add options in skin that allows me to lets the user choose the default logo or use there own because I doint know how to add options in skins.

86.173.55.16418:22, 27 July 2014

Skins should only get options, saved for the user, not set some. In your skin template you can use $this->getUser()->getOption() to get an Option (e.g. "skin" to get the skin name).

With an Extension you can add Useroptions to save some values you want.

Florianschmidtwelzow (talk)05:30, 28 July 2014

Ok. How do I add options like they are in default setting.php but just for the skin.

86.173.55.16409:27, 28 July 2014

Hello,

not in DefaultSettings.php :) You need to create a new extension, which handles this. It can add options to a User with $user->setOption() and the skin can (while initialisation) read this values with $user->getOption(). The functions (and all other) is documented here:

https://doc.wikimedia.org/mediawiki-core/master/php/html/classUser.html#

How you can develop an Extension, you can read here:

https://www.mediawiki.org/wiki/Manual:Developing_extensions

Florianschmidtwelzow (talk)12:21, 28 July 2014

Ok but I thought you can create options in the skin without needing to add them to an extension or in the core of Mediawiki.

151.225.137.14511:47, 29 July 2014

It's possible, too, but i would suggest to do not add too much funtionality into a skin. If you want to set the options with cookies, for example, you can use the WebRequest class.

Florianschmidtwelzow (talk)12:41, 29 July 2014
 
 
 
 
 

Jobs won't run, templates not updating.

My wiki is not running jobs by itself - they collect but I have to run runJobs.php to complete them. And even after completing them, a template does not update.

Also, I've had five jobs which haven't completed for months now. see this graph: https://wikiapiary.com/wiki/Coasterpedia

This is really annoying me now, any help is greatly appreciated. This is the job count: http://coasterpedia.net/w/api.php?action=query&meta=siteinfo&siprop=statistics&format=jsonfm

86.148.146.5615:16, 28 July 2014
Edited by author.
Last edit: 09:56, 29 July 2014

Hi!

The issue that jobs generally do not run automatically was a problem in MediaWiki 1.22. It should have been solved in MediaWiki 1.23 (which you are running currently).

That a certain job does just not do anything at all can happen sometimes. Reasons for this may vary, e.g. the page, which should be indexed by the job may have been deleted in the meantime or another job already did, what this job is about to do. In this case it is save to go to the database table jobs and to manually delete the according rows.

88.130.96.17516:01, 28 July 2014

Look at Manual:Job queue, specially look if you have set $wgJobRunRate to 0 or something.

Ciencia Al Poder (talk)09:42, 29 July 2014

Thanks for the replies! I will take a look at the database - Unfortunately I can't get into it at the moment.

The template not updating was down to my own stupidity - I was editing the wrong section of the page!

The jobs however are still not running. I have specifically set the JobRunRate to 1.

95.144.138.23318:50, 29 July 2014
 
 
 

How to create a bot to add a new section in a talk page?

Hi there,

We are a group of researchers, trying to find a practical way to motivate professors and researchers who have published a fair number of research papers, to review Wikipedia pages and improve them.

As they do not usually have enough time to edit Wikipedia pages, we are trying to ask their comments on related pages, and post those comments to the corresponding talk pages, which can potentially help active Wikipedians on those pages to take advantage of experts' feedbacks and apply them as they like to the main article.

To this end, we need to implement a bot which posts new sections on Talk pages.

As a matter of efficiency, we prefer to use python HTTP POST requests using MediaWiki API rather than available MediaWiki libraries.

We have not requested for an approval for the bot, and we are just trying to implement a trial version to test the bot on our own Talk pages.

For this purpose, I went through the following steps:

1- As discussed at https://en.wikipedia.org/wiki/Wikipedia:Creating_a_bot: >Create an account for your bot. Click here when logged in to create the account, linking it to yours. (If you do not create the bot account while logged in, it is likely to be blocked as a possible sockpuppet or unauthorised bot until you verify ownership)

>Create a user page for your bot. Your bot's edits must not be made under your own account. Your bot will need its own account with its own username and password.

So, I logged in to my own Wikipedia account, and created a new account (for the bot).

2- As discussed at https://www.mediawiki.org/wiki/API:Login: Logging in through the API requires two requests. For the first request, I wrote the following code in python:

   def logInRequestToWikipedia():
   
       # Add required parameters to the request.
       request = { 'action' : 'login' }
       request['lgname'] = 'BotName'
       request['lgpassword'] = '*************'
   
       url = 'https://en.wikipedia.org/w/api.php'
   
       headers = { 'content-type' : 'application/x-www-form-urlencoded' }
   
       r = requests.post(url, data = json.dumps(request), headers=headers)

The response starts with an error as follows:

   <error code="help" info="" xml:space="preserve">

And continues with the API documentation.

3- As discussed at https://www.mediawiki.org/wiki/API:Edit_-_Create%26Edit_pages:

>Note: In this example, all parameters are passed in a GET request just for the sake of simplicity. However, action=edit requires POST requests; GET requests will cause an error. Do not forget to set the Content-Type header of your request to application/x-www-form-urlencoded. The token that you received is terminated with +\\, this needs to be urlencoded (so it will end with %2B%5C) before it is passed back.

I added each of the following parameters separately and both together in the request data and tried all three cases, but it returns the same response.

   request['lgtoken'] = '%2B%5C'
   request['Content-Type'] = 'application/x-www-form-urlencoded'

4- Also I tried each of the followings in my request data, but it returns the same response:

   request['format'] = 'json'
   request['format'] = 'xml'

Do you think the problem can be related to the fact that we have not requested for an approval for the bot yet? Because we are just trying to implement a trial version to test the bot on our own Talk pages, and apply for the approval after making sure everything will work.

I will appreciate it if you help us with this issue.

Best regards.

PostOnTalk (talk)17:01, 29 July 2014

Can't delete image uploads. "Error deleting file: Could not create directory 'mwstore://local-backend/local-deleted/a/x/b'."

Edited by author.
Last edit: 16:02, 29 July 2014

Product Version
MediaWiki 1.23.1
PHP 5.5.9-1ubuntu4.3 (apache2handler)
MySQL 5.5.38-0ubuntu0.14.04.1

Ubuntu Server is running on a Virtual Machine. My /var/www/html/mediawiki/images directory is mounted to my storage drive as the boot drive is only for the OS. The Wiki is private.

LocalSettings.php does not have $wgUploadDirectory or $wgUploadPath set, so those are the default. $wgDeletedDirectory is a mount on another file server which has the same permissions as the images directory. 755 & www-data as both owner & group.

Directory: /var/www/html/mediawiki/images (mounted to a different drive than the rest of /var/www/html/mediawiki) /mnt/fileserver/deletedwikifiles

php.ini has file_uploads set to on and my version means that safe_mode isn't the issue. I read about a bug regarding upgrading MediaWiki from 1.22 to 1.23 causing file uploads to be broken, but that was traced back to shared hosts and this server isn't shared.

Any help is appreciated.

Edit:

I just thought I'd bump this with a bit more technical information. I couldn't delete files, but I could upload them. Then I did the following commands from the root of MediaWiki:

sudo chmod 775 -R ./ [Entire MediaWiki Root has rwxrwxr-x permission set.]
sudo chmod 666 -R ./images [images * subdirectories has rw-rw-rw- permission set.]
sudo chmod 775 ./images [The directory images has rwxrwxr-x permission set.]
sudo chown root:www-data -R ./ [This means Root has full rwx for everything but files in images where it has rw- only while apache web group has rw- for images, but not the directory, and rwx for the rest of MediaWiki's root.]

Then I could delete the files, but when I tried to upload them, I got this error: 'Could not create directory "mwstore://local-backend/local-public/b/b9".' and the thumbnails were broken.

Then I did this command from the same root directory of MediaWiki:

sudo chmod 777 -R ./ [Everything has all the permission for MediaWiki's root directory.]

And once again, I can upload files, and see thumbnails/files, but I can't delete them again, getting 'Error deleting file: Could not create directory "mwstore://local-backend/local-deleted/8/d/b".' when I try.

I'm baffled as to how to troubleshoot what appears to be a permissions problem in this situation after those results.

TremorAcePV (talk)16:39, 28 July 2014

Can you check if the directory specified in Manual:$wgDeletedDirectory exist and is writeable from the webserver?

Florianschmidtwelzow (talk)08:52, 29 July 2014

I figured you might be on to something there because I did the following:

ls -la /mnt/fileserver/deletedwikifiles
drwxrwxrwx  4 root root 4096 Jul 29 10:09 .
drwxrwxrwx  4 root root 4096 Jul 29 10:09 public
drwxrwxrwx  4 root root 4096 Jul 29 10:09 private

So I checked and I hadn't configured /etc/fstab to mount the drive such that www-data is owner/group because it's on an NTFS volume (which means it makes root owner/user by default). I tried redefining $wgDeletedDirectory = $wgScriptPath/images/deleted as a test.

ls -la ./images/deleted

drwxrwxrwx  4 www-data www-data 4096 Jul 29 10:09 .
drwxr-xr-x 14 www-data www-data 4096 Jul 29 09:39 ..
drwxrwxrwx  2 www-data www-data 4096 Jul 29 10:08 private
drwxrwxrwx  2 www-data www-data 4096 Jul 29 10:09 public

Yet it still gives the "Creating directory" error when trying to delete a file. I tried changing the above permissions to 755 (rwxr-xr-x), just like it is for the rest of ./images, but that didn't fix it either.

TremorAcePV (talk)15:28, 29 July 2014
 

Note that this command will render your image folders inaccessible:

sudo chmod 666 -R ./images [images * subdirectories has rw-rw-rw- permission set.]

Directories need the execute permission set to be accessible.

Setting 777 for uploaded files is also not recommended.

The recommended way to set such permissions is to use the find command:

find ./images -type d -exec chmod 755 {} \;
find ./images -type f -exec chmod 644 {} \;

Depending on who's the owner of those files, permissions may vary from 777/666 for debugging or even 700/600 for strict permissions on shared hosts.

Ciencia Al Poder (talk)09:48, 29 July 2014

That's good to know.

Of course. That was a test to see if I could access them correctly. A test to see if permissions is the problem.

With these permissions, set exactly how you have them written there, I cannot upload or delete files. That's the first time this result has happened. I get both errors:

Could not create directory "mwstore://local-backend/local-public/2/26".
Error deleting file: Could not create directory "mwstore://local-backend/local-deleted/8/d/b".

I figured it might be because I had done this before that:

sudo chown root:www-data ./images

So I tried changing it to this:

sudo chown www-data:www-data ./images

And that let me upload files. Found the culprit there.

Check my response to Florianschmidtwelzow above if you want to know about the deleting files error.

TremorAcePV (talk)15:15, 29 July 2014
 
 

database is suffering from InnoDB corruption, specifically in the mw_objectcache table.

Edited by another user.
Last edit: 09:33, 28 July 2014

I've been having some MySQL issues, and it appears to be stemming from the mediawiki db. Below the message I received from my server support, thoughts? The mediawiki db is patjk_wikidb.


I've checked for CREATE DATABASE statements for each of the affected databases:

root@host [~/support/462326]# zcat databases_with_innodb.sql.gz | grep 'CREATE DATABASE'
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `horde` /*!40100 DEFAULT CHARACTER SET latin1 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `patjk_gallery2` /*!40100 DEFAULT CHARACTER SET latin1 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `patjk_magen` /*!40100 DEFAULT CHARACTER SET latin1 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `patjk_vbdb` /*!40100 DEFAULT CHARACTER SET latin1 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `patjk_wikidb` /*!40100 DEFAULT CHARACTER SET latin1 */;

Unfortunately, it looks like the roundcube database is not present, and the patjk_wikidb is likely to be truncated. Here are the errors that occurred:

root@host [~/support/462326]# cat mysqldump_error.log 
Warning: option 'max_allowed_packet': unsigned value 1331691520000 adjusted to 2147483648
mysqldump: Error 2013: Lost connection to MySQL server during query when dumping table `mw_objectcache` at row: 1697279

According to MySQL's internal uptime clock the database was started roughly 48 minutes ago, which was just before I noticed that the dump was no longer running:

| Uptime | 2915 |

Here are the MySQL error log messages that coincided with the apparent failure:

2014-07-27 05:30:43 29972 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.6.16' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
2014-07-27 06:46:57 76670b90 InnoDB: Assertion failure in thread 1986464656 in file btr0pcur.cc line 432
InnoDB: Failing assertion: btr_page_get_prev(next_page, mtr) == buf_block_get_page_no(btr_pcur_get_block(cursor))
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
10:46:57 UTC - mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed, 
something is definitely wrong and this may fail.

key_buffer_size=134217728
read_buffer_size=10485760
max_used_connections=151
max_threads=150
thread_count=151
connection_count=150
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 1975685 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x77452f00
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 76670358 thread_stack 0x30000
/usr/sbin/mysqld(my_print_stacktrace+0x33)[0x856d843]
/usr/sbin/mysqld(handle_fatal_signal+0x43e)[0x82897ee]
/lib/libpthread.so.0[0xb7f740f8]
/lib/ld-linux.so.2[0xb7f8b7f2]
/lib/libc.so.6(gsignal+0x50)[0xb7cd0e30]
/lib/libc.so.6(abort+0x101)[0xb7cd2741]
/usr/sbin/mysqld[0x8709605]
/usr/sbin/mysqld[0x869ee49]
/usr/sbin/mysqld[0x85dfa87]
/usr/sbin/mysqld[0x85dfd31]
/usr/sbin/mysqld(_ZN7handler11ha_rnd_nextEPh+0x75)[0x81987f5]
/usr/sbin/mysqld(_Z13rr_sequentialP11READ_RECORD+0x49)[0x84860c9]
/usr/sbin/mysqld(_Z10sub_selectP4JOINP13st_join_tableb+0x16a)[0x82f190a]
/usr/sbin/mysqld(_ZN4JOIN4execEv+0x3c6)[0x82ef5d6]
/usr/sbin/mysqld[0x833d58d]
/usr/sbin/mysqld(_Z12mysql_selectP3THDP10TABLE_LISTjR4ListI4ItemEPS4_P10SQL_I_ListI8st_orderESB_S7_yP13select_resultP18st_select_lex_unitP13st_select_lex+0xed)[0x833d92d]
/usr/sbin/mysqld(_Z13handle_selectP3THDP13select_resultm+0x19d)[0x833db8d]
/usr/sbin/mysqld[0x8312a7b]
/usr/sbin/mysqld(_Z21mysql_execute_commandP3THD+0x4cf5)[0x83189f5]
/usr/sbin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_state+0x32d)[0x831da7d]
/usr/sbin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0x191c)[0x831fd8c]
/usr/sbin/mysqld(_Z10do_commandP3THD+0xee)[0x832182e]
/usr/sbin/mysqld(_Z24do_handle_one_connectionP3THD+0x135)[0x82e33c5]
/usr/sbin/mysqld(handle_one_connection+0x4d)[0x82e34ad]
/usr/sbin/mysqld(pfs_spawn_thread+0x179)[0x85b8dc9]
/lib/libpthread.so.0[0xb7f6b912]
/lib/libc.so.6(clone+0x5e)[0xb7d7d7ce]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (b7fed08): SELECT /*!40001 SQL_NO_CACHE */ * FROM `mw_objectcache`
Connection ID (thread ID): 3089
Status: NOT_KILLED

The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
140727 06:46:58 mysqld_safe Number of processes running now: 0
140727 06:46:58 mysqld_safe mysqld restarted
2014-07-27 06:47:00 0 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
2014-07-27 06:47:00 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-07-27 06:47:00 30625 [Note] Plugin 'FEDERATED' is disabled.
2014-07-27 06:47:00 30625 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2014-07-27 06:47:00 30625 [Note] InnoDB: The InnoDB memory heap is disabled
2014-07-27 06:47:00 30625 [Note] InnoDB: Mutexes and rw_locks use InnoDB's own implementation
2014-07-27 06:47:00 30625 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-07-27 06:47:00 30625 [Note] InnoDB: Using Linux native AIO
2014-07-27 06:47:00 30625 [Note] InnoDB: Not using CPU crc32 instructions
2014-07-27 06:47:00 30625 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2014-07-27 06:47:00 30625 [Note] InnoDB: Completed initialization of buffer pool
2014-07-27 06:47:00 30625 [Note] InnoDB: Highest supported file format is Barracuda.
2014-07-27 06:47:00 30625 [Note] InnoDB: The log sequence numbers 133808751880 and 133808751880 in ibdata files do not match the log sequence number 133810301875 in the ib_logfiles!
2014-07-27 06:47:00 30625 [Note] InnoDB: Database was not shutdown normally!
2014-07-27 06:47:00 30625 [Note] InnoDB: Starting crash recovery.
2014-07-27 06:47:00 30625 [Note] InnoDB: Reading tablespace information from the .ibd files...
2014-07-27 06:47:06 30625 [Note] InnoDB: Restoring possible half-written data pages 
2014-07-27 06:47:06 30625 [Note] InnoDB: from the doublewrite buffer...
InnoDB: Last MySQL binlog file position 0 344931686, file name ./mysql-bin.000030
2014-07-27 06:47:09 30625 [Note] InnoDB: 128 rollback segment(s) are active.
2014-07-27 06:47:09 30625 [Note] InnoDB: Waiting for purge to start
2014-07-27 06:47:09 30625 [Note] InnoDB: 5.6.16 started; log sequence number 133810301875
2014-07-27 06:47:09 30625 [Note] Server hostname (bind-address): '*'; port: 3306
2014-07-27 06:47:09 30625 [Note] IPv6 is available.
2014-07-27 06:47:09 30625 [Note] - '::' resolves to '::';
2014-07-27 06:47:09 30625 [Note] Server socket created on IP: '::'.
2014-07-27 06:47:10 30625 [Note] Event Scheduler: Loaded 0 events
2014-07-27 06:47:10 30625 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.6.16' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)

Based on these symptoms and messages, I believe your patjk_wikidb database is suffering from InnoDB corruption, specifically in the mw_objectcache table.

If this were a MyISAM able, we could probably recover it with mysqlcheck or myisamrepsair. However, mysqlcheck can only repair InnoDB tables by dumping and rebuilding them, which is the same procedure we just attempted, so this is certain to fail as well.

We could attempt to recover the database with the innodb_force_recovery option. However, this is risky. It can cause even worse damage. Additionally, your VPS does not have enough free space to make an up-to-date raw copy of the InnoDB tablespaces before attempting this.

I'm not familiar with the wiki software you are using, so I'm not sure how vital the mw_objectcache table is to its operation, or if it can be replaced or regenerated easily. Discarding this table might be a more viable option if a repair using the gentlest settings of innodb_force_recovery do not succeed.

Another option which you might consider is consulting a developer or DBA with experience recovering InnoDB tables.

I wish I had better news for you. I'm afraid there is not going to be a good way to get rid of this overly large InnoDB tablespace without losing at least some of your patjk_wikidb data. Again, we can attempt innodb_force_recovery if you request it, but this poses the risk of more data loss.

110.171.63.612:27, 27 July 2014

Hi!

First of all this seems not to be a MediaWiki, but a MySQL problem.

A complete MediaWiki DB contains the tables listed on DB.

If you think that your objectcache table is corrupted, you can truncate it any time - MediaWiki will rebuild its contents.

The content of other tables however, cannot be rebuilt that easily: E.g. the content in the tables text, pages and revision is unique and is required for MediaWiki to function properly. Should these tables be corrupted as well, you should use a working backup to restore them (and with them the whole DB).

88.130.76.19813:00, 27 July 2014

Thanks for the info. How do you recommend I proceed with this? I'm not too familiar with this stuff. I'd be willing to hire someone to see if they can resolve this (please email me if interested *pj*kca*rds at gmail dot com [remove *'s]). The ibdata1 file on my server is huge now too, and needs to be cleaned.

110.171.63.609:23, 28 July 2014
Edited by 2 users.
Last edit: 11:10, 29 July 2014

Hi!

You can truncate the objectcache table. This will keep the table structure, but remove all its content thus making this table smaller (close to 0kb). However, MediaWiki should automatically do some kind of garbage collection in that table anyway; if you have a big wiki, this table will (automatically) become big again. And this will not solve the following problem:

Try to create a full backup of all the databases in your MySQL server (using the mysqldump tool), but with the error message you get, I don't know, if using mysqldump is still possible.

As far as I know the InnoDB ibdata1 file will never shrink and there also is no easy way to make it smaller again. A force recovery can give you a chance to get to your data. Be patient and use the lowest value possible to get the server started so you can make a backup of as much data as possible.

Another question: Do you have a current backup of the database? If so, that would make things way easier! Is it only your stuff in this MySQL server or is it a shared MySQL server? If it's only your stuff on the server, you could try the following:

If you have a backup, then stop MySQL and remove all the databases, ib_logfile* and ibdata* files. When you start MySQL again it will create a new fresh shared tablespace. This table space will then not be corrupted, hopefully solving your initial issue. Then, import your database dump again.

If there are any underlying hardware issues, those need to be addressed first.

88.130.76.19811:29, 28 July 2014
 
 
 

[RESOLVED] Auto suggest not working

I've installed several Wikis and never had a problem with Auto Suggest in the search box. It's not working on my current wiki. I've tried suggestions found elsewhere using the different variables to no avail:

$wgUseAjax;
$wgEnableMWSuggest;
$wgVectorUseSimpleSearch;

This stuff always works; what could be different about this wiki?

MediaWiki  1.19.13
PHP     5.2.17 (cgi-fcgi)
MySQL   5.1.73-cll
URL: https://neucart.com/wiki/Main_Page
Timneu22 (talk)13:52, 27 July 2014

Maybe the problem is that the wiki requires login? When I am not allowed to see the pages, it's only logical that I also may not get them displayed in the search results.

88.130.76.19814:10, 27 July 2014

I can disable that but the issue persists. (I just disabled.)

I've used all the same permissions schemes on other wikis and Auto Suggest had no problems.

Timneu22 (talk)14:26, 27 July 2014

Hi why not try to update php to 5.3 or higher and then upgrade to latest mediawiki version which is 1.23.1 and see if that fixes the issue because if the results is not showing it could mean javascript not working properly.

86.173.55.16415:22, 27 July 2014

I am stuck on 1.19 because of the PHP version. That's a non-starter.

Timneu22 (talk)16:36, 27 July 2014

Ah, it looks like the issue is that some PHP 5.3 code is in this version.

                $text = preg_replace_callback( '#<a .*?</a>#', function ( $matches ) use ( &$masked ) {
                        $sha = sha1( $matches[0] );
                        $masked[$sha] = $matches[0];
                        return "<$sha>";
                }, $text );
PHP Parse error:  syntax error, unexpected T_FUNCTION in {path}/wiki/includes/api/ApiFormatBase.php on line 279

How can I rewrite this for my PHP version? "use" is 5.3-specific.

Timneu22 (talk)16:53, 27 July 2014
 
 
 
 
$wgUseAjax;
$wgEnableMWSuggest;
$wgVectorUseSimpleSearch;

Is that really exactly what you have in your LocalSettings.php? If yes, then try the following:

$wgUseAjax = true;
$wgEnableMWSuggest = true;
$wgVectorUseSimpleSearch = true;
Florianschmidtwelzow (talk)05:32, 28 July 2014
 

[RESOLVED] File uploads aren't working correctly. Image not found after upload.

My Wiki is private, otherwise I'd link it. I'm using ImageMagick. It's version 6.7.7 installed via "sudo apt-get install mediawiki" yesterday.

Product Version
MediaWiki 1.23.1
PHP 5.5.9-1ubuntu4.3 (apache2handler)
MySQL 5.5.38-0ubuntu0.14.04.1

Error I see in thumbnail for newly uploaded file:

Error creating thumbnail: /bin/bash: /w/extensions/ImageMagick: No such file or directory
Error code: 127

When I click the file, it says "Not found". The directory has 775 permissions and is owned by www-data. I'm not sure what the issue is. :/ Google and other people's solutions haven't helped.

TremorAcePV (talk)17:02, 25 July 2014

Are you sure, that ImageMagick is installed in extensions folder? Please notice, that the install of MediaWiki using apt isn't supported at all.

Florianschmidtwelzow (talk)14:39, 26 July 2014

Thank you for the reply.

I installed MediaWiki by downloading the .tar.gz from the download page here. It's ImageMagick that is getting to me as it's a bit more complicated to compile and such.

I uninstalled ImageMagick via "sudo apt-get remove ImageMagick" and manually compiled it within /var/www/html/w/extensions/ImageMagick.

I am still having the "Not found" issue as well as thumbnails being broken. That'd be ImageMagick 6.8.9, the latest version.

I am guessing that it is user error because when I remove $wgUploadDirectory & $wgUploadPath from LocalSettings.php, uploading files works almost entirely fine.

If I change $wgUploadDirectory & $wgUploadPath, this is what causes it to break. I suppose my issue is somewhat resolved, but I'd like to figure out why it was failing.

I was trying $wgUploadDirectory = "$IP/images/public";. Path was the same. Then I tried "$wgScriptPath/images/public", but both produced this error on top of "Error deleting file" or "Error creating directory". Permissions never changed though.

Anyway, I'm going to make a new ticket because now the issue is different. "Error deleting file: Could not create directory "mwstore://local-backend/local-deleted/t/l/p"

TremorAcePV (talk)14:04, 28 July 2014
 
 

Upload File not working with Oracle

After we try to upload an image, mediawiki says that the image doesn't exists (Spanish message: "No existe ningún archivo con este nombre, pero puedes subirlo. "), but we can find the file in the server file system.

The file list special page, does not shows any results. The IMAGE table is empty. The UPLOADSTASH table has several rows like this:

62 1 12gj3imwf6ns.ik9b4y.1.png /tmp/localcopy_c7c5f0e99b18-1.png mwrepo://local/temp/5/59/20140723151607!localcopy_c7c5f0e99b18-1.png file 23/07/2014 03:16:07,000000000 PM -03:00 finished 10424 80i9wcke3o13ipvgr1hhgctj3ilflxk image/png BITMAP 687 327 8 (BLOB)

Another info MediaWiki 1.22.3 PHP 5.3.2-1ubuntu4.23 (apache2handler) Oracle 11.2.0.3.0

200.49.85.19515:47, 23 July 2014

The message you get is MediaWiki:filepage-nofile-link: No file by this name exists, but you can [$1 upload it].

Well, if the image table is empty, then the error is correct: Your MediaWiki installation doesn't have any file uploaded yet.

The Manual:uploadstash table is a temporary table to track unfinished uploads (those uploads that threw a warning to the user, so they're still on hold).

Try uploading the file again, and if it fails, you should post here what error message are you getting on upload.

Ciencia Al Poder (talk)17:23, 23 July 2014

I've tried to upload the file several times (also different files), no error message after that, just the message "No file by this name exists, but you can [$1 upload it].".
As I said, I can find the file in the file system (i.e images/2/22/Screenshot_merge.png), so the file gets uploaded after all, but mediawiki has not register of that happening.
In apache error.log I can see somthing like:

[Wed Jul 23 12:35:37 2014] [error] [client 192.168.215.31] PHP Warning:  strpos() expects parameter 1 to be string, object given in /var/www/mediawiki/includes/db/DatabaseOracle.php on line 1146, referer: http://192.168.215.204/mediawiki/index.php?title=Especial:SubirArchivo&wpDestFile=Screenshot_merge.png
[Wed Jul 23 12:35:37 2014] [error] [client 192.168.215.31] PHP Warning:  strpos() expects parameter 1 to be string, object given in /var/www/mediawiki/includes/db/DatabaseOracle.php on line 1142, referer: http://192.168.215.204/mediawiki/index.php?title=Especial:SubirArchivo&wpDestFile=Screenshot_merge.png
[Wed Jul 23 12:35:37 2014] [error] [client 192.168.215.31] PHP Warning:  substr() expects parameter 1 to be string, object given in /var/www/mediawiki/includes/db/DatabaseOracle.php on line 1142, referer: http://192.168.215.204/mediawiki/index.php?title=Especial:SubirArchivo&wpDestFile=Screenshot_merge.png
[Wed Jul 23 12:35:38 2014] [error] [client 192.168.215.31] PHP Warning:  strpos() expects parameter 1 to be string, object given in /var/www/mediawiki/includes/db/DatabaseOracle.php on line 1146, referer: http://192.168.215.204/mediawiki/index.php?title=Especial:SubirArchivo&wpDestFile=Screenshot_merge.png
[Wed Jul 23 12:35:38 2014] [error] [client 192.168.215.31] PHP Warning:  strpos() expects parameter 1 to be string, object given in /var/www/mediawiki/includes/db/DatabaseOracle.php on line 1142, referer: http://192.168.215.204/mediawiki/index.php?title=Especial:SubirArchivo&wpDestFile=Screenshot_merge.png
[Wed Jul 23 12:35:38 2014] [error] [client 192.168.215.31] PHP Warning:  substr() expects parameter 1 to be string, object given in /var/www/mediawiki/includes/db/DatabaseOracle.php on line 1142, referer: http://192.168.215.204/mediawiki/index.php?title=Especial:SubirArchivo&wpDestFile=Screenshot_merge.png

But I also have errors like this on pages that are working well:

[Mon Jul 21 10:40:52 2014] [error] [client 192.168.215.35] PHP Warning:  strpos() expects parameter 1 to be string, object given in /var/www/mediawiki/in
cludes/db/DatabaseOracle.php on line 1146, referer: http://192.168.215.204/mediawiki/index.php/Servidores_de_Integraci%C3%B3n
[Mon Jul 21 10:40:52 2014] [error] [client 192.168.215.35] PHP Warning:  strpos() expects parameter 1 to be string, object given in /var/www/mediawiki/in
cludes/db/DatabaseOracle.php on line 1142, referer: http://192.168.215.204/mediawiki/index.php/Servidores_de_Integraci%C3%B3n
[Mon Jul 21 10:40:52 2014] [error] [client 192.168.215.35] PHP Warning:  substr() expects parameter 1 to be string, object given in /var/www/mediawiki/in
cludes/db/DatabaseOracle.php on line 1142, referer: http://192.168.215.204/mediawiki/index.php/Servidores_de_Integraci%C3%B3n
[Mon Jul 21 10:40:53 2014] [error] [client 192.168.215.35] PHP Warning:  strpos() expects parameter 1 to be string, object given in /var/www/mediawiki/in
cludes/db/DatabaseOracle.php on line 1146, referer: http://192.168.215.204/mediawiki/index.php/Servidores_de_Integraci%C3%B3n
200.49.85.19519:43, 23 July 2014

I've looked at those lines [1] and I don't see anything wrong there, despite the fact that somewhere an object is being passed to strpos instead of a string. I haven't seen this error before, so maybe you're using some MediaWiki extension that's not compatible with the MediaWiki version you're running? You could try disabling all extensions.

Anyway, 1.22 has released new security updates, so you should upgrade to latest 1.22.x to see if that fixes your issue.

Ciencia Al Poder (talk)09:37, 29 July 2014
 
 
 

Can I edit files without needing to code?

Is it possible to use Mediawiki for a company, where employees can edit MS word and Excel type of pages without ever needing to understand how to code? Like using a full WYSIWYG editor like in MS Word?

Is that possible? OR anyone who wanted to edit pages, add titles etc, they all need to understand some CODING in mediawiki?

Thank you.

Tonywiki (talk)23:37, 28 July 2014

Hello,

in generally it's a very simple wiki language :) With WikiEdtiro you can give your users a very good help to learn the syntax. If this all isn't what you want, then try to use VisualEditor:

https://www.mediawiki.org/wiki/Extension:VisualEditor

An example you can see in each Wikipedia (just click "Edit" instead of "Edit source"). VisualEditor will show you a parsed page which you can edit with th WYSIWYG Editor. The installation takes a little bit more time and read, but it pays ;)

Florianschmidtwelzow (talk)08:30, 29 July 2014
 

How to create a bot to add a new section to a talk page?

Hi there,

We are a group of researchers, trying to find a practical way to motivate professors and researchers who have published a fair number of research papers, to review Wikipedia pages and improve them.

As they do not usually have enough time to edit Wikipedia pages, we are trying to ask their comments on related pages, and post those comments to the corresponding talk pages, which can potentially help active Wikipedians on those pages to take advantage of experts' feedbacks and apply them as they like to the main article.

To this end, we need to implement a bot which posts new sections on Talk pages.

As a matter of efficiency, we prefer to use python hTTP POST requests from our server to Wikipedia server, and we are using MediaWiki API.

We have not requested for an approval for the bot, and we are just trying to implement a trial version.

The problem is with authentication of the bot.

As discussed at https://www.mediawiki.org/wiki/API:Login , logging in through the API requires two requests, but sending the first request returns an error as follows:

<error code="help" info="" xml:space="preserve">

And there is no token to use in the second request.

Our login function in python is as follows:

def logInRequestToWikipedia():

   # Add required parameters to the request.
   request = { 'action' : 'login' }
   request['format'] = 'json'
   request['lgname'] = 'PostOnTalk'
   request['lgpassword'] = '*************'
   request['lgtoken'] = '%2B%5C'
   url = 'https://en.wikipedia.org/w/api.php'
   headers = { 'User-Agent' : 'MyCoolTool/1.1 (http://example.com/MyCoolTool/; MyCoolTool@example.com) BasedOnSuperLib/1.4' }
   headers['content-type'] = 'application/x-www-form-urlencoded'
   r = requests.post(url, data = json.dumps(request), headers=headers)

We will appreciate it if you help us with this issue.

Best regards.

PostOnTalk (talk)22:46, 28 July 2014

$wgMaxImageArea using GD results in WSOD

Sorry. Forgot the following.

Mediawiki 1.23.1 PHP 5.3.24 MySQL 5.1.70 ImageMagick 6.5.4-7 iMagick module 3.0.1

Hi,

(For the record, I tried searching the threads before posting, but the request keeps timing out).

We cannot use ImageMagick on our shared server due to proc_open() being disabled for security reasons.

I changed the $wgUseImageMagick = false to use the GD library as a test. When I do this, I get this message: 'Error creating thumbnail: Invalid thumbnail parameters'.

I've read in the manual that sometimes setting $wgMaxImageArea higher solves this problem (I currently have it set at 5000*5000), but when I do, it results in a WSOD. Commenting it out allows the page to display normally. I've double checked all the usual culprits (forgetting some syntax, etc).

Debugging (as per the manual) does not produce any clues or even output. There is nothing in the error log.

I have 'memory_limit' set to 64 in the LocalSettings.php file.

Any help appreciated.

Mitzzzz (talk)15:22, 26 July 2014

To get the error message of the WSOD, look at Manual:How to debug. That's usually caused by a fatal PHP error, which is usually logged in the apache error_log file.

If your image is huge, the problem may be an "out of memory". You may try increasing memory_limit to something higher (128M or even 256M).

Ciencia Al Poder (talk)09:38, 28 July 2014
 

Liquid thread version 3

Does anyone have source codes for liquid thread version 3.0 I would like to try it even though it haven't been updated and is no longer being developed.

86.173.55.16421:41, 27 July 2014

The source code of Extension:LiquidThreads is in the Git repository as linked on Extension:LiquidThreads. What you find there is what has been developed.

88.130.76.19821:56, 27 July 2014

Hi what about source code for liquid thread version 3 which was developed outside of git.

86.173.55.16422:03, 27 July 2014

Outside git? You obviously know more than I do. Where should that be? The official Git repo is the one linked on the page.

88.130.76.19822:09, 27 July 2014

Ok but wikimedia can develop extensions in private before releasing it in the public.

86.173.55.16422:15, 27 July 2014

Sure and how do you want to get hold of private data? I mean: If you know the devs, write them and ask. But I would not expect much from that.

88.130.76.19822:45, 27 July 2014
 

Now is the question: The info comes from where? I don't know software projects of Wikimedia developed in private. And LiquidThreads version 3 was cancelled, like the infoboxon the Extensionpage say:

> Development of Version 3.0 was cancelled, too.

Florianschmidtwelzow (talk)05:24, 28 July 2014
 
 
 
 
 

Delete unused images

Hello, I am trying to delete unused images from my wiki. I found the following code on a forum somewhere but I cannot get it to work:

lynx -dump http://wiki_site/wiki/index.php/Special:UnusedFiles | grep "/File:" | gawk '{print $2}' | sort | uniq | gawk -F\File '{print "File"$2}' > ./delete_files
php /var/www/html/wiki/maintenance/deleteBatch.php ./delete_files

It keeps saying that "lynx" and "gawk" commands were nto found. I get how to use the deleteBatch.php script. What I really need is an easy way to get a list of all the files that show up in "Special:UnusedFiles".

Any help is appreciated.

Zackmann08 (talk)19:43, 6 September 2012

I would try something simpler. For example I would start with the following.

wget -q -O - http://localhost/wiki/index.php/Special:UnusedFiles | grep "/File:" - > ./delete_files && gedit ./delete_files

Then use gedit to clean things up before using the deleteBatch.php script. I think that "gawk '{print $2}'" should be "gawk '{print $2}' -- -", and "sort | uniq" should be "sort -u -" etc. but I don't use the gawk command very much so you need someone more familiar with it to help you.

Allen4names (talk)05:17, 7 September 2012

First off, thank you very much for the help! I was actually able to get SOMETHING to run using that. The file (./delete_files) is turning up with tons of extra information though. Is there any easy way to isolate the file names? For example, in the following line (which represents a single file):

<div class="thumb" style="width: 150px;"><div style="margin:15px auto;"><a href="/wiki/File:WIP.jpg" class="image"><img alt="WIP.jpg" src="/images/thumb/b/b0/WIP.jpg/119px-WIP.jpg" width="119" height="120" /></a></div></div>
<a href="/wiki/File:WIP.jpg" title="File:WIP.jpg">WIP.jpg</a><br />
<pre>

I would like to just have:
<pre>
File:WIP.jpg

Any quick and easy way to do that?

Zackmann08 (talk)14:34, 7 September 2012

You could try the following.

cp -n delete_files delete_files.bak | replace 'href=\"/wiki/' '
' '\" class' '
' -- delete_files && cat delete_files | grep 'File' - | sort -u - > delete_files_sorted

Copy and paste this as a single line. Please let me know if this works.

Allen4names (talk)16:49, 7 September 2012

Not quite... I get the following. (I limited it to only include 2 of the many files listed)

delete_files:

                        <div class="thumb" style="width: 150px;"><div style="margin:34.5px auto;"><a File:ISR.jpg="image"><img alt="ISR.jpg" src="/images/thumb/2/2e/ISR.jpg/120px-ISR.jpg" width="120" height="81" /></a></div></div>
<a File:ISR.jpg" title="File:ISR.jpg">ISR.jpg</a><br />
                        <div class="thumb" style="width: 150px;"><div style="margin:36.5px auto;"><a File:ITA.jpg="image"><img alt="ITA.jpg" src="/images/thumb/1/1f/ITA.jpg/120px-ITA.jpg" width="120" height="77" /></a></div></div>
<a File:ITA.jpg" title="File:ITA.jpg">ITA.jpg</a><br />

delete_files_sorted:

<a File:ISR.jpg" title="File:ISR.jpg">ISR.jpg</a><br />
<a File:ITA.jpg" title="File:ITA.jpg">ITA.jpg</a><br />
                        <div class="thumb" style="width: 150px;"><div style="margin:34.5px auto;"><a File:ISR.jpg="image"><img alt="ISR.jpg" src="/images/thumb/2/2e/ISR.jpg/120px-ISR.jpg" width="120" height="81" /></a></div></div>
                        <div class="thumb" style="width: 150px;"><div style="margin:36.5px auto;"><a File:ITA.jpg="image"><img alt="ITA.jpg" src="/images/thumb/1/1f/ITA.jpg/120px-ITA.jpg" width="120" height="77" /></a></div></div>

Thank you SO MUCH for your help!

Zackmann08 (talk)17:20, 7 September 2012

By "as a single line" I meant that you should enter the code so that it looks like the three lines below.

$ cp -n delete_files delete_files.bak | replace 'href=\"/wiki/' '
> ' '\" class' '
> ' -- delete_files && cat delete_files | grep 'File' - | sort -u - > delete_files_sorted

I am sorry if my mistake caused you to missunderstand what I meant.

Allen4names (talk)03:15, 8 September 2012
 
 
 
 

Thanks for working on this script, but please do not use HTML output as an API. This can and will break when you least expect it, nor is it very reliable or stable.

We have an API for this, check API:Querypage. For example:

When you parse the JSON, you'll find the title property in the query.querypage.results array. Aside from JSON, there are many other API:Formats available.

Krinkle (talk)22:15, 22 September 2012
 
First page
First page
Previous page
Previous page
Last page
Last page