Topic on Extension talk:Scribunto

HirderWiki (talkcontribs)

Hello ! I just started to use Scribunto, but when I wanted to copy/paste a code from Wikipédia, I got this error, and I can't do anything on Module. So my infobox keep having errors.

I work on 1.35.7, and have PHP 7.4 activated. I don't use SyntaxHighlight or CodeEditor.

FeRDNYC (talkcontribs)

Error "-129" isn't one of the documented known error codes, so more detailed information will likely be needed about your setup. Please post details on your MediaWiki platform (OS/distro, web server platform, etc.), how and where you installed Scribunto, what type of Lua interpreter you are using and where/how it was installed, and provide the full text of everything you added or changed in LocalSettings.php when configuring Scribunto.

HirderWiki (talkcontribs)

I'm back. (Sorry for that late answer, got a lot of work recently).

1)So, first things first. I'm using OVH (French web provider), ans I assume that they us Linux for their servers. I don't know how to get this information.

2)I have installed Scribunto with MediaWiki 1.35.7, that I put, in a specific file (My server is used first for a website, not for the wiki). So, the way is :

/www/wiki/extensions/Scribunto

There, is all the files from Scribunto.

3)I have modified several things. Because I didn't know what to do, for Scribunto to work. Here's the code from my LocalSettings.php :

wfLoadExtension( 'Scribunto' ); $wgScribuntoDefaultEngine = 'luastandalone'; $wgScribuntoEngineConf['luastandalone']['errorFile'] = ' /home/hirderr/www/wiki/extensions/Scribunto/file.txt';

I only have change $wgScribuntoDefaultEngine = 'luastandalone'; from 'luastandalone' to 'luasandbox' once, to see if there was any change. Nothing change.

I can also say that I have given chmod to the files who needs it, and from that, the extension was load, and able to write, but, I still can't use it.

4)I also have this that comes to all my website pages : Warning: proc_open( /home/hirderr/www/wiki/extensions/Scribunto/file.txt): failed to open stream: No such file or directory in /home/hirderr/www/wiki/extensions/Scribunto/includes/engines/LuaStandalone/LuaStandaloneInterpreter.php on line 153

FeRDNYC (talkcontribs)

