Extension talk:Scribunto

Jump to navigation Jump to search

About this board

24.142.4.209 (talkcontribs)

This extension has made using MediaWiki an absolute nightmare. Half of my pages grenade with various errors. Wiki means quick ... but I spend more time investigating this crap then working my content.

Mr. Stradivarius on tour (talkcontribs)

What are you using it to do? If it's something that doesn't require a lot of complex templates, then you can probably get away with just uninstalling it.

Leucosticte (talkcontribs)

I don't know about his particular use case, but importing content from Wikipedia and having it work on one's wiki usually requires Scribunto these days; most people won't be able to get away with just uninstalling it. It would be a real hassle to have to design infoboxes and such from scratch, and not use a scripting language.

Iowajason (talkcontribs)

Agree with Leucosticte. Transwiki requires Scibunto and extension development paradigm is wild west. Hoping key Mediawiki components return to Wiki governance and release/versioning controls at some point. Is there any kind of plan on when this extension will be managed like normal extensions? It's been a long time that this has operated outside normal protocols.

Mr. Stradivarius on tour (talkcontribs)

What do you mean by "transwiki"? I'm not aware of any transwiki methods that require Scribunto. Do you mean exporting pages with Special:Export?

Iowajason (talkcontribs)

Transwiki is the process of moving content from one Wiki to another. With the prominence that Lua now has on en.wikipedia.org, moving content (using any method), generally requires Scribunto be working on the destination (e.g. mine) Wiki.

With other extensions, one is able to match versions and have some confidence that content moved from one wiki to another will work on a similarly configured site. Currently, this is a challenge with Lua.

Mr. Stradivarius (talkcontribs)

Yes, I know what transwikiing is. :) Of course, if you're moving content from Wikipedia, then you will need Scribunto. But my point was that not everyone needs to have Wikipedia content on their own wiki. Most of the templates and modules on the English Wikipedia were never designed for portability; even before Scribunto came along transwikiing templates was considered "use at your own risk". The main difference now is that if you get an error it will show a big red "script error" message rather than failing in a less obvious way.

Another difference is that Scribunto is updated more often than MediaWiki's wikitext parser, because Scribunto is much newer. But both will continue to be updated, so there is always the risk of generating errors if you use templates or modules that depend on newer versions of MediaWiki or of Scribunto.

There has been some talk of setting up a centralised wiki or maybe a git repository for developing Lua modules on Wikimedia sites, which would probably make module developers think more about their work being reused on other sites. However, I haven't heard any updates about that recently.

Reply to "Nightmare"

'can't find module' error message

1
Wuestenarchitekten (talkcontribs)

I was running scribunto with no issues using commit (f1a4d6c) when updating our wiki to 1.31, I attempted to also update scribunto without success. The Module-Namespace is gone for some reason. Reverting to that previous revision made the Module Namespace reappear and everything working fine.

Any hints on how I might investigate this?

Thanks

Markus

Reply to "'can't find module' error message"

The interpreter has terminated with signal "11".

6
Sanctaria (talkcontribs)

I've installed everything as per the instructions, but keep getting this error. However all info online re this error is 3+ years old, at least.

I am on a shared server, but have confirmation from my hosts that proc_open functions are available. They've said Lua should be already installed on the shared servers too.

It's the MW 1.30 version I have installed it on. I've copy-pasted the info for my Local Settings...

I'm a n00b and completely untrained and unknowledgeable when it comes to this stuff. Plz help.

Sanctaria (talkcontribs)

Ok, some playing around and now I have the error 1 message.

Checked with the host and the Lua on the shared server is 5.3.4.

So I'm buggered, really.

EDIT: This is from the error log:

/extensions/Scribunto/engines/LuaStandalone/MWServer.lua:526: attempt to call a nil value (global 'loadstring')

stack traceback:

.../extensions/Scribunto/engines/LuaStandalone/MWServer.lua:526: in function 'MWServer.unserialize'

.../extensions/Scribunto/engines/LuaStandalone/MWServer.lua:410: in function 'MWServer.receiveMessage'

.../extensions/Scribunto/engines/LuaStandalone/MWServer.lua:295: in function 'MWServer.dispatch'

.../extensions/Scribunto/engines/LuaStandalone/MWServer.lua:40: in function 'MWServer.execute'

