Project:Support desk

Jump to navigation Jump to search

About this board

Welcome to MediaWiki.org's Support desk, where you can ask MediaWiki questions!

There are also other places where to ask :

Before you post

Post a new question

  1. To help us answer your questions, please always indicate which versions you are using (reported by your wiki's Special:Version page):
    • MediaWiki
    • PHP
    • Database
  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 topic".
Previous page history was archived for backup purposes at Project:Support_desk/old on 2015-07-30.
Other languages: English  العربية čeština Esperanto français 日本語 中文

Lua Error 'then' expected near 'number'

1
Aquatiki (talkcontribs)

Lua seems to be bringing my whole system down, with the error: Lua error in mw.lua at line 370: 'then' expected near 'number'. I have MediaWiki 1.33.1; PHP 7.2.21 (apache2handler); MySQL 5.7.27; ICU 58.1; Lua 5.1.5. I have no idea what this means.

Reply to "Lua Error 'then' expected near 'number'"

Unable to complete SMW rebuildData.php

5
Mukilol2 (talkcontribs)

I am not sure if I should post this here but I am trying to run rebuildData.php and I'm getting exception after a while, here is the exception message: https://pastebin.com/7treeHjN Does someone know what is causing this and possible solution? I'm running:

1.31.0 MW

7.1.30 (cgi-fcgi) PHP

5.7.25 MySQL

2.5.6 SMW

MarkAHershberger (talkcontribs)

From SMW's getting support page:

The best resource for free support for Semantic MediaWiki is the Semantic MediaWiki user mailing list. The list is driven by an active user community, and answers to many questions can already be found in its archives on SourceForge among others, so a web search may also help.

But, looking at your backtrace, it looks like SematicForms could be involved.

Can you upgrade SMW and PageForms?

Mukilol2 (talkcontribs)

I found their mailing list but haven't figured out how to ask for help via it. I have been getting emails from it from last night but no idea how to use it... Regarding your suggestion, I upgraded PageForms and SMW to 3.1 and when I run rebuildData.php again I get the following exception now: https://pastebin.com/V3yftSaZ Is it smart to ignore the exceptions?

MarkAHershberger (talkcontribs)

To use the mailing list, just reply to one of the messages and copy the address in the "To" field.

Start an email with the question you have (e.g. "rebuildData.php does not complete") and just describe the problem and then ask for help resolving it. People should reply within a few hours.

Re the exception: No, don't ignore them. The stacktrace you pasted seems to indicate a serious problem. Unfortunately, I am not familiar enough with SMW to really help you with it.

Mukilol2 (talkcontribs)

Alright, I think I figured out the email thing and sent an email a few hours ago. Let's see if someone has an idea of what's going on. Thanks for the help!

Reply to "Unable to complete SMW rebuildData.php"

JS objects aren't working properly on my wiki

4
Blinkingline (talkcontribs)

Hi!

I recently noticed that parts of Mediawiki that require Javascript (Such as TinyMCE editor or the Javascript widget for Special:RecentChanges) aren't working. If I inspect from Chrome, I can see the following stacktrace. Any ideas on what I can do to resolve this?


MarkAHershberger (talkcontribs)

What version of MediaWiki are you running?

If your wiki is public, could you point to it?

Blinkingline (talkcontribs)

I'm running MediaWiki 1.33

You can access the wiki at https://archonarcana.com

It must have been some kind of configuration issue. I was trying to troubleshoot and ended up reverting to a backup copy of LocalSettings and it seems to be working now.

Thanks for your help!


MarkAHershberger (talkcontribs)

Glad you got your problem resolved. Looks like a decent wiki.

Reply to "JS objects aren't working properly on my wiki"

user cannot log in since Mediawiki upgrade

6
Usda-mark (talkcontribs)

Last week our Mediawiki was upgraded from 1.18 to 1.33. One user is receiving "Fatal error authenticating user". Our wiki is configured with local logon disabled and authentication with LDAP. I had Skype session with this user and he was able to login using my browser, but cannot on his desktop trying Firefox, Chrome, etc.. The pluggableeauth.log returns "Authentication failure, ERROR: Please choose a valid domain, ERROR: return to URL is null or empty" and found this in debug.log "[DBQuery] SELECT  lc_value  FROM `l10n_cache`    WHERE lc_lang = 'en' AND lc_key = 'messages:pluggableauth-fatal-error'  LIMIT 1". Thanks in advance for any help!

MarkAHershberger (talkcontribs)

Could you paste your ldap provider json file (without passwords, of course)?

Also, what are the debug log lines leading up to the DBQuery line you posted?

Usda-mark (talkcontribs)

// LDAPProvider

$LDAPProviderDomainConfigProvider = function() {

        $config = [

                'EDC' => [

                        'connection' => [

                                "server" => "edc.ds1.usda.gov",

                                "user" => "cn=s_wikiuser,ou=service,ou=accounts,ou=nitc,dc=edc,dc=ds1,dc=usda,dc=gov",

                                "pass" => '########',

                                "options" => [

                                        "LDAP_OPT_DEREF" => 1

                                ],

                                "basedn" => "OU=Privileged,OU=Accounts,OU=NITC,DC=EDC,DC=DS1,DC=USDA,DC=GOV",

                                "userbasedn" => "OU=Privileged,OU=Accounts,OU=NITC,DC=EDC,DC=DS1,DC=USDA,DC=GOV",

                                "searchattribute" => "samaccountname",

                                "usernameattribute" => "samaccountname",

                                "realnameattribute" => "cn",

                                "emailattribute" => "mail"

                        ]

                ]

        ];

        return new \MediaWiki\Extension\LDAPProvider\DomainConfigProvider\InlinePHPArray( $config );

};


[DBQuery] DELETE FROM `objectcache` WHERE keyname = 'wiki_db:messages:en:lock'

[MessageCache] MessageCache::load: Loading en... local cache is empty, global cache is expired/volatile, loading from database

[DBQuery] SELECT  lc_value  FROM `l10n_cache`    WHERE lc_lang = 'en' AND lc_key = 'messages:ldapauthentication2-no-domain-chosen'  LIMIT 1

[session] SessionBackend "5ghgav4ehrd13lmk794bkmulf1njv6g8" save: dataDirty=1 metaDirty=0 forcePersist=0

[session] SessionBackend "5ghgav4ehrd13lmk794bkmulf1njv6g8" data dirty due to dirty(): PluggableAuthLogin->execute/MediaWiki\Auth\AuthManager->setAuthenticationSessionData/MediaWiki\Session\Session->setSecret/MediaWiki\Session\Session->set/MediaWiki\Session\SessionBackend->dirty

[session] SessionBackend "5ghgav4ehrd13lmk794bkmulf1njv6g8" save: dataDirty=1 metaDirty=0 forcePersist=0

[DBQuery] SELECT  lc_value  FROM `l10n_cache`    WHERE lc_lang = 'en' AND lc_key = 'messages:pluggableauth-fatal-error'  LIMIT 1

MarkAHershberger (talkcontribs)

What do you use for your session store (e.g. $wgSessionCacheType)? How about $wgMainCacheType?


That still isn't enough of the debug log. Could you paste the entire request that includes this bit?

Usda-mark (talkcontribs)

Sorry, I'm fairly new to Mediawiki. Looks like $wgSessionCacheType = CACHE_DB; and $wgMainCacheType    = CACHE_NONE;

Is the below enough? There is more if you need it.

MarkAHershberger (talkcontribs)

Thanks, that looks like the entire request, but it is apparently the GET request for when you first visit the login page. Could you get the log from your user's (it is only one, right?) POST request when the login fails?

Also, you should really be using Memcached for session handling. Then you would set both those variables to CACHE_MEMCACHE:

$wgMainCacheType = CACHE_MEMCACHED;
$wgMemCachedServers = [ "127.0.0.1:11211" ];
$wgSessionCacheType = CACHE_MEMCACHED;

Putting session handling into Memcached can resolve some session issues all by itself.

If you are using a Linux distribution like Redhat or Debian, it should be simple to install.

Reply to "user cannot log in since Mediawiki upgrade"

Upload new file version: getting old version unless browser cache refresh

13
193.29.227.43 (talkcontribs)

We're using [[Media:Example.jpg]] to include versioned pdf files. New versions of the file are uploaded via "Upload new file version" on the file description page.

After having uploaded a new file version, the browser keeps returning the old version until the browser cache is being flushed with "Ctrl+F5".

Question: Is there a way to ensure the newest file version is being displayed without having to hard refresh the page manually? Shouldn't mediawiki pass some kind of "expired flag" when a new file version is available?

Software Version
MediaWiki 1.22.1
PHP 5.3.17 (apache2handler)
MySQL 5.5.33
2A02:C7F:963F:BA00:F497:3E00:4BDD:A80A (talkcontribs)

Please upgrade your MediaWiki version and then get help.

Ciencia Al Poder (talkcontribs)

There's no way to send an "expired flag" to the browser, because the browser is not requesting the URL to see if the file has been updated.

You should configure your server, the path that contains all your uploads, to send files with a Cache-Control: must-revalidate header, that will make the browser check every time if a new version of the file exists, and if not retrieve the cached version.

2A02:C7F:963F:BA00:C4B8:9875:F37D:899E (talkcontribs)
Ciencia Al Poder (talkcontribs)

You already said that. I'm free to help people even if they use an unsupported MediaWiki version, specially if the problem is not with MediaWiki itself.

193.29.227.55 (talkcontribs)

Thank you for your lucid explanation. I have asked our administrator to configure our server according to your recommendation and will then report the result here.

Revansx (talkcontribs)
Waffle2019 (talkcontribs)

Hi there,

I am experiencing the same issue.

I have to ask all users to manually purge the cache before opening a reupload of a file version.

Is there any other way to avoid this? I can edit all mediawiki files on the server, including .htaccess, but I don't have access to the server configuration.


Mediawiki Version 1.31.3

PHP Version 7.1.32

MariaDB Version 5.5.64-MariaDB

Ciencia Al Poder (talkcontribs)

You may try setting a Cache-Control header in .htaccess with a short age and "must-revalidate", to cause browsers to check if a new version is available before returning the cached one:

# 10 minutes
Header set Cache-Control "max-age=600, must-revalidate"

See examples in https://www.askapache.com/htaccess/apache-speed-cache-control/

Waffle2019 (talkcontribs)

Thanks for the tip, I made this edit! I will follow up with my users in the next few weeks to see if it solved our problem.

Bruceillest (talkcontribs)

I had the same issue and thanks to Science is Power @Ciencia Al Poder :-) guidance I was able to get this working for my instance in Windows Server 2012 R2 with IIS 8.5.