@HirderWiki: OK, thanks, that looks like helpful information. Let's see:

  • For #3, changing to $wgScribuntoDefaultEngine = 'luasandbox' won't actually work unless the Lua extension is also installed in the server's PHP interpreter, it's completely separate from the standalone Lua binaries shipped with Scribunto. It's often more convenient on Windows to install a PHP extension, vs. getting the webserver to run an external binary. But on Linux, there's not usually much advantage. And if you don't have the ability/permissions to install PHP extensions, luasandbox is of no use at all.
  • #4 actually may be a good sign, as it seems PHP is trying to launch the Lua binary, but failing when it can't access (or, probably, can't create) the errorFile.

    (Note that the rest of my response will assume you have command-line (shell) access to the server, since you mentioned using chmod on files. Hopefully that's the case, or this gets harder.)

    It's very possible the path you listed above isn't writable by the webserver process. (And probably shouldn't be. It's usually a good idea for the webserver to have read-only access to content files, to prevent remote-exploit attacks that rely on the server modifying its own inputs.) So, you may need to change the errorFile path to a location that's writable by the server.

    Honestly, I'd probably start by using some location that allows mostly-unrestricted write access, like /tmp/ or /var/tmp/. Unless it's really locked down, your webserver probably has permission to create a file like /var/tmp/lua_errors.txt, so it's simplest to try using that path (or similar) for the errorFile location.

    Otherwise, the errorFile needs to be in some directory with either the owner or group matching the webserver process, where write permission is also set for that user/group. If they're running Apache as the server, you can use ps -ef |grep httpd to find out the process owner. (First column, ignoring the first instance that's owned by root.) If they're running some other server, the process name probably won't be httpd so you'll get no results. You could also try removing the errorFile configuration entirely (with no other changes), just to see if perhaps it's the only thing preventing your server from executing the Lua binary. You won't get Lua errors logged, if there are any, but you can at least see if you're hitting any additional PHP errors. (Lua errors tend to be surprisingly uninformative, anyway, to the extent that the errorFile is nearly useless in practice.
HirderWiki (talkcontribs)

Thanks for the answer !

So, I've erased the line about the error file, because that wasn't helping at all. I also gave permissions to all folders of Scribunto. I gave them a 777, to be sure that it is not that. I've try then to upload Lua, and I got the same error. Erreur : Erreur Lua : erreur interne : l’interpréteur s’est arrêté avec le signal « -129 ».

In English, that can be translated in :

Error : Lua Error : Internal Error : The interpreter stoped with the signal "-129"

That's all I have actually.

FeRDNYC (talkcontribs)

Ah, OK! It turns out the exit code is calculated by the extension, which subtracts 128 from the value under certain circumstances. So, this is really a -1 exit condition.

Some possibilities:

  1. proc_open is unavailable in your PHP implementation
  2. The webserver doesn't permit execution of programs from the MediaWiki extension directory
  3. The Linux server uses SELinux, which doesn't permit the owner of the server process to execute binaries unless they have a certain file context.

Did I ever ask what OS the server is running? The contents of /etc/system-release and the output of uname -a run from a shell would be the most informative. For example, on my Fedora systems I get:

$ uname -a
Linux (__hostname__) 5.19.13-200.fc36.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Oct 4 15:42:43 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/system-release
Fedora release 36 (Thirty Six)

If proc_open is restricted, it should appear in the disable_functions list of the php.ini for the server. (Possibly /etc/php.ini, or a file in /etc/php.d/.) If you have access to modify that configuration and can unrestrict it, that may let luastandalone run.

If SELinux is involved, the command getenforce will (a) exist, and (b) return "Enforcing". If the command is not found, then SELinux isn't a worry.

There may also be more helpful error messages in the webserver's error log, or the system journal/logs. But tracking those down is highly dependent on the OS and webserver used.

HirderWiki (talkcontribs)

I've look everywhere in my option, but it is impossible for me to know winch OS is running on my servers. Even when I try to contact OVH to ask for it, then don't respond.

Tacsipacsi (talkcontribs)

Create a PHP file with this content:

<?php phpinfo(); ?>

and open in your browser. The first line of the table (System) should display the same info uname -a would if you had shell access. (You could use php_uname as well, but phpinfo provides much more information, some of which may be useful for further debugging.)

After getting the required information, I suggest you to delete the file so that others are unlikely to see it, as all the system information provided by phpinfo may help hackers to do targeted attacks based on the software you actually use or your PHP configuration.

HirderWiki (talkcontribs)

Here what I got under System :

Linux (hostname) 4.14.253-ovh-vps-grsec-zfs-classid #1 SMP Thu Oct 28 11:15:35 CEST 2021 x86_64

HirderWiki (talkcontribs)

UPDATE : Finaly installed SyntaxHighlight and CodeEditor. Nothing change. I delete Sribunto from my extension files, and reupload it. Nothing change. I try to activate the error log file. I can't do it, i don't know why. When i try to add a Module page, even an empty one, the log file can be found, even when i clearly specify the way /home/hirderr/www/wiki/extensions/Scribunto/file.txt. Not sure if i have to it in .txt ...

Please, help.

FeRDNYC (talkcontribs)

One of the most important things you can check: If you go to your wiki's Special:Version, in the first table under "Installed Software" do you see either a "Lua" or "LuaSandbox" version listed? Unless you have that, Scribunto won't be able to access the Lua interpreter required to run any Module code. (For that matter, can you confirm that "Scribunto" is listed in the "Installed Extensions" table farther down, under "Parser Hooks"?)

HirderWiki (talkcontribs)

I can confirm that Scribunto is indeed installed. And I can also confirmed that Lua is listed under "Installed Software". It is in use of version 5.1.5.

Reply to "Error "-129""