Project:Support desk

About this board

Welcome to the MediaWiki Support desk, where you can ask MediaWiki questions!

(Read this message in a different language)

See also

Before you post

Post a new question

  1. To help us answer your questions, please indicate which versions you are using, as found on your wiki's Special:Version page:
    • MediaWiki version
    • PHP version
    • Database type and version
  2. Please include the web address (URL) to your wiki if possible. It's often easier for us to identify the source of the problem if we can see the error directly.
  3. To start a new thread, click "Start a new topic".

PHP Error after upgrade 1.37 to 1.39.1

5
Summary by Finavar

Solved,

$wgUploadDirectory = "$wgScriptPath/images";

Cannot use var replacement, must be a real path. ./sigh.

Finavar (talkcontribs)

My host required me to upgrade from PHP 7.4.30 to PHP 8.2 so i decided to update MediaWiki first from 1.37.? to 1.39.1. After merging the new release into my instance, blank page.


The DB is MySQL 8.0.28-0ubuntu0.20.04.3

PHP is currently 7.4.30 until this is fixed at any rate.

The site is: https://wayneprecht.org/wiki3/index.php

Enabling debug yields this:


Fatal error: Uncaught Error: Class 'MediaWiki\HookContainer\HookRunner' not found in /home/wprecht/wayneprecht.org/wiki3/includes/Hooks.php:174 Stack trace:

  1. 0 /home/wprecht/wayneprecht.org/wiki3/includes/exception/MWExceptionHandler.php(767): Hooks::runner()
  2. 1 /home/wprecht/wayneprecht.org/wiki3/includes/exception/MWExceptionHandler.php(291): MWExceptionHandler::logError(Object(ErrorException), 'error', 'error', 'mwe_handler')
  3. 2 /home/wprecht/wayneprecht.org/wiki3/includes/AutoLoader.php(117): MWExceptionHandler::handleError(2, 'require(/home/w...', '/home/wprecht/w...', 117, Array)
  4. 3 /home/wprecht/wayneprecht.org/wiki3/includes/AutoLoader.php(117): require()
  5. 4 [internal function]: AutoLoader::autoload('MediaWiki\\Cache...')
  6. 5 /home/wprecht/wayneprecht.org/wiki3/includes/HookContainer/HookRunner.php(35): spl_autoload_call('MediaWiki\\Cache...')
  7. 6 /home/wprecht/wayneprecht.org/wiki3/includes/AutoLoader.php(117): require('/home/wprecht/w...')
  8. 7 [internal function]: AutoLoader::autoload('MediaWiki\\HookC...')
  9. 8 /hom in /home/wprecht/wayneprecht.org/wiki3/includes/Hooks.php on line 174

I have no clue how to proceed. I currently have all extensions commented out and the LocalSettings file has all the recent changes. 1.37 had been working fine for at least 18 months, so something in the update.

Ciencia Al Poder (talkcontribs)

Please install your wiki on a new, empty directory, and copy only LocalSettings.php, as explained in Manual:Upgrading.

You're mixing PHP files from two different installations!!

Finavar (talkcontribs)

Created a fresh install and moved LocalSettings.php, the 2 skins and 3 extenstions I had added to 1.3 and copied the images folder.

Wiki now works, but no images appear. I get a grey box with "Error creating thumbnail: File missing".


The files are for sure there, permissions are correct. LocalSettings.php has these variables set:

$wgScriptPath = "/wiki3";

$wgUploadDirectory = "$wgScriptPath/images";

$wgUploadPath = "$wgScriptPath/images";



$wgEnableUploads = true;

$wgUseImageMagick = true;

$wgImageMagickConvertCommand = "/usr/bin/convert";

$wgGenerateThumbnailOnParse = true;

Bawolff (talkcontribs)

Probably a permission issue with the images folder (ensure it is writsble by the webserver)

Ciencia Al Poder (talkcontribs)

