Page MenuHomePhabricator

mediawiki:1.39.10 Warning: PHP Startup: Unable to load dynamic library 'luasandbox'
Closed, ResolvedPublic

Description

Steps to replicate the issue (include links if applicable):

root@e4d150ef0c63:/var/www/html# php -v

Warning: PHP Startup: Unable to load dynamic library 'luasandbox' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20210902/luasandbox (/usr/local/lib/php/extensions/no-debug-non-zts-20210902/luasandbox: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/no-debug-non-zts-20210902/luasandbox.so (liblua5.1.so.0: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP 8.1.30 (cli) (built: Sep 27 2024 07:16:41) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.30, Copyright (c) Zend Technologies
with Zend OPcache v8.1.30, Copyright (c), by Zend Technologies

What happens?:

It seems ´liblua5.1.so.0´ file is missing, after installing liblua package manually the warning will disappear:

root@e4d150ef0c63:/var/www/html# apt update && apt install -y liblua5.1-0-dev 
...

root@e4d150ef0c63:/var/www/html# ls -lrt /usr/lib/x86_64-linux-gnu/liblua5.1.so.0
lrwxrwxrwx 1 root root 18 Mär 16  2022 /usr/lib/x86_64-linux-gnu/liblua5.1.so.0 -> liblua5.1.so.0.0.0

root@e4d150ef0c63:/var/www/html# php -v
PHP 8.1.30 (cli) (built: Sep 27 2024 07:16:41) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.30, Copyright (c) Zend Technologies
with Zend OPcache v8.1.30, Copyright (c), by Zend Technologies

What should have happened instead?:

No warning should occur.

Software version (skip for WMF-hosted wikis like Wikipedia):

MW 1.39

Other information (browser name/version, screenshots, etc.):

Details

Due Date
Oct 12 2024, 10:00 PM

Event Timeline

Thanks for the report! I can confirm that this is the case and at the same time I'm quite confused about it since apt update && apt install -y liblua5.1-0-dev is part of the Dockerfile: https://github.com/wikimedia/mediawiki-docker/blob/0b41a035fabebeda3d6b4ccc39e2c5fc3ce1cc19/1.39/apache/Dockerfile#L17-L26

On further inspection it turns out it is removed later again here:

#6 130.7 + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false
#6 130.8 Reading package lists...
#6 131.6 Building dependency tree...
#6 131.8 Reading state information...
#6 132.1 The following packages will be REMOVED:
#6 132.1   icu-devtools* libicu-dev* liblua5.1-0* liblua5.1-0-dev* libncurses-dev*
#6 132.1   libncurses6* libonig-dev* libreadline-dev*
#6 132.3 0 upgraded, 0 newly installed, 8 to remove and 1 not upgraded.
#6 132.3 After this operation, 54.7 MB disk space will be freed.
#6 132.3 (Reading database ... 
(Reading database ... 100%
(Reading database ... 18187 files and directories currently installed.)
#6 132.4 Removing libicu-dev:amd64 (72.1-3) ...
#6 132.5 Removing icu-devtools (72.1-3) ...
#6 132.6 Removing liblua5.1-0-dev:amd64 (5.1.5-9) ...
#6 132.7 Removing liblua5.1-0:amd64 (5.1.5-9) ...

I will have a look and roll out a fix 👍

ChristianHeusel changed the task status from Open to In Progress.Oct 4 2024, 9:54 AM
ChristianHeusel claimed this task.
ChristianHeusel triaged this task as Medium priority.
ChristianHeusel set Due Date to Oct 12 2024, 10:00 PM.

I'm running into this issue, too, with the 1.39 tag. The OS provides liblua5.3 while libluasandbox.so depends on liblua5.1. As a result, every invocation of php throws a warning:

root@6c8f69589096:/var/www/html# php --version
                                                                                                                                                                                                                Warning: PHP Startup: Unable to load dynamic library 'luasandbox' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20210902/luasandbox (/usr/local/lib/php/extensions/no-debug-non-zts-20210902/luasandbox: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/no-debug-non-zts-20210902/luasandbox.so (liblua5.1.so.0: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP 8.1.30 (cli) (built: Sep 27 2024 07:16:41) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.30, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.30, Copyright (c), by Zend Technologies

This sort of thing should not happen in a long term release ...

I have now proposed this change for inclusion in the official docker mediawiki images: https://github.com/docker-library/official-images/pull/17709

This sort of thing should not happen in a long term release ...

While I agree that bugs like this one are annoying, mistakes just happen from time to time ... Sorry for any inconvenience this issue has caused for you! 😅

The change and it's implementation are not part of a change in mediawiki since the docker images are not officially supported, therefore being on the LTS branch or not isn't relevant here (as the mediawiki codebase stayed the same, just the deployment changed).

Thank you for the fix and the clarification! Don't get me wrong, the Docker image is a great service. I was under the impression that its lts version was supposed to be a supported stable distribution. Apparently not. Making it so would be a lot of extra work, of course.

We extend this image with extensions and other enhancements, and it is not always so easy to port the system that builds them to newer MediaWiki versions. Having more support from MediaWiki for this would certainly help us.

Yeah in the end the whole thing turned out to be even more complicated (check the linked PR again) so this wasn't even really a mistake in the two other PR's I have linked ...

Is this a public project? If so, do you have a link for me?
I guess ultimatively we can't do much to help you guys except offer to take care of any reported bugs quickly or deal with any (reasonable) feature request 😊