Project:Support desk

Jump to navigation Jump to search

About this board

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

(Read this message in a different language)

See also

Other places to ask for help:

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".
ErostheAmor (talkcontribs)

[X5XR3tBhqHAAAAnpo00AAAAH] 2020-10-25 19:28:30: Fatal exception of type "Wikimedia\Rdbms\DBQueryError"


Whenever I try to log in to my admin account on my wiki

MarkAHershberger (talkcontribs)
ErostheAmor (talkcontribs)

Warning: Use of undefined constant fales - assumed 'fales' (this will throw an Error in a future version of PHP) in /home/crescentconnection/inthecrescent.com/mediawiki-1.35.0/LocalSettings.php on line 114

Warning: session_name(): Cannot change session name when headers already sent in /home/crescentconnection/inthecrescent.com/mediawiki-1.35.0/includes/Setup.php on line 713

Warning: session_id(): Cannot change session id when headers already sent in /home/crescentconnection/inthecrescent.com/mediawiki-1.35.0/includes/Setup.php on line 757

Warning: session_start(): Cannot start session when headers already sent in /home/crescentconnection/inthecrescent.com/mediawiki-1.35.0/includes/Setup.php on line 758

Warning: Cannot modify header information - headers already sent by (output started at /home/crescentconnection/inthecrescent.com/mediawiki-1.35.0/LocalSettings.php:114) in /home/crescentconnection/inthecrescent.com/mediawiki-1.35.0/includes/WebResponse.php on line 74

Warning: Cannot modify header information - headers already sent by (output started at /home/crescentconnection/inthecrescent.com/mediawiki-1.35.0/LocalSettings.php:114) in /home/crescentconnection/inthecrescent.com/mediawiki-1.35.0/includes/WebResponse.php on line 74

Warning: Cannot modify header information - headers already sent by (output started at /home/crescentconnection/inthecrescent.com/mediawiki-1.35.0/LocalSettings.php:114) in /home/crescentconnection/inthecrescent.com/mediawiki-1.35.0/includes/WebResponse.php on line 74

Warning: Cannot modify header information - headers already sent by (output started at /home/crescentconnection/inthecrescent.com/mediawiki-1.35.0/LocalSettings.php:114) in /home/crescentconnection/inthecrescent.com/mediawiki-1.35.0/includes/WebResponse.php on line 74

Warning: Cannot modify header information - headers already sent by (output started at /home/crescentconnection/inthecrescent.com/mediawiki-1.35.0/LocalSettings.php:114) in /home/crescentconnection/inthecrescent.com/mediawiki-1.35.0/includes/WebResponse.php on line 74

Warning: Cannot modify header information - headers already sent by (output started at /home/crescentconnection/inthecrescent.com/mediawiki-1.35.0/LocalSettings.php:114) in /home/crescentconnection/inthecrescent.com/mediawiki-1.35.0/includes/WebResponse.php on line 74


Getting this now and can't even see wiki

Bawolff (talkcontribs)

while for starters, fix the fales typo on line 114 to false, and that should take care of most of the other new issues.


Did you include the $wgShowExceptionDetails=true; part of the debugging instructions?

Reply to "Unable to Login"

How to display the Username or IP in a wiki page or template?

3
Matjung (talkcontribs)

Preferably without installing any extension, I would like to display the username or IP address of the browser that visits the page.

Within magic words and ParserFunctions I did not find what I am looking for.

This extension Extension:UserFunctions contains some severe warnings.

The extension Extension:GetUserName displays only a name, but not an IP

Perhaps the extension Extension:MyVariables provides a solution.

The extension Extension:Variables indicates that WMF prefers not to work with it and points to Extension:Scribunto/Lua reference manual

Given that my username gets displayed at the top right corner, I would expect that a page or template could also display that name.

What are my options?

MarkAHershberger (talkcontribs)

The reason you can't find this sort of thing is because it isn't something that works well with the level of caching needed by Wikipedia.

To get around that, you need something that happens at the browser level. It seems like to me that the best way to handle that would be to insert a marker like

<span class="substitute-username-here">User's name</span>