Error creating thumbnail: File missing looks like MediaWiki can't access the file. Try opening a image from the File: page directly. You probably made a typo when copying the images folder (maybe you have an /images/images folder or similar).

Cross-wiki transclusion

5
The last available username (talkcontribs)

How do I set up my wiki so I can transclude templates across wikis like you can with links? ~~~~

Bawolff (talkcontribs)
The last available username (talkcontribs)

@Bawolff: Thanks, but does that work with CentralAuth (which is what I am using)?

Bawolff (talkcontribs)

It should not be affected by central auth, so it should work fine

The last available username (talkcontribs)

Can I configure it to only allow some wikis to be transcluded?

Reply to "Cross-wiki transclusion"
The last available username (talkcontribs)

Is it possible to set up a sub-instance of CentralAuth within an instance of CentralAuth? Like a sub-interwiki with their own stewards that only affect the wikis in the subsystem (but are also still effected by the main stewards).

Reply to "Sub-CentralAuth"

Images don't show after server transfer

3
Summary by Taustinoc

Needed to add an override to the <Directory> section of the Apache config file. Apache error was IfModule not allowed here. An AllowOverride ALL in the right place fixed it.

Taustinoc (talkcontribs)

MediaWiki 1.39.1

PHP 8.1.2-1ubuntu2.10 (apache2handler)

MySQL 8.0.32-0ubuntu0.22.04.2

Apache version 2.4.52

Example page: http://rptools.hyperbooks.com/index.php/mapTool_User_Interface


I am trying to move a wiki from a test server to a live server. Everything works perfectly on the test server, but images don't show on the live server. Both servers are Ubuntu 22.04 server, and both were set up identically using the LAMP server install in apt.


The database import seems to have gone without error. Both tables with "image" in their name show the same data. The images are there in the images directory. Permissions are currently set to 777, so permission issues seem unlikely. File Upload says it works, but I can't find the file anywhere in the images directory. (It might be there, in all the folders, I can't find it.)


cleanupImages.php only lists 42 images, but there are over 2,000 (and the show in the File list). No idea what that means.


rebuildImages.php does nothing. as does rebuildall.php.


If I click on a missing image, it takes me to the File: page, where the thumbnail doesn't show. If I click on the file there, I get:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at [no address given] to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Apache/2.4.52 (Ubuntu) Server at rptools.hyperbooks.com Port 80


I even tried renaming LocalSettings.php and rebuilding it, but I get the same errors.


I'm at a loss where to go next.

Bawolff (talkcontribs)

What does the apache error log say?

Sometimes this can be an issue with the .htaccess file in the images directory.

Taustinoc (talkcontribs)

IfModule not allowed here. Which was trivial to correct, once someone smart got me to look at the logs the error message said to look at.


Thanks you.

Cannot read wide tables : add slider

5
Wladek92 (talkcontribs)
Ammarpad (talkcontribs)

That's a preformatted text not table. <pre> text used to have a horizontal scroll bar but this was removed due to various issues with overflow. (See phab:T24060, for example)

Wladek92 (talkcontribs)

it is closed but i dont see the solution; how to realign this mess ?

Ammarpad (talkcontribs)