...w/extensions/Scribunto/engines/LuaStandalone/mw_main.lua:7: in main chunk

[C]: in ?

Anomie (talkcontribs)
Checked with the host and the Lua on the shared server is 5.3.4.

Scribunto only supports 5.1 versions of Lua.

Sanctaria (talkcontribs)

Yeah, I know. Are there any plans to change this?

However I did contact my host to plead to change the version they have on it. They said no. They then said I have version 5.1.4. And when I showed them logs of them telling me earlier I have 5.3.4, they said they'd have to go check. I haven't heard from them since.

*sigh*

EDIT: Nope, nevermind, they've decided it's 5.3.4 after all >_> Definitely not going to upgrade with them after this to a VPS/dedicated.

Anomie (talkcontribs)

There are no plans to change that any time soon. See phab:T178146 and linked comments for some discussion.

Since your host has 5.3.4 installed globally and won't install a 5.1 version in parallel, it seems you're left with figuring out how to install Lua locally to your account there (assuming they don't have your local directories all mounted with "noexec" or the like). You might try figuring out why the local version distributed with Scribunto is segfaulting (that's what signal 11 typically indicates), or you might just try recompiling Lua 5.1 locally since that's probably going to turn out to be the fix in the end.

Sanctaria (talkcontribs)

Possibly. And unfortunately that's beyond my technical capabilities so I guess I'll have to finagle a friend into doing it for me.

Reply to "The interpreter has terminated with signal "11"."

Lua error in package.lua at line 80: module 'Module:Yesno' not found.

1
Jimcat1111 (talkcontribs)

I'm getting this error when using the Imbox template imported from this page (Template:Imbox). Aso in the template page itself I'm getting this other error:

Lua error in package.lua at line 80: module 'Module:Category handler/data' not found.

I have mediawiki 1.29.1 with Scribunto REL1_29.

I have exported these modules from the MediaWiki page and imported them to mine, they exist and their pages work, yet I still get these errors. This is how I exported them to import them after in my wiki's Special:Import page: https://www.mediawiki.org/wiki/Special:Export?pages=Template:Imbox%0aModule:Message_box%0aModule:Message_box/configuration%0aModule:No_globals%0aModule:Category_handler%0aModule:Yesno%0aModule:Arguments%0aModule:Category_handler/data&curonly=1&wpExportTemplates=1&wpDownload=1

Basically the problem is that the modules exist but I get an error saying they cannot be found. Any ideas on why is this happening and how to correct it?

Reply to "Lua error in package.lua at line 80: module 'Module:Yesno' not found."
68.49.56.122 (talkcontribs)

Hello,

I'm managing a wiki that had the Scribunto extension installed for some time but really wasn't used much except on a couple of test pages. I'm upgrading the wiki now (from 1.28 to 1.31) and have removed the Scribunto extension. However, when I run the scripts to populate the CirrusSearch index, I get the following traceback:

<code>

[7c132a3761cb626266d8cab6] [no req]   MWUnknownContentModelException from line 306 of /var/www/html/mediawiki-1.31.0/includes/content/ContentHandler.php: The content model 'Scribunto' is not registered on this wiki.

See https://www.mediawiki.org/wiki/Content_handlers to find out which extensions handle this content model.

Backtrace:

#0 /var/www/html/mediawiki-1.31.0/includes/content/ContentHandler.php(243): ContentHandler::getForModelID(string)

#1 /var/www/html/mediawiki-1.31.0/includes/Title.php(4984): ContentHandler::getForTitle(Title)

#2 /var/www/html/mediawiki-1.31.0/includes/parser/Parser.php(892): Title->getPageLanguage()

#3 /var/www/html/mediawiki-1.31.0/includes/parser/Parser.php(2126): Parser->getTargetLanguage()

#4 /var/www/html/mediawiki-1.31.0/includes/parser/Parser.php(2091): Parser->replaceInternalLinks2(string)

#5 /var/www/html/mediawiki-1.31.0/includes/parser/Parser.php(1318): Parser->replaceInternalLinks(string)

#6 /var/www/html/mediawiki-1.31.0/includes/parser/Parser.php(443): Parser->internalParse(string)

#7 /var/www/html/mediawiki-1.31.0/includes/content/WikitextContent.php(323): Parser->parse(string, Title, ParserOptions, boolean, boolean, integer)