wherever you want to have the user's name to be displayed and then use Javascript to find instances of span.substitute-username-here and replace the body with the user's name or ip.

Bawolff (talkcontribs)

the warnings on user functions is probably a bit extreme, i would suggest just using that.

The warning is basically, that its possible to setup a wiki page to load different images (or something) based on who is viewing it, then the person who did that can look to see which image was viewed to figure out which person viewed the original page. If you're worried about that be careful, but its a pretty minor attack so i think most people should probably just not care.

Reply to "How to display the Username or IP in a wiki page or template?"

How to change Apache2 virtual hosting directory

4
Timingliu (talkcontribs)

I have installed the updated version of mediawiki on a new directory and now it can be accessed via test-update.clinicianwiki.com. The original site is clinicianwiki.com. I tried to change the directory in the /etc/apache2/sites-avaiable/*.conf files to the directory hosting test-update.clinicianwiki.com and then use a2ensite but it is not working (despite changes being brought forward to sites-enabled. Now I have to do it in a very clumsy way by changing the $wgServer in the LocalSetting.php of clinicianwiki.com so that it will be redirected to test-update.clinicianwiki.com where new features are available. What should I do so that clinicianwiki.com will be serving the same content as test-update.clinicianwiki.com? (it is not necessary that the same directory is served twice, on clinicianwiki.com alone will do but I can't figure out a way to do it...). Thanks!

MarkAHershberger (talkcontribs)

I'm confused by your question. Do you want the test site and the original site to work at the same time but have different data? Are you trying to move the test site to the original site?

Timingliu (talkcontribs)

I am trying to move the test site to the original site by changing the apache2 and mediawiki settings.

Bawolff (talkcontribs)

do you need to restart apache? Not working how?

Reply to "How to change Apache2 virtual hosting directory"

Issue with MediaWiki:Sidebar and Sitenotice not taking effect

3
Reception123 (talkcontribs)
Bawolff (talkcontribs)

your eval.php example is probably not working because mw isnt initialized properly there. Its probably isn't related to your actual issue.

If i were to guess, something wrong with localization cache. Check mw debug log for errors related to it.

Reception123 (talkcontribs)

Thanks, just realized there was a response now. The localisation cache has been rebuilt and I haven't seen any errors relating to this.

Reply to "Issue with MediaWiki:Sidebar and Sitenotice not taking effect"

HTTP 500 error w/ VisualEditor

2
2.110.140.150 (talkcontribs)

I'm running MediaWiki-1.35 (stable) on Raspbian 10 (Buster), with VisualEditor-0.1.2 and php 7.3.19. I honestly can't figure out how to get the new php-parsoid to work, and the documentation hasn't been updated yet for me to follow it. Can anybody help me out? I keep getting the HTTP 500 error whenever I attempt to use the visual editor on my wiki.

I haven't gotten debug logs to function, so I'm currently installing wireshark to see if I can capture the issue this way.

MarkAHershberger (talkcontribs)
  • What did you do to try and produce debug logs?
  • Are you upgrading or is this a fresh install?
Reply to "HTTP 500 error w/ VisualEditor"
The1gofer (talkcontribs)

I keep running into issues with various thing not working due to file permissions. Is their a definative guide to what folders and files should be set to?

MarkAHershberger (talkcontribs)

The locations pointed to by $wpUploadDirectory, $wgCacheDirectory, and $wgTmpDirectory are about the only ones that should be writable. Some extensions need a writable directory (e.g. Widgets needs $IP/extensions/Widgets/compiled_templates/, and SemanticMediaWiki would like $smwgConfigFileDir to be writable), but that covers most of the cases.

But it is possible I've missed some. Do you see any missing?

The1gofer (talkcontribs)

@MarkAHershberger, Well I keep trying to run deleteArchivedFiles.php --delete and get Could not acquire lock on ffilename, skipping.

I can't really find anything, but it seems like a permissions issue.

MarkAHershberger (talkcontribs)

That sounds like you should run the script as whatever user owns the files under images.

Reply to "file permissions"

Error contacting the Parsoid/RESTBase server (HTTP 301) error

3
Timingliu (talkcontribs)

I have the error after installing 1.35 and using certbot https://certbot.eff.org/lets-encrypt/ubuntubionic-apache.html to install SSL certificate.

I chose 2 for the following cert option: 1: No redirect - Make no further changes to the webserver configuration.

2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for new sites, or if you're confident your site works on HTTPS. You can undo this change by editing your web server's configuration.

My question is, how to set up https redirect and visual editor together? it works fine under just http but may not be the safest option. Or should I selectively redirect (i.e. redirect all users to https but parsoid stays in http?) If so how can I do that?

Thanks a lot!

MarkAHershberger (talkcontribs)

You should redirect all requests to https and $wgServer should point to https. If you do that, you should not have a problem with 301.

Timingliu (talkcontribs)

problem solved thanks!

Reply to "Error contacting the Parsoid/RESTBase server (HTTP 301) error"

ServiceContainer.php: Recursive service instantiation: Circular dependency when creating service

5
Subfader (talkcontribs)

I upgraded from a very old version (25?) to 1.35.0 and get an internal error. I don't know what wikimedia services are but it sounds like I dodn't need it at all.

MediaWiki internal error.

Original exception: [3ae6162e9b487b54644fa2ee] /index.php?title=Main_Page Wikimedia\Services\RecursiveServiceDependencyException from line 437 of /vendor/wikimedia/services/src/ServiceContainer.php: Recursive service instantiation: Circular dependency when creating service! Parser -> Parser Backtrace:

  1. 0 /vendor/wikimedia/services/src/ServiceContainer.php(416): Wikimedia\Services\ServiceContainer->createService(string)
  2. 1 /includes/MediaWikiServices.php(1000): Wikimedia\Services\ServiceContainer->getService(string)
  3. 2 /includes/Setup.php(794): MediaWiki\MediaWikiServices->getParser()
  4. 3 /vendor/wikimedia/object-factory/src/ObjectFactory.php(172): {closure}()
  5. 4 /includes/StubObject.php(128): Wikimedia\ObjectFactory::getObjectFromSpec(array)
  6. 5 /includes/DeprecatedGlobal.php(55): StubObject->_newObject()
  7. 6 /includes/StubObject.php(172): DeprecatedGlobal->_newObject()
  8. 7 /includes/StubObject.php(115): StubObject->_unstub(string, integer)
  9. 8 /includes/StubObject.php(142): StubObject->_call(string, array)
  10. 9 /LocalSettings.php(238): StubObject->__call(string, array)
  11. 10 /includes/HookContainer/HookContainer.php(320): wfbreakExtension(Parser)
  12. 11 /includes/HookContainer/HookContainer.php(131): MediaWiki\HookContainer\HookContainer->callLegacyHook(string, array, array, array)
  13. 12 /includes/HookContainer/HookRunner.php(2959): MediaWiki\HookContainer\HookContainer->run(string, array)
  14. 13 /includes/parser/Parser.php(532): MediaWiki\HookContainer\HookRunner->onParserFirstCallInit(Parser)
  15. 14 /includes/parser/Parser.php(477): Parser->firstCallInit()
  16. 15 /includes/parser/ParserFactory.php(142): Parser->__construct(MediaWiki\Config\ServiceOptions, MagicWordFactory, LanguageEn, ParserFactory, string, MediaWiki\SpecialPage\SpecialPageFactory, MediaWiki\Linker\LinkRendererFactory, NamespaceInfo, MediaWiki\Logger\LegacyLogger, MediaWiki\BadFileLookup, MediaWiki\Languages\LanguageConverterFactory, MediaWiki\HookContainer\HookContainer)
  17. 16 /includes/ServiceWiring.php(816): ParserFactory->create()
  18. 17 /vendor/wikimedia/services/src/ServiceContainer.php(447): Wikimedia\Services\ServiceContainer->{closure}(MediaWiki\MediaWikiServices)
  19. 18 /vendor/wikimedia/services/src/ServiceContainer.php(416): Wikimedia\Services\ServiceContainer->createService(string)
  20. 19 /includes/MediaWikiServices.php(1000): Wikimedia\Services\ServiceContainer->getService(string)
  21. 20 /includes/content/WikitextContent.php(373): MediaWiki\MediaWikiServices->getParser()
  22. 21 /includes/content/AbstractContent.php(590): WikitextContent->fillParserOutput(Title, integer, ParserOptions, boolean, ParserOutput)
  23. 22 /includes/Revision/RenderedRevision.php(263): AbstractContent->getParserOutput(Title, integer, ParserOptions, boolean)
  24. 23 /includes/Revision/RenderedRevision.php(235): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached(WikitextContent, boolean)
  25. 24 /includes/Revision/RevisionRenderer.php(215): MediaWiki\Revision\RenderedRevision->getSlotParserOutput(string)
  26. 25 /includes/Revision/RevisionRenderer.php(152): MediaWiki\Revision\RevisionRenderer->combineSlotOutput(MediaWiki\Revision\RenderedRevision, array)
  27. 26 [internal function]: MediaWiki\Revision\RevisionRenderer->MediaWiki\Revision\{closure}(MediaWiki\Revision\RenderedRevision, array)
  28. 27 /includes/Revision/RenderedRevision.php(197): call_user_func(Closure, MediaWiki\Revision\RenderedRevision, array)
  29. 28 /includes/poolcounter/PoolWorkArticleView.php(216): MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()
  30. 29 /includes/poolcounter/PoolCounterWork.php(162): PoolWorkArticleView->doWork()
  31. 30 /includes/page/Article.php(810): PoolCounterWork->execute()
  32. 31 /includes/actions/ViewAction.php(74): Article->view()
  33. 32 /includes/MediaWiki.php(527): ViewAction->show()
  34. 33 /includes/MediaWiki.php(313): MediaWiki->performAction(Article, Title)
  35. 34 /includes/MediaWiki.php(940): MediaWiki->performRequest()
  36. 35 /includes/MediaWiki.php(543): MediaWiki->main()
  37. 36 /index.php(53): MediaWiki->run()
  38. 37 /index.php(46): wfIndexMain()
  39. 38 {main}
Malyacko (talkcontribs)

@Subfader Why would you move to an outdated insecure ancient version (1.30) with known and public security vulnerabilities, instead of upgrading to a supported and secure version?

Subfader (talkcontribs)

Sorry, 1.35.0 ;)

Bawolff (talkcontribs)

whats the code/extension defining the wfbreakExtension() function and what hook is it using?

At a glance it looks like its calling $wgParser (which creates a new parser) while executing a Parser initialization hook, which is causing a loop. If the extension is being passed a Parser, it should use that instance instead of $wgParser.

Subfader (talkcontribs)

Thanks, it was a mini extension I had added directly in LocalSettings and didn't recognize.

Reply to "ServiceContainer.php: Recursive service instantiation: Circular dependency when creating service"

Preventing to create empty pages

25
Summary by Fokebox

Resolved

Fokebox (talkcontribs)

I have a problem at my wiki, most of the users are school pupils and they often create just empty pages adding just a couple words. Are there any tool that can prevent to create empty pages or pages with just couple of words?

Wargo (talkcontribs)
Ciencia Al Poder (talkcontribs)

Extension:AbuseFilter will work for this. You can create a rule like this:

 page_id==0
 &!("#redirec" in lcase(added_lines))
 & (new_size < 20)
Fokebox (talkcontribs)

Guys, can you help me please. How to download Extension:AbuseFilter for older version of my wiki. I have 1.29.1

Bawolff (talkcontribs)

you should use a newer version. Mediawiki 1.29 hasnt been recieving security updates for over a year.


That said, you can get old versions from github https://github.com/wikimedia/mediawiki-extensions-AbuseFilter/archive/REL1_29.zip . I'm not sure if github downloads include vendor dependencies (prob not) so you also have to run composer install --no-dev in the AbuseFilter directory after you have unpacked it

Fokebox (talkcontribs)

It seems to be that I have successfully installed the extension. So we shall I put this code?:

page_id==0
 &!("#redirec" in lcase(added_lines))
 & (new_size < 20)

In localsettings.php file?

Ciencia Al Poder (talkcontribs)
Fokebox (talkcontribs)

Yes, now I try to use it ) Thanks

So, when I try to save the filter in this code:

page_id==0
 &!("#redirec" in lcase(added_lines))
 & (new_size < 20)

I have a system mistake, that there is an error in syntax

Bawolff (talkcontribs)

Syntax seems fine to me, are you sure you tried to add that code exactly?

Fokebox (talkcontribs)
Bawolff (talkcontribs)

Try

article_articleid==0
 &!("#redirec" in lcase(added_lines))
 & (new_size < 20)

instead (older versions of abusefilter might require that instead).

Fokebox (talkcontribs)

Thanks! Now all seems to be fine, all works!

Fokebox (talkcontribs)

Can you also help me how to create a filter that will not allow to non-registered users to insert external links in articles?

Matěj Suchánek (talkcontribs)
action == 'edit'
& user_age == 0
& article_namespace == 0
& added_lines rlike 'https?://'
Fokebox (talkcontribs)

Hi! Can you please help me. I want to make an exception for uploaded files. So it it necessary to provide description and the filter blocks uploading if there isn't such description. So I want users allow to upload files without descriptions

Matěj Suchánek (talkcontribs)

Adding article_namespace !== 6 & or action !== 'upload' & should suffice.

Fokebox (talkcontribs)

Thanks!

The whole code looks now so:

article_articleid==0
 &!("#redirec" in lcase(added_lines))
 & (new_size < 30)
 & action !== 'upload'
Fokebox (talkcontribs)

Hello! I have updated my wiki to 1.35 and enables VisualEditor. So if I upload the image via VisualEditor, it shows me a message that cannot create empty page. Shall I add to the code exception for uploading a file via VisualEditor

Wargo (talkcontribs)

Maybe set exception to "File" namespace.

Fokebox (talkcontribs)

I can try, can you please let me know how to make such exception to the code I have already

Ciencia Al Poder (talkcontribs)

Change action !== 'upload' to article_namespace !== 6

Fokebox (talkcontribs)

I guess I do something wrong. I have following code:

article_articleid==0
 &!("#redirec" in lcase(added_lines))
 & (new_size < 30)
 & action !== 'upload' to article_namespace !== 6

And I cannot save it as I have message with error

Matěj Suchánek (talkcontribs)

That to isn't valid. You were recommended to replace action !== 'upload' with article_namespace !== 6.

Fokebox (talkcontribs)

Now all is fine. Thanks

Fokebox (talkcontribs)

Thx! Works perfect!

File alignment not working after upgrade to 1.35

5
2001:16B8:4846:8300:5D49:CAC8:EADD:D454 (talkcontribs)

Hi everyone. I upgraded my rather uncustomized wiki from 1.32.1 to 1.35 and I am encountering a strange issue which I don't quite know where to start fixing: Files are not aligning (images), so e.g. (ignore the spaces this is just to not throw this editor off): [ [ File : Something.jpg | right ] ] but it is not aligning this file to the right. My wiki is now full of weird layouts because all the images jumped back to their default no/left alignment. Any ideas? Much appreciated!

MarkAHershberger (talkcontribs)

Is your wiki publicly viewable so we can see the problem?

2001:16B8:4846:8300:5D49:CAC8:EADD:D454 (talkcontribs)

yes, wiki.tarantino.info in fact. "Quentin_Tarantino_by_Ed_Gallafent" is an article there u can open as an example

MarkAHershberger (talkcontribs)

Ok, it looks like there was a change in some of the core CSS and foreground (the skin you use), didn't adapt. But I can't be sure because less files make only a smidgen of sense to me.

In any case, you can add

div.tright,
div.floatright,
table.floatright {
  clear: right;
  float: right;
}
div.tleft,
div.floatleft,
table.floatleft {
  float: left;
  clear: left;
}

to your common.css and that should fix the problem.

I couldn't find anything reported against the foreground skin about this, so you might try filing an issue there.

2001:16B8:486D:DD00:5D49:CAC8:EADD:D454 (talkcontribs)

Thanks! I will definitely report it there, they are currently looking into 1.35 compatibility anyway :)

Reply to "File alignment not working after upgrade to 1.35"