Make sure you have IIS 6 Scripting Tools and IIS 6 WMI Compatibility installed through Server Manager.


I basically opened IIS Manager and navigated to my website folder right clicked and selected "Add Virtual Directory". In the Alias field I put the same name as the folder in my case I customized wiki to use "uploads" folder so I put uploads in the field. For Physical path just hit the 3 dots and select your folder by navigating to it then hit OK.


Open command prompt as admin and enter the following commands please enter in your values in the bold words.


cd C:\inetpub\AdminScripts

cscript adsutil.vbs SET W3SVC/1/ROOT/YOUR WIKI SITE/YOUR UPLOAD_IMAGES FOLDER/CacheControlCustom "no-cache"


Then just test it out.

Ciencia Al Poder (talkcontribs)

Note that disallowing browsers to cache images will cause a lot of more traffic to your server, and slowness on the wiki (because of the need to redonwload all images on every request).

It's better if you set the Cache-Control to "max-age=600, must-revalidate", (you can adjust the time) to allow images to be cached for 10 minutes, and then browsers will query the server to see if the image has changed, and if not, it will continue to use the cache without the need to download the image again.

Bruceillest (talkcontribs)

Thanks for that info luckily my site is for a small group of folks but, I did notice that PHP's FastCGI process does eat up a bit of CPU when this happens and in my situation its not too bad.