#8 /var/www/html/mediawiki-1.31.0/includes/content/AbstractContent.php(516): WikitextContent->fillParserOutput(Title, integer, ParserOptions, boolean, ParserOutput)

#9 /var/www/html/mediawiki-1.31.0/includes/content/ContentHandler.php(1324): AbstractContent->getParserOutput(Title, integer, ParserOptions)

#10 /var/www/html/mediawiki-1.31.0/extensions/CirrusSearch/includes/Updater.php(363): ContentHandler->getParserOutputForIndexing(WikiPage, ParserCache)

#11 /var/www/html/mediawiki-1.31.0/extensions/CirrusSearch/includes/Updater.php(204): CirrusSearch\Updater->buildDocumentsForPages(array, integer)

#12 /var/www/html/mediawiki-1.31.0/extensions/CirrusSearch/maintenance/forceSearchIndex.php(218): CirrusSearch\Updater->updatePages(array, integer)

#13 /var/www/html/mediawiki-1.31.0/maintenance/doMaintenance.php(94): CirrusSearch\ForceSearchIndex->execute()

#14 /var/www/html/mediawiki-1.31.0/extensions/CirrusSearch/maintenance/forceSearchIndex.php(679): require_once(string)

#15 {main}

</code>

I found a few phabricator tickets that appear to be related but haven't yet found a workaround beyond reinstalling the Scribunto extension. Is there one? Is there a way to remove the Scribunto content model and/or references to it?

68.49.56.122 (talkcontribs)

Additionally, I thought if I did an XML dump of all pages and revisions I would find a page using "<model>Scribunto</model>" but I don't seem to have any pages with that.

2620:11E:1000:120:1792:B56B:4655:6029 (talkcontribs)

Okay, I think I got it fixed. It turns out that if pages exist in the database in a namespace that mediawiki doesn't know about, there is no way to display them and they don't show up in an XML export either. I was able to reset the page content model of the single interfering page in the database like so:

UPDATE page SET page_content_model = 'wikitext' WHERE page_content_model = 'Scribunto';

Reply to "Uninstalling Scribunto"

Lua error: Internal error: The interpreter exited with status 126.

1
Summary by Sanctaria

Nevermind, I had it installed in the wrong place. I am a moron, confirmed.

Sanctaria (talkcontribs)

See above. I've referred to the troubleshooting but all my files are executable.

I moved from shared hosting to a VPS server in order to install Lua 5.1.x to rub Scribunto. I did that and I have Lua 5.1.4 installed on my root.

I installed new binaries in the Lua 5.1.4 too just to make double sure this would work. But I'm still getting errors! This is a lot more work for a few infoboxes than I was expecting!

Anyway this is the current error log: /home/theixlpp/public_html/w/extensions/Scribunto/engines/LuaStandalone/lua_ulimit.sh: line 6: exec: /root/lua-5.1.4/lua-5.1.5_Linux32_64_bin/bin2c5.1: cannot execute: Permission denied

I'm not a techie in any way, which is my own fault, but if anyone can point out what I'm doing wrong, I'd appreciate it.

Recommended version for MW 1.28?

3
Cavila (talkcontribs)

For the sake of helpful documentation, I was wondering which version is recommended for MW 1.28. The 1.30 version from the Extension Distributor is clearly too new because of the way extensions are registered, while the 1.27 version may throw a fatal error related to object caching (unless you apply the patch to LuaCommon.php below - provided below in case anyone else has run into this.). Which I guess leaves us with 1.29?

     
  if ( !$cache ) {
           /// @todo: Clean up when support for MW < 1.27 is dropped
           if ( is_callable( 'ObjectCache::getLocalServerInstance' ) ) {
               $cache = ObjectCache::getLocalServerInstance( 'hash' );
           } else {
               $cache = ObjectCache::newAccelerator( 'hash' );
           }
       }
Anomie (talkcontribs)

While ExtensionDistributor doesn't provide extensions for unsupported versions of MediaWiki, a 1.28 branch of the extension does exist.

On the other hand, you really should upgrade your MediaWiki installation to a supported version of MediaWiki. The unsupported 1.28 version (of MediaWiki and of Scribunto) may not have received patches for security issues fixed after 1.28 support ended.