I didn't say it's open. The solution also is already what you see (that's to not add scrolling)

However, I think you can add the scrolling behavior for yourself by adding this in your common.css

pre, .mw-code {
    white-space: pre;
    overflow: auto;
}
Bawolff (talkcontribs)

Hmm, maybe we should add some inline styles for ascii art table diagrams, since word wrapping really wrecks them.


Or maybe we should just replace them with real tables.

Reply to "Cannot read wide tables : add slider"

CSS class for logged in users

3
Mruczekdd (talkcontribs)

Hello, I noticed that the "body" element has different CSS classes depending on the current namespace, action (e.g. action-edit), etc.

Is there a way to add a class depending on whether the user is logged in or not?

This would help in creating the style on my wiki.

Thank you!

Bawolff (talkcontribs)

I'm not sure about that, but you can use the page MediaWiki:Group-user.css for CSS you only want to show up for logged in users.

Mruczekdd (talkcontribs)

I found some code in another thread, changed it a bit and it seems to be working

LocalSettings.php:

$wgHooks['OutputPageBodyAttributes'][] = 'wfAddLoggedInClass';

function wfAddLoggedInClass( $out, $sk, &$bodyAttrs) {
  $user = RequestContext::getMain()->getUser();

  if ( $user->isRegistered() ) {
    $bodyAttrs['class'] .= ' loggedin';
  }

  return true;
}

But your suggestion is much easier and probably won't break with updates. Thanks. :)

Reply to "CSS class for logged in users"

Files with missing revision 0 cannot be restored in 1.39.1

6
BonniHamm (talkcontribs)

Hi, from a migration/update that did not work well around 2009 (I was not involved at that time) we (https://www.hammwiki.info) have a real lot of images with a missing revision 0, so the description etc. cannot be edited etc.

In MediaWiki 1.35.7 we had a good workaround: Deleting and restoring the images created the revision 0 and everything was fine.

In 1.39.1 the image cannot even be deleted, seems the Mediawiki checks for revision 0 what it did not in 1.35.7. DeleteBatch.php and Undelete.php in maintenance folder work, but do also not create the revision 0.

Example Image: https://www.hammwiki.info/wiki/Datei:Allee-center_1.jpg

Any idea how I can solve this? Being able to create a revision 0 would be fully OK, no matter how.

Cheers Frank

Rebastion2 (talkcontribs)

oh yeah, sorry to hear. I have the same problem, and scrolling through the support desk, so have many others. There seems to have been a breaking change somewhere at the 1.35 mark, and if that was skipped or didn't work correctly, some data in the actors table is irrestorably lost... it would also help me to be able to at least delete or overwrite these files....

Ciencia Al Poder (talkcontribs)

Your problem is tracked at phab:T326071, however your wiki's user attribution data has been lost already. Restore from backup and upgrade to 1.35 first if you can.

Rebastion2 (talkcontribs)

"Will be fixed in MediaWiki 1.39.2" and "attribution data has been lost already" are sort of contradictory. What does the patch at T326071 fix for those already affected? Who has backups from years ago.... all very frustrating.

Ciencia Al Poder (talkcontribs)

You don't need backups from years ago. You need a backup from *before* the upgrade. You're supposed to backup your database before an upgrade (it's recommended on Manual:Upgrading), and in case you run into problems, restore it immediately, not leave your wiki in a totally broken state and continue overwriting backups from the broken state.

The fix in 1.39.2 is to prevent data loss. However, wikis that have been upgraded already from a very old versions, have lost their data and it's unrecoverable.

Rebastion2 (talkcontribs)

The problem is, if I don't notice these Revision 0 errors after an upgrade, like most people do if it only affects a handful of files/pages, then years go by until you do notice. I know I am sitting here like an idiot because the post-1.35 upgrader is all screwed up, but it's not years ago when 1.35 came out that I noticed the database corruption. In order to revert to a backup and not leave the wiki in a broken state, I need to know it's a broken state. And that's not always so clear or visible.... unfortunately.

Reply to "Files with missing revision 0 cannot be restored in 1.39.1"

Error creating thumbnail: Error code: 2

3
Awailable (talkcontribs)

Error creating thumbnail:


vendor/wikimedia/shellbox/src/Command/limit.sh:

line 4: $'\r': command not found


vendor/wikimedia/shellbox/src/Command/limit.sh:

line 6: syntax error near unexpected token `$'{\r''


vendor/wikimedia/shellbox/src/Command/limit.sh:

line 6: `cleanup() {


Error code: 2

Any ideas how fix that?

Bawolff (talkcontribs)

What version of mediawiki, where did you obtain mediawiki from, how did you transfer it to your server (did you use ftp in text mode?) Which OS?

Awailable (talkcontribs)

Version mediawiki: 1.38.4

Reply to "Error creating thumbnail: Error code: 2"

Hosting service dropped MediaWiki support totally

9
Aiksiongkoh (talkcontribs)

I have used Aplus.net as my hosting service for 20 years. And I have used MediaWiki on it for 15 years. Recently, I found my wiki not working and Aplus says they have discontinued support for MediaWiki totally. They would not even try to help me recover my data in readable form. Please help me recover my family history in readable form. Thanks in advance.

Malyacko (talkcontribs)

We neither have any relation nor access to random third-party servers such as Aplus.net. You have to contact Aplus.net for content on Aplus.net, or use your local data backups if existing.

Aiksiongkoh (talkcontribs)

I have the backup data and I need help to go from there to get a working wiki. I have the contents of mwiki folder and databases folder. Like I said Aplus.net absolutely refuses to help. Thanks.

Malyacko (talkcontribs)
Aiksiongkoh (talkcontribs)
Malyacko (talkcontribs)

Uff, that software version is 14 years old. You could try to run php refreshLinks.php in the "maintenance" directory of MediaWiki.

Ciencia Al Poder (talkcontribs)

Your database dump seems to be severely screwed up. Page content is assigned to random pages, including MediaWiki: messages.

What do you have to restore the wiki and what did you do to restore it?

Aiksiongkoh (talkcontribs)

Thank you very much for helping.

Aplus.net has maintained a total blackout on MediaWiki so I don't know what they did to my wiki.

In my hosting directory I see the following:

/

    ...

    askoh.com

        public

            mwiki

                .conf

                bin

                ...many folders

                maintenance

                ...

                index.php

                ...many files

    askoh.net

        public

            mwiki

                images

                skins

                LocalSettings.php

    databases

        askoh21321_archive.zip

        askoh_back32112

        askoh21321

wiki_...many files

        Test_askohsitea328321

        test_askohsitea975176

        askoh_archive.zip

    mwiki

        .conf

        .restore


http://askoh.com/mwiki does not work at all now. It was an early version of

http://askoh.net/mwiki

Ciencia Al Poder (talkcontribs)

Database backup should consist of a single .sql file (maybe compressed in .zip/.gz/.xz/.7z) that you must restore on a new *empty* database server (database with no existing tables, etc).

Manual:Restoring a wiki from backup has useful information about the process.

You may try to use the same MediaWiki files that your host provided first, to see if you can have a working wiki with the same version you were using before. You seem to have two mediawiki installation folders, in askoh.com/public/mwiki and askoh.net/public/mwiki. If the version of MediaWiki was too old, it may not work due to recent PHP versions. In that case, you should upgrade to MediaWiki 1.35 (not 1.39, because of phab:T326071).

Reply to "Hosting service dropped MediaWiki support totally"

I need to solve this error

2
Lomeno 24 (talkcontribs)

I have problems logging into my user page, I need to fix a bug, or else I will have to uninstall MediaWiki and start again to install MediaWiki to fix the bug.


MediaWiki internal error.

Original exception: [f91a43cb11f8ada61c033f69] /mediawiki/index.php/Usuario:Lomeno_24 Wikimedia\Rdbms\DBQueryError from line 1713 of C:\xampp\htdocs\mediawiki\includes\libs\rdbms\database\Database.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading?

Error 1146: Table 'mediawiki.wikiuser_profile' doesn't exist (localhost) Function: UserProfile::getProfile Query: SELECT * FROM `wikiuser_profile` WHERE up_actor = 1 LIMIT 1

Backtrace:

  1. 0 C:\xampp\htdocs\mediawiki\includes\libs\rdbms\database\Database.php(1697): Wikimedia\Rdbms\Database->getQueryException(string, integer, string, string)
  2. 1 C:\xampp\htdocs\mediawiki\includes\libs\rdbms\database\Database.php(1672): Wikimedia\Rdbms\Database->getQueryExceptionAndLog(string, integer, string, string)
  3. 2 C:\xampp\htdocs\mediawiki\includes\libs\rdbms\database\Database.php(1241): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)
  4. 3 C:\xampp\htdocs\mediawiki\includes\libs\rdbms\database\Database.php(1921): Wikimedia\Rdbms\Database->query(string, string, integer)
  5. 4 C:\xampp\htdocs\mediawiki\includes\libs\rdbms\database\Database.php(2021): Wikimedia\Rdbms\Database->select(string, string, array, string, array, array)
  6. 5 C:\xampp\htdocs\mediawiki\includes\libs\rdbms\database\DBConnRef.php(68): Wikimedia\Rdbms\Database->selectRow(string, string, array, string, array)
  7. 6 C:\xampp\htdocs\mediawiki\includes\libs\rdbms\database\DBConnRef.php(331): Wikimedia\Rdbms\DBConnRef->__call(string, array)
  8. 7 C:\xampp\htdocs\mediawiki\extensions\SocialProfile\UserProfile\includes\UserProfile.php(134): Wikimedia\Rdbms\DBConnRef->selectRow(string, string, array, string, array)
  9. 8 C:\xampp\htdocs\mediawiki\extensions\SocialProfile\UserProfile\includes\UserProfileHooks.php(127): UserProfile->getProfile()
  10. 9 C:\xampp\htdocs\mediawiki\includes\HookContainer\HookContainer.php(329): UserProfileHooks::onArticleFromTitle(Title, NULL, RequestContext)
  11. 10 C:\xampp\htdocs\mediawiki\includes\HookContainer\HookContainer.php(132): MediaWiki\HookContainer\HookContainer->callLegacyHook(string, array, array, array)
  12. 11 C:\xampp\htdocs\mediawiki\includes\HookContainer\HookRunner.php(753): MediaWiki\HookContainer\HookContainer->run(string, array)
  13. 12 C:\xampp\htdocs\mediawiki\includes\page\Article.php(201): MediaWiki\HookContainer\HookRunner->onArticleFromTitle(Title, NULL, RequestContext)
  14. 13 C:\xampp\htdocs\mediawiki\includes\page\Article.php(227): Article::newFromTitle(Title, RequestContext)
  15. 14 C:\xampp\htdocs\mediawiki\includes\MediaWiki.php(422): Article::newFromWikiPage(WikiPage, RequestContext)
  16. 15 C:\xampp\htdocs\mediawiki\includes\MediaWiki.php(311): MediaWiki->initializeArticle()
  17. 16 C:\xampp\htdocs\mediawiki\includes\MediaWiki.php(947): MediaWiki->performRequest()
  18. 17 C:\xampp\htdocs\mediawiki\includes\MediaWiki.php(547): MediaWiki->main()
  19. 18 C:\xampp\htdocs\mediawiki\index.php(53): MediaWiki->run()
  20. 19 C:\xampp\htdocs\mediawiki\index.php(46): wfIndexMain()
  21. 20 {main}

Exception caught inside exception handler: [f91a43cb11f8ada61c033f69] /mediawiki/index.php/Usuario:Lomeno_24 Wikimedia\Rdbms\DBQueryError from line 1713 of C:\xampp\htdocs\mediawiki\includes\libs\rdbms\database\Database.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading?

Error 1146: Table 'mediawiki.wikiuser_profile' doesn't exist (localhost) Function: UserProfile::getProfile Query: SELECT * FROM `wikiuser_profile` WHERE up_actor = 1 LIMIT 1

Backtrace:

  1. 0 C:\xampp\htdocs\mediawiki\includes\libs\rdbms\database\Database.php(1697): Wikimedia\Rdbms\Database->getQueryException(string, integer, string, string)
  2. 1 C:\xampp\htdocs\mediawiki\includes\libs\rdbms\database\Database.php(1672): Wikimedia\Rdbms\Database->getQueryExceptionAndLog(string, integer, string, string)
  3. 2 C:\xampp\htdocs\mediawiki\includes\libs\rdbms\database\Database.php(1241): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)
  4. 3 C:\xampp\htdocs\mediawiki\includes\libs\rdbms\database\Database.php(1921): Wikimedia\Rdbms\Database->query(string, string, integer)
  5. 4 C:\xampp\htdocs\mediawiki\includes\libs\rdbms\database\Database.php(2021): Wikimedia\Rdbms\Database->select(string, string, array, string, array, array)
  6. 5 C:\xampp\htdocs\mediawiki\includes\libs\rdbms\database\DBConnRef.php(68): Wikimedia\Rdbms\Database->selectRow(string, string, array, string, array)
  7. 6 C:\xampp\htdocs\mediawiki\includes\libs\rdbms\database\DBConnRef.php(331): Wikimedia\Rdbms\DBConnRef->__call(string, array)
  8. 7 C:\xampp\htdocs\mediawiki\extensions\SocialProfile\UserProfile\includes\UserProfile.php(134): Wikimedia\Rdbms\DBConnRef->selectRow(string, string, array, string, array)
  9. 8 C:\xampp\htdocs\mediawiki\extensions\SocialProfile\UserProfile\includes\UserProfileHooks.php(127): UserProfile->getProfile()
  10. 9 C:\xampp\htdocs\mediawiki\includes\HookContainer\HookContainer.php(329): UserProfileHooks::onArticleFromTitle(Title, NULL, SkinVector)
  11. 10 C:\xampp\htdocs\mediawiki\includes\HookContainer\HookContainer.php(132): MediaWiki\HookContainer\HookContainer->callLegacyHook(string, array, array, array)
  12. 11 C:\xampp\htdocs\mediawiki\includes\HookContainer\HookRunner.php(753): MediaWiki\HookContainer\HookContainer->run(string, array)
  13. 12 C:\xampp\htdocs\mediawiki\includes\page\Article.php(201): MediaWiki\HookContainer\HookRunner->onArticleFromTitle(Title, NULL, SkinVector)
  14. 13 C:\xampp\htdocs\mediawiki\includes\page\Article.php(227): Article::newFromTitle(Title, SkinVector)
  15. 14 C:\xampp\htdocs\mediawiki\includes\skins\Skin.php(2507): Article::newFromWikiPage(WikiPage, SkinVector)
  16. 15 C:\xampp\htdocs\mediawiki\includes\skins\SkinTemplate.php(354): Skin->getFooterLinks()
  17. 16 C:\xampp\htdocs\mediawiki\includes\skins\SkinTemplate.php(127): SkinTemplate->prepareQuickTemplate()
  18. 17 C:\xampp\htdocs\mediawiki\includes\skins\SkinTemplate.php(144): SkinTemplate->generateHTML()
  19. 18 C:\xampp\htdocs\mediawiki\includes\OutputPage.php(2622): SkinTemplate->outputPage()
  20. 19 C:\xampp\htdocs\mediawiki\includes\exception\MWExceptionRenderer.php(153): OutputPage->output()
  21. 20 C:\xampp\htdocs\mediawiki\includes\exception\MWExceptionRenderer.php(65): MWExceptionRenderer::reportHTML(Wikimedia\Rdbms\DBQueryError)
  22. 21 C:\xampp\htdocs\mediawiki\includes\exception\MWExceptionHandler.php(106): MWExceptionRenderer::output(Wikimedia\Rdbms\DBQueryError, integer)
  23. 22 C:\xampp\htdocs\mediawiki\includes\exception\MWExceptionHandler.php(185): MWExceptionHandler::report(Wikimedia\Rdbms\DBQueryError)
  24. 23 C:\xampp\htdocs\mediawiki\includes\MediaWiki.php(580): MWExceptionHandler::handleException(Wikimedia\Rdbms\DBQueryError, string)
  25. 24 C:\xampp\htdocs\mediawiki\index.php(53): MediaWiki->run()
  26. 25 C:\xampp\htdocs\mediawiki\index.php(46): wfIndexMain()
  27. 26 {main}
Ammarpad (talkcontribs)
Reply to "I need to solve this error"