If my site grows then I will most likely go down the max-age route.

Reply to "Upload new file version: getting old version unless browser cache refresh"

How can I install and enable LanguageConverter in Mediawiki1.33.0

5
TheEndOfKeyHighSchool (talkcontribs)
Malyacko (talkcontribs)

Hi, could you be more specific? What is the name of "the related .php file"?

TheEndOfKeyHighSchool (talkcontribs)

There is no /language folder in my Mediawiki software.Can I just add this folder to the Mediawiki's base path? If not, what should I do?

Bawolff (talkcontribs)

respectfully, you should stop looking at Mediawiki source files. All your posts are basically misinterpreting how mediawiki works. There is basically no reason you would have to modify any mediawiki includes files (other than adding things to the /extensions) If you didnt have the language directory nothing in mediawiki would work.


LanguageConverter is included with mediawiki by default. There are only a few languages it supports, and it will only be enabled if $wgLanguageCode is set to one of these languages (like zh or sr. If $wgUsePigLatinVariant also en)

What is your $wgLanguageCode set to, and what is the value of any other language config

TheEndOfKeyHighSchool (talkcontribs)

I have found the /language folder,but the LanguageConverter.php isnot available yet.How can I enable this class?

Reply to "How can I install and enable LanguageConverter in Mediawiki1.33.0"
Mukilol2 (talkcontribs)