Cavila (talkcontribs)

Thanks! Upgrading can be time-consuming business and introduce compatibility issues so I'd rather pick an appropriate time but I'll get there eventually (I tend to go for LTS versions butI had specific reasons for upgrading to 1.28 at the time).

Reply to "Recommended version for MW 1.28?"

Script error: The function "Navbox" does not exist.

3
Malcolm.mcclintock (talkcontribs)

I'm running: MediaWiki 1.30.0, Lua 5.1.5, Scribunto REL1_30 (4e3a20b), PHP: 7.0.28

I've reimported all dependent modules (Arguments, List, Navbox, Navbar), yet it still throws an error. No further details are included in the error box. I have debug running , nothing seems out of the ordinary. I'm out of my water here, Scribunto seems to be functioning in every other way. If you'd like you can check the current error here

Mr. Stradivarius (talkcontribs)

In Template:Navbox, You need to change {{#invoke:navbox|Navbox}} to {{#invoke:navbox|navbox}}. For some reason, the function name starts with a capital in the template you exported, but in the module the function name is all lower case.

Malcolm.mcclintock (talkcontribs)

... it's always the little things, isn't it?

Wonderful, that fixed it! Thanks so much @Mr. Stradivarius, that did it in a pinch. I never would have found that.

Reply to "Script error: The function "Navbox" does not exist."

Lua error in Module:List [SOLVED]

18
Wmat (talkcontribs)

I'm running MW 1.22.6 and Scribunto REL1_22 and I'm receiving the following error from the Template:Navbox I imported from Wikipedia:

Lua error in Module:List at line 110: attempt to index field 'html' (a nil value).
Backtrace:
Module:List:110: in function "renderList"
Module:List:181: ?
(tail call): ?
mw.lua:553: ?
[C]: in function "getAllExpandedArguments"
mw.lua:283: ?
[C]: in function "iterator"
Module:Arguments:133: in function "mergeArgs"
Module:Arguments:223: ?
[C]: in function "pairs"
Module:Message_box:182: in function "removeBlankArgs"
Module:Message_box:624: ?
(tail call): ?
mw.lua:553: ?
[C]: in function "getExpandedArgument"
mw.lua:264: ?
Module:Arguments:177: ?
Module:Documentation:648: in function "_content"
Module:Documentation:141: ?
(tail call): ?
mw.lua:553: ?

Thanks.

Mr. Stradivarius on tour (talkcontribs)

Your version of Scribunto doesn't have the mw.html library. Upgrading to the latest version should fix this (the 1.23 version has it, if I remember correctly).

Wmat (talkcontribs)

OK, checking out REL1_23, running update.php gets me a Fatal Exception:

[1b316c59] 2014-06-01 21:46:47: Fatal exception of type MWException

With $wgShowExceptionDetails = true; I see:

[b6b81c5f] /index.php/Template:Navbox Exception from line 212 of ...includes/Hooks.php: Detected bug in an extension! Hook ScribuntoHooks::formatLimitData has invalid call signature; Parameter 2 to ScribuntoHooks::formatLimitData() expected to be a reference, value given
Backtrace:
#0 ...includes/GlobalFunctions.php(3877): Hooks::run(string, array)
#1 ...includes/parser/Parser.php(545): wfRunHooks(string, array)
#2 ...includes/content/WikitextContent.php(300): Parser->parse(string, Title, ParserOptions, boolean, boolean, integer)
#3 ...includes/WikiPage.php(3552): WikitextContent->getParserOutput(Title, integer, ParserOptions)
#4 ...includes/PoolCounter.php(222): PoolWorkArticleView->doWork()
#5 ...includes/Article.php(708): PoolCounterWork->execute()
#6 ...includes/actions/ViewAction.php(44): Article->view()
#7 ...includes/Wiki.php(448): ViewAction->show()
#8 ...includes/Wiki.php(312): MediaWiki->performAction(Article, Title)
#9 ...includes/Wiki.php(602): MediaWiki->performRequest()
#10 ...includes/Wiki.php(467): MediaWiki->main()
#11 ...index.php(49): MediaWiki->run()
#12 {main}
Anomie (talkcontribs)

Note that the version of Scribunto for 1.23 is not compatible with MediaWiki 1.22.

Wmat (talkcontribs)

That's fine, and expected. However, how then can I use Template:Navbox with my version of MW, or am I basically stuck waiting for 1.23?

Mr. Stradivarius on tour (talkcontribs)
Wmat (talkcontribs)

Thanks, that gets a little farther along. I think I may need an older version of Navbar as well as I'm seeing this script error now:

Lua error in Module:Navbox at line 60: attempt to call upvalue 'navbar' (a nil value).
Backtrace:
(tail call): ?
Module:Navbox:60: in function "renderNavBar"
Module:Navbox:116: in function "renderTitleRow"
Module:Navbox:327: in function "renderMainTable"
Module:Navbox:349: ?
(tail call): ?
mw.lua:571: ?
(tail call): ?
[C]: in function "xpcall"
MWServer.lua:87: in function "handleCall"
MWServer.lua:301: in function "dispatch"
MWServer.lua:58: ?
(tail call): ?
mw.lua:265: ?
Module:Arguments:177: ?
Module:Documentation:648: in function "_content"
Module:Documentation:141: ?
(tail call): ?
mw.lua:571: ?
(tail call): ?
[C]: in function "xpcall"
MWServer.lua:87: in function "handleCall"
MWServer.lua:301: in function "dispatch"
MWServer.lua:40: in function "execute"
mw_main.lua:7: in main chunk
[C]: ?
Mr. Stradivarius (talkcontribs)

Ah, sorry, it looks like you need earlier versions of the modules than that. Try this version of Module:Navbox and this version of Module:Navbar.

Wmat (talkcontribs)

Slightly diffrerent result:

Lua error in Module:List at line 201: attempt to call local 'p' (a table value).
Backtrace:
Module:List:201: in main chunk
(tail call): ?
[C]: in function "getAllExpandedArguments"
mw.lua:283: ?
[C]: in function "iterator"
Module:Arguments:133: in function "mergeArgs"
Module:Arguments:223: ?
[C]: in function "pairs"
Module:Message_box:182: in function "removeBlankArgs"
Module:Message_box:624: ?
(tail call): ?
mw.lua:553: ?
[C]: in function "getExpandedArgument"
mw.lua:264: ?
Module:Arguments:177: ?
Module:Documentation:648: in function "_content"
Module:Documentation:141: ?
(tail call): ?
mw.lua:553: ?
Mr. Stradivarius (talkcontribs)

Hmm, that's a fairly mysterious error message - Module:List on the English Wikipedia only has 199 lines. And calling the "p" variable is a strange thing for a module to do. I'd need to see your setup to see how to fix that. Mind you, Module:List would fail anyway, as it uses the mw.html library, as do an increasing number of other modules. If you really want to run all of these modules from Wikipedia, your best bet is to install one of the 1.23 branches of MediaWiki from git and upgrade your Scribunto to the latest version.

Anomie (talkcontribs)
Wmat (talkcontribs)

OK, I've upgrade to MW1.23 and Scribunto git branch 1_23. I exported WP's version of Template:Navbox and Module:List to ensure I had good version. I get 2 script errors:

Script error: The function "navbox" does not exist.

and

Lua error in Module:List at line 201: attempt to call local 'p' (a table value).
Backtrace:
(tail call): ?
Module:List:201: in main chunk
(tail call): ?
(tail call): ?
[C]: in function "xpcall"
MWServer.lua:87: in function "handleCall"
MWServer.lua:301: in function "dispatch"
MWServer.lua:58: ?
(tail call): ?
mw.lua:284: in function "old_pairs"
...extensions/Scribunto/engines/LuaCommon/lualib/mw.lua:21: in function "iterator"
Module:Arguments:133: in function "mergeArgs"
Module:Arguments:223: in function "old_pairs"
...extensions/Scribunto/engines/LuaCommon/lualib/mw.lua:21: in function "pairs"
Module:Message_box:182: in function "removeBlankArgs"
Module:Message_box:624: ?
(tail call): ?
mw.lua:567: ?
(tail call): ?
[C]: in function "xpcall"
MWServer.lua:87: in function "handleCall"
MWServer.lua:301: in function "dispatch"
MWServer.lua:58: ?
(tail call): ?
mw.lua:265: ?
Module:Arguments:177: ?
Module:Documentation:648: in function "_content"
Module:Documentation:141: ?
(tail call): ?
mw.lua:567: ?
(tail call): ?
[C]: in function "xpcall"
MWServer.lua:87: in function "handleCall"
MWServer.lua:301: in function "dispatch"
MWServer.lua:40: in function "execute"
mw_main.lua:7: in main chunk
[C]: ?
Mr. Stradivarius on tour (talkcontribs)
Wmat (talkcontribs)

I believe I've imported all of those and have the latest versions. Interestingly, I can't edit and save modules when Scribunto is enabled. If I disable it in LocalSettings, I can save no problem. Nothing in the messages log and nothing in my lua error log.

I wonder if this could have something to do with the output_buffer = 8192 setting in php.ini?

Mr. Stradivarius (talkcontribs)

What does it say when you try and save a module? Are you getting the red box at the top of the page that says "script error"? If a script contains errors that are detectable before run-time, then Scribunto won't let you save the page. But if Scribunto isn't running, then MediaWiki thinks that the broken module code is just any old text and allows you to save the page. Also, could you try importing en:Module:List one more time? Getting an error on line 201 of that module is very strange, as the module on the English Wikipedia is only 199 lines long. Not sure about the php.ini settings, sorry.

Wmat (talkcontribs)

When I try to save a module, MW returns a blank page. I'm am not getting a red Script Error upon saving a module, but do see the red Script Error in the imported Module page. And the error is the same as before

Lua error in Module:List at line 201: attempt to call local 'p' (a table value).

. And I reimported Module:List, Template:Navbox, Template:Navbar, and Module:Arguments again to be sure they were current.

Wmat (talkcontribs)

I've fixed the Module:List error. This was caused by two lines of Category code being added to the end of Module:List. Not sure how that happened.

So I'm down to my last red script error:

Script error: The function "navbox" does not exist.

Module:Navbox and Template:Navbox are both current.

Wmat (talkcontribs)

It turns out I needed an older revision of the Navbox module. It would seem with MW1.23 and the 1.23 branch of Scribunto you can't simply import Modules and Templates from Wikipedia, which would make sense given that WP is running the latest and greatest of both.

Reply to "Lua error in Module:List [SOLVED]"
66.77.160.179 (talkcontribs)

I get the following error even on MW version 1.30 even though the correct MW version is installed and the correct version's extension files were used:

Fatal error: Uncaught exception 'Exception' with message 'Scribunto is not compatible with the current MediaWiki core (version 1.29.1), it requires: >=1.30.0.' in /var/www/html/mediawiki/includes/registration/ExtensionRegistry.php:261 Stack trace: #0 /var/www/html/mediawiki/includes/registration/ExtensionRegistry.php(148): ExtensionRegistry->readFromQueue(Array) #1 /var/www/html/mediawiki/includes/Setup.php(40): ExtensionRegistry->loadFromQueue() #2 /var/www/html/mediawiki/includes/WebStart.php(139): require_once('/var/www/html/m...') #3 /var/www/html/mediawiki/index.php(40): require('/var/www/html/m...') #4 {main} thrown in /var/www/html/mediawiki/includes/registration/ExtensionRegistry.phpon line 261

Anomie (talkcontribs)

Either you found a version of MediaWiki 1.30 that has the version incorrectly set to "1.29.1", or you didn't actually install MediaWiki 1.30 correctly.

Zeros79 (talkcontribs)

Dear Senpai notice me.. *Sighs*

I've installed :

MediaWiki 1.30

Semantic MediaWiki : 2.5.6

Scribunto (4e3a20b) 00:07, 3 April 2018

Semantic Scribunto:1.1.1

AND this is the error that i get when i Make a Module:Banana

[Ws5YGMbDbaZ7MyegdkbkrgAAAvY] /index.php?title=Module:Banana&action=submit Scribunto_LuaInterpreterNotFoundError from line 180 of /mnt/web003/d0/58/57118858/htdocs/wiki/extensions/Scribunto/engines/LuaStandalone/LuaStandaloneEngine.php: No Lua interpreter was given in the configuration, and no bundled binary exists for this platform.

Backtrace : .........

Is there anyone who can help me fix this bug because i also don't see Lua being loaded at all in my special:version as well.

Thanks

Reply to "Not working with mediawiki 1.30?"