Topic on Extension talk:Scribunto

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]"