FS#77124 - [uwsgi-plugin-php-legacy,php-legacy-embed] nextcloud 25.0.2-2 + nginx + uwsgi broken

Attached to Project: Community Packages
Opened by zoltix (zoltix) - Saturday, 14 January 2023, 17:38 GMT
Last edited by Pierre Schmitz (Pierre) - Tuesday, 17 January 2023, 11:16 GMT
Task Type Support Request
Category Packages
Status Closed
Assigned To Pierre Schmitz (Pierre)
David Runge (dvzrv)
Architecture x86_64
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:
I updated the nextcloud and php packages. I found that nextcloud was not working anymore (https://cloud-dev.lli.be/) with the error message: This version of Nextcloud is not compatible with PHP>=8.2.

I noticed that there was a new file nextcloud.ini.pacnew. I did a diff and found differences in line 3 "plugins = php-legacy" and also "php-set = open_basedir.......php-set =.... /usr/lib/php-legacy/..."
I do a test and there I got an error message in jounalctl "open("/usr/lib/uwsgi/php-legacy_plugin.so"): No such file or directory [core/utils.c line 3731]"
I find an error in the nextcloud.ini.pacnew the plugin name was php-legacy_plugin.so. but i found the file with name php_legacy_plugin.so.
I changed nextcloud.ini with plugins = php-legacy.
I thought I had it right but the error came back: 'This version of Nextcloud is not compatible with PHP>=8.2.". I thought that by changing /etc/uwsgi/nextcloud.ini the plugin parameter would be enough to force the old php version. I see that my site is still in version php 8.2.1.



Additional info:
* package version(s)
I followed the installation guide : https://wiki.archlinux.org/title/Nextcloud
nextcloud 25.0.2-2
uwsgi-plugin-php-legacy 2.0.21-3

* config and/or log files etc.
/etc/uwsgi/nextcloud.ini (attached)
/etc/nginx/conf.d/nextcloud.conf (attached/ln -s)

* link to upstream bug report, if any
https://cloud-dev.lli.be/
Steps to reproduce:
update nextcloud 25.0.2-1 to nextcloud 25.0.2-2
and add package uwsgi-plugin-php-legacy 2.0.21-3
This task depends upon

Closed by  Pierre Schmitz (Pierre)
Tuesday, 17 January 2023, 11:16 GMT
Reason for closing:  Fixed
Comment by David Runge (dvzrv) - Saturday, 14 January 2023, 19:19 GMT
Judging from the config file, uwsgi should now work as intended.
*However*, judging from the error message you got it looks as if your nextcloud instance is seemingly being run using php (8.2).

Please make sure to stop any running uwsgi instances that may still have old state somehow and check that uwsgi is indeed running using php-legacy and not php.
Comment by David Runge (dvzrv) - Saturday, 14 January 2023, 19:21 GMT
Egh... I think I know what's happening. It looks like uwsgi-plugin-php-legacy is built against php-embed and not php-legacy-embed... :(
Comment by zoltix (zoltix) - Saturday, 14 January 2023, 19:26 GMT
aie aie how to change that ?
Comment by David Runge (dvzrv) - Saturday, 14 January 2023, 19:41 GMT
It needs to be rebuilt and I'll look into this asap.
Comment by David Runge (dvzrv) - Saturday, 14 January 2023, 23:50 GMT
@zoltix: Alright, this took longer than anticipated.

It turns out, that php-legacy-embed was misconfigured to expose the same soname as php-embed (libphp.so).
I have now patched the build system for php-legacy, so that the separation actually works. Before that everything was in fact linking against libphp.so, so php 8.2.x was used.

Please try uwsgi-plugin-php-legacy 2.0.21-4 and php-legacy-embed 8.1.14-2 in [community-testing]/[testing].
Comment by zoltix (zoltix) - Sunday, 15 January 2023, 00:40 GMT
not yet or other update issue
it's too late for searching. I'm going to my bed
I've a stupid error in nginx. you could take a look at this address
https://cloud-dev.lli.be/
Comment by zoltix (zoltix) - Sunday, 15 January 2023, 00:50 GMT
Jan 15 01:24:03 vps-356d03eb systemd[1]: Starting uWSGI service unit...
Jan 15 01:24:03 vps-356d03eb uwsgi[305]: [uWSGI] getting INI configuration from /etc/uwsgi/nextcloud.ini
Jan 15 01:24:03 vps-356d03eb uwsgi[305]: /usr/lib/uwsgi/php_legacy_plugin.so: undefined symbol: php_legacy_plugin
Jan 15 01:24:03 vps-356d03eb uwsgi[305]: *** Starting uWSGI 2.0.21 (64bit) on [Sun Jan 15 01:24:03 2023] ***
Jan 15 01:24:03 vps-356d03eb uwsgi[305]: compiled with version: 12.2.0 on 19 December 2022 07:58:43
Jan 15 01:24:03 vps-356d03eb uwsgi[305]: os: Linux-6.1.5-arch2-1 #1 SMP PREEMPT_DYNAMIC Thu, 12 Jan 2023 22:42:33 +0000
Jan 15 01:24:03 vps-356d03eb uwsgi[305]: nodename: vps-356d03eb
Jan 15 01:24:03 vps-356d03eb uwsgi[305]: machine: x86_64
Jan 15 01:24:03 vps-356d03eb uwsgi[305]: clock source: unix
Jan 15 01:24:03 vps-356d03eb uwsgi[305]: pcre jit disabled
Jan 15 01:24:03 vps-356d03eb uwsgi[305]: detected number of CPU cores: 2
Jan 15 01:24:03 vps-356d03eb uwsgi[305]: current working directory: /
Jan 15 01:24:03 vps-356d03eb uwsgi[305]: detected binary path: /usr/bin/uwsgi
Jan 15 01:24:03 vps-356d03eb uwsgi[305]: setgid() to 969
Jan 15 01:24:03 vps-356d03eb uwsgi[305]: setuid() to 969
Jan 15 01:24:03 vps-356d03eb uwsgi[305]: chdir() to /var/lib/nextcloud/data
Jan 15 01:24:03 vps-356d03eb uwsgi[305]: your processes number limit is 15241
Jan 15 01:24:03 vps-356d03eb uwsgi[305]: your memory page size is 4096 bytes
Jan 15 01:24:03 vps-356d03eb uwsgi[305]: detected max file descriptor number: 1024
Jan 15 01:24:03 vps-356d03eb uwsgi[305]: lock engine: pthread robust mutexes
Jan 15 01:24:03 vps-356d03eb uwsgi[305]: thunder lock: disabled (you can enable it with --thunder-lock)
Jan 15 01:24:03 vps-356d03eb uwsgi[305]: uwsgi socket 0 bound to UNIX address /run/nextcloud/nextcloud.sock fd 4
Jan 15 01:24:03 vps-356d03eb uwsgi[305]: your server socket listen backlog is limited to 100 connections
Jan 15 01:24:03 vps-356d03eb uwsgi[305]: your mercy for graceful operations on workers is 60 seconds
Jan 15 01:24:03 vps-356d03eb uwsgi[305]: mapped 802120 bytes (783 KB) for 10 cores
Jan 15 01:24:03 vps-356d03eb uwsgi[305]: *** Operational MODE: preforking ***
Jan 15 01:24:03 vps-356d03eb uwsgi[305]: *** no app loaded. going in full dynamic mode ***
Jan 15 01:24:03 vps-356d03eb uwsgi[305]: *** uWSGI is running in multiple interpreter mode ***
Jan 15 01:24:03 vps-356d03eb uwsgi[305]: spawned uWSGI master process (pid: 305)
Jan 15 01:24:03 vps-356d03eb systemd[1]: Started uWSGI service unit.
Jan 15 01:24:03 vps-356d03eb uwsgi[305]: spawned uWSGI worker 1 (pid: 318, cores: 1)
Jan 15 01:24:03 vps-356d03eb uwsgi[305]: spawned uWSGI worker 2 (pid: 319, cores: 1)
Jan 15 01:24:03 vps-356d03eb uwsgi[305]: spawned uWSGI worker 3 (pid: 320, cores: 1)
Jan 15 01:24:03 vps-356d03eb uwsgi[305]: spawned uWSGI worker 4 (pid: 321, cores: 1)
Jan 15 01:24:12 vps-356d03eb uwsgi[321]: -- unavailable modifier requested: 14 --
Jan 15 01:34:14 vps-356d03eb uwsgi[305]: workers have been inactive for more than 600 seconds (1673742854-1673742253)
Jan 15 01:34:14 vps-356d03eb uwsgi[305]: SIGINT/SIGTERM received...killing workers...
Jan 15 01:34:15 vps-356d03eb uwsgi[305]: worker 1 buried after 1 seconds
Jan 15 01:34:15 vps-356d03eb uwsgi[305]: worker 2 buried after 1 seconds
Jan 15 01:34:15 vps-356d03eb uwsgi[305]: worker 3 buried after 1 seconds
Jan 15 01:34:15 vps-356d03eb uwsgi[305]: worker 4 buried after 1 seconds
Jan 15 01:34:15 vps-356d03eb uwsgi[305]: goodbye to uWSGI.
Jan 15 01:34:15 vps-356d03eb kill[782]: kill: not enough arguments
Jan 15 01:34:15 vps-356d03eb systemd[1]: uwsgi@nextcloud.service: Control process exited, code=exited, status=1/FAILURE
Jan 15 01:34:15 vps-356d03eb systemd[1]: uwsgi@nextcloud.service: Failed with result 'exit-code'.
Jan 15 01:34:15 vps-356d03eb systemd[1]: uwsgi@nextcloud.service: Scheduled restart job, restart counter is at 1.
Jan 15 01:34:15 vps-356d03eb systemd[1]: Stopped uWSGI service unit.
Jan 15 01:34:15 vps-356d03eb systemd[1]: Starting uWSGI service unit...
Jan 15 01:34:15 vps-356d03eb uwsgi[787]: [uWSGI] getting INI configuration from /etc/uwsgi/nextcloud.ini
Jan 15 01:34:15 vps-356d03eb uwsgi[787]: /usr/lib/uwsgi/php_legacy_plugin.so: undefined symbol: php_legacy_plugin
Jan 15 01:34:15 vps-356d03eb uwsgi[787]: *** Starting uWSGI 2.0.21 (64bit) on [Sun Jan 15 01:34:15 2023] ***
Jan 15 01:34:15 vps-356d03eb uwsgi[787]: compiled with version: 12.2.0 on 19 December 2022 07:58:43
Jan 15 01:34:15 vps-356d03eb uwsgi[787]: os: Linux-6.1.5-arch2-1 #1 SMP PREEMPT_DYNAMIC Thu, 12 Jan 2023 22:42:33 +0000
Jan 15 01:34:15 vps-356d03eb uwsgi[787]: nodename: vps-356d03eb
Jan 15 01:34:15 vps-356d03eb uwsgi[787]: machine: x86_64
Jan 15 01:34:15 vps-356d03eb uwsgi[787]: clock source: unix
Jan 15 01:34:15 vps-356d03eb uwsgi[787]: pcre jit disabled
Jan 15 01:34:15 vps-356d03eb uwsgi[787]: detected number of CPU cores: 2
Jan 15 01:34:15 vps-356d03eb uwsgi[787]: current working directory: /
Jan 15 01:34:15 vps-356d03eb uwsgi[787]: detected binary path: /usr/bin/uwsgi
Jan 15 01:34:15 vps-356d03eb uwsgi[787]: setgid() to 969
Jan 15 01:34:15 vps-356d03eb uwsgi[787]: setuid() to 969
Jan 15 01:34:15 vps-356d03eb uwsgi[787]: chdir() to /var/lib/nextcloud/data
Jan 15 01:34:15 vps-356d03eb uwsgi[787]: your processes number limit is 15241
Jan 15 01:34:15 vps-356d03eb uwsgi[787]: your memory page size is 4096 bytes
Jan 15 01:34:15 vps-356d03eb uwsgi[787]: detected max file descriptor number: 1024
Jan 15 01:34:15 vps-356d03eb uwsgi[787]: lock engine: pthread robust mutexes
Jan 15 01:34:15 vps-356d03eb uwsgi[787]: thunder lock: disabled (you can enable it with --thunder-lock)
Jan 15 01:34:15 vps-356d03eb uwsgi[787]: uwsgi socket 0 bound to UNIX address /run/nextcloud/nextcloud.sock fd 4
Jan 15 01:34:15 vps-356d03eb uwsgi[787]: your server socket listen backlog is limited to 100 connections
Jan 15 01:34:15 vps-356d03eb uwsgi[787]: your mercy for graceful operations on workers is 60 seconds
Jan 15 01:34:15 vps-356d03eb uwsgi[787]: mapped 802120 bytes (783 KB) for 10 cores
Jan 15 01:34:15 vps-356d03eb uwsgi[787]: *** Operational MODE: preforking ***
Jan 15 01:34:15 vps-356d03eb uwsgi[787]: *** no app loaded. going in full dynamic mode ***
Jan 15 01:34:15 vps-356d03eb uwsgi[787]: *** uWSGI is running in multiple interpreter mode ***
Jan 15 01:34:15 vps-356d03eb uwsgi[787]: spawned uWSGI master process (pid: 787)
Jan 15 01:34:15 vps-356d03eb systemd[1]: Started uWSGI service unit.
Jan 15 01:34:15 vps-356d03eb uwsgi[787]: spawned uWSGI worker 1 (pid: 788, cores: 1)
Jan 15 01:34:15 vps-356d03eb uwsgi[787]: spawned uWSGI worker 2 (pid: 789, cores: 1)
Jan 15 01:34:15 vps-356d03eb uwsgi[787]: spawned uWSGI worker 3 (pid: 790, cores: 1)
Jan 15 01:34:15 vps-356d03eb uwsgi[787]: spawned uWSGI worker 4 (pid: 791, cores: 1)
Jan 15 01:40:24 vps-356d03eb uwsgi[791]: -- unavailable modifier requested: 14 --
[lli@vps-356d03eb ~]$
Comment by David Runge (dvzrv) - Sunday, 15 January 2023, 11:55 GMT
Thanks for testing!

This here is likely the culprit:

```
Jan 15 01:34:15 vps-356d03eb uwsgi[787]: /usr/lib/uwsgi/php_legacy_plugin.so: undefined symbol: php_legacy_plugin
```

I don't quite understand yet why this is happening though.
Comment by zoltix (zoltix) - Sunday, 15 January 2023, 14:39 GMT
I made a rollback of the packets
from (https://archive.archlinux.org/packages/)
pacman -U php-8.1.13-4-x86_64.pkg.tar.zst
pacman -U php-imagick-3.7.0-2-x86_64.pkg.tar.zst
pacman -U uwsgi-plugin-php-2.0.21-2-x86_64.pkg.tar.zst
pacman -U nextcloud-25.0.2-1-any.pkg.tar.zst
pacman -U php-embed-8.1.13-4-x86_64.pkg.tar.zst
pacman -U php-intl-8.1.13-4-x86_64.pkg.tar.zst
pacman -U php-gd-8.1.13-4-x86_64.pkg.tar.zst
pacman -U php-apcu-5.1.22-2-x86_64.pkg.tar.zst


and I have temporarily excluded the updates
in /etc/pacman.conf
IgnorePkg = nextcloud php uwsgi uwsgi-plugin-php php-legacy-gd php-apcu php-embed php-gd php-imagick

And Waiting for latest patches.

Comment by zoltix (zoltix) - Sunday, 15 January 2023, 14:41 GMT
and nextcloud is online again(https://cloud-dev.lli.be/)
Comment by zoltix (zoltix) - Sunday, 15 January 2023, 21:21 GMT
I saw that there were some changes on the wiki https://wiki.archlinux.org/title/Nextcloud#Migrating_to_php-legacy
I followed the instructions. I send you my config files in case of.
but I still get the error This version of Nextcloud is not compatible with PHP>=8.2.
You are currently running 8.2.1..

modified files :
/etc/uwsgi/nextcloud.ini
/etc/webapps/nextcloud/php.ini
/etc/systemd/system/php-legacy-fpm.service.d/override.conf
/etc/nginx/sites-available/nextcloud.conf


What can I do to find the solution and help you?
Comment by Pierre Schmitz (Pierre) - Monday, 16 January 2023, 17:44 GMT
I have just uploaded uwsgi-plugin-php-legacy-2.0.21-5 to [community-testing]. In combination with php-legacy-embed-8.1.14-3 I am at least able to start uwsgi. uwsgi then correctly prints "PHP 8.1.14 initialized".
Comment by zoltix (zoltix) - Monday, 16 January 2023, 18:02 GMT
well done. it's working.
https://cloud-dev.lli.be/index.php/login

I'm waiting to put these packages in community before I apply on prod server.
thanks a lot
Comment by Pierre Schmitz (Pierre) - Monday, 16 January 2023, 18:04 GMT
Thanks for testing! I'll move these to the stable repos then as it probably cannot be more broken than those. Sorry for the hassle.
Comment by zoltix (zoltix) - Monday, 16 January 2023, 18:07 GMT
no problem 👍 and thanks for the support and all
Comment by zoltix (zoltix) - Tuesday, 17 January 2023, 07:31 GMT
All are ok.
https://imgur.com/a/OD05sMU
Thanks for support

Loading...