Hey, on my wiki I want to query all articles from a category and display them in a blog type of way. The problem is that all articles are loaded on each request so if I have, let's say 5000 articles , the page will look REALLY long and isn't optimal. Is it possible to add pagination or maybe infinite scroll to a page? I have been googling for some time now and could only find a SMW solution for it: https://www.semantic-mediawiki.org/wiki/Help:Listwidget_format but it's not supported since SMW 3.0.0.

Ciencia Al Poder (talkcontribs)

You may want to integrate with the API and use the pagination provided by it.

Reply to "Pagination or infinite scroll?"
River5000 (talkcontribs)

What determines which part of an article's text will appear as the meta description for search engines? Some of my articles feature the first two lines which I want, while others pick text from random parts of the article.

Do I need to rely on an extension to control meta descriptions?

Bawolff (talkcontribs)

most modern search engines ignore meta description tags.

There are various extensions that do let you control the contents of meta tags if you really want to

Ciencia Al Poder (talkcontribs)
Reply to "Meta Descriptions"
ZI Jony (talkcontribs)

I've created a user script on Meta. I'd like to use it also as gadget, what I've to change in code or can be use same. I'm trying to use that user script as gadget but that not working, but as user script working very good.

I also would like to know what is the different between user script and gadget? if yes, then how should compare and write both.


User script: https://w.wiki/BYc Gadget: https://w.wiki/BYb

Thanks in advance!

Bawolff (talkcontribs)

It should generally be the same. Perhaps its loading before the page loads. Try wrapping the whole thing in $( function () { .... } );

ZI Jony (talkcontribs)
89.157.115.94 (talkcontribs)

Hi there! After a few calm month on a new wiki, I started this month hard attacks from bots. Of course nobody was looking at it and today I had to clean several thousands of new pages and accounts (creation/edit restricted to registered person not enough apparently). I added Nuke and BlockandNuke but not totally enough. I blocked the account creation in the meantime but not sure if it's not working or if it's old unblocked account that are activated. At least it's more slow now.

Apparently BlockandNuke didn't really blocked all the accounts. Is there another extension more potent to delete/block lots of accounts?

And now that's a more cleaned-up I'm looking to render the registration more difficult. I've seen the extension ConfirmAccount but is there something a little bit more simple than that?


Thanks a lot!!

Malyacko (talkcontribs)
89.157.115.94 (talkcontribs)

yes thank you I have already seen this page. That's where I found the tools to stop the haemorrhage. But I haven't really found answer to my specific questions:

-Is there another extension more potent to delete/block lots of accounts than BlockandNuke?

-How to add a captcha only to the account creation?

Ciencia Al Poder (talkcontribs)

Extension:ConfirmEdit, use QuestyCaptcha, and add this settings:

$wgCaptchaTriggers['edit']          = false;
$wgCaptchaTriggers['create']        = false;
$wgCaptchaTriggers['createtalk']    = false;
$wgCaptchaTriggers['addurl']        = false;
$wgCaptchaTriggers['createaccount'] = true;
$wgCaptchaTriggers['badlogin']      = true;
89.157.115.94 (talkcontribs)

Super thanks!

Reply to "Spamming bots"