Z-Push with Zimbra backend PHP 8.0 not working
-
Hello there,
I recently migrated my Zimbra installation from CentOS to Ubuntu 18.04 (worked fine) and also decided to give PHP 8.0 a try as the Z-Push developer was able to fix some issues -> https://sourceforge.net/p/zimbrabackend/feature-requests/27/BUT unfortunately it seems that Z-Push itself is having some issues as I get following error
08/10/2021 21:42:51 [19639] [FATAL] [email-address] Fatal error: /usr/share/z-push/backend/ipcsharedmemory/ipcsharedmemoryprovider.php:45 - Uncaught Error: Object of class SysvSemaphore could not be converted to string in /usr/share/z-push/backend/ipcsharedmemory/ipcsharedmemoryprovider.php:45 Stack trace: #0 /usr/share/z-push/backend/ipcsharedmemory/ipcsharedmemoryprovider.php(45): sprintf() #1 /usr/share/z-push/lib/core/interprocessdata.php(93): IpcSharedMemoryProvider->__construct() #2 /usr/share/z-push/lib/core/topcollector.php(49): InterProcessData->__construct() #3 /usr/share/z-push/lib/core/zpush.php(538): TopCollector->__construct() #4 /usr/share/z-push/lib/core/devicemanager.php(87): ZPush::GetTopCollector() #5 /usr/share/z-push/lib/core/zpush.php(510): DeviceManager->__construct() #6 /usr/share/z-push/lib/default/backend.php(316): ZPush::GetDeviceManager() #7 /usr/share/z-push/backend/zimbra/zimbra.php(985): Backend->InitializePermanentStorage() #8 /usr/share/z-push/lib/request/requestprocessor.php(68): BackendZimbra->Logon() #9 /usr/share/z-push/index.php(86): RequestProcessor::Authenticate() #10 {main} thrown (1)
When reenabling PHP 7.3 it worked without any issues.
Beside the IPC Sharedstorage I have also tried to use IPC Memcached but this does also not work.
Are there any planned development to have PHP 8.0 officially supported by Z-Push?
-
There is a existing Jira ticket with this issue, but nobody fixed it yet.
I am willing to help, but I do not know, if pull requests from the community are welcome anymore.Can you post the error you experienced with IPC Memcached too?
-
@bob4os hi there!
Unfortunately I cannot find any details in my historical logs (even from backups) but as far as I have in mind the log entries for IPC memcached looked like this:08/10/2021 22:27:13 [ 462] [WARN] [emailaddress@emaildomain.tld] Zimbra->GetUserInfo(): Overriding ZIMBRA_URL [https://mail.emaildomain.tld] from config.php with ZIMBRA publicURL [https://mail.emaildomain.tld:8443] 08/10/2021 22:27:13 [ 462] [WARN] [emailaddress@emaildomain.tld] Zimbra->GetUserInfo(): Overriding Logon URL [https://mail.emaildomain.tld/service/soap/] with ZIMBRA soapURL [https://mail.emaildomain.tld:8443/service/soap/] 08/10/2021 22:27:13 [31653] [WARN] [emailaddress@emaildomain.tld] Zimbra->GetUserInfo(): Overriding ZIMBRA_URL [https://mail.emaildomain.tld] from config.php with ZIMBRA publicURL [https://mail.emaildomain.tld:8443] 08/10/2021 22:27:13 [31653] [WARN] [emailaddress@emaildomain.tld] Zimbra->GetUserInfo(): Overriding Logon URL [https://mail.emaildomain.tld/service/soap/] with ZIMBRA soapURL [https://mail.emaildomain.tld:8443/service/soap/] 08/10/2021 22:27:13 [31010] [WARN] [emailaddress@emaildomain.tld] Zimbra->GetUserInfo(): Overriding ZIMBRA_URL [https://mail.emaildomain.tld] from config.php with ZIMBRA publicURL [https://mail.emaildomain.tld:8443] 08/10/2021 22:27:13 [31010] [WARN] [emailaddress@emaildomain.tld] Zimbra->GetUserInfo(): Overriding Logon URL [https://mail.emaildomain.tld/service/soap/] with ZIMBRA soapURL [https://mail.emaildomain.tld:8443/service/soap/] 08/10/2021 22:27:13 [30707] [WARN] [emailaddress@emaildomain.tld] Zimbra->GetUserInfo(): Overriding ZIMBRA_URL [https://mail.emaildomain.tld] from config.php with ZIMBRA publicURL [https://mail.emaildomain.tld:8443]``` A lot of same entries within a really short period of time (couple of seconds). I stopped the Apache service after that.
-
The question I ask myself: Is Z-Push (independently of the backend) still only able to support PHP 7.3 or is it just because of the Zimbra backend?
If it’s a PHP 7.3 issue then it might get a problem as the PHP version will be out of support in short future.
-
Use PHP 7.4 - no issues there in my setup.
-
@bob4os with Zimbra backend?
-
Okay tried it myself and seems to work with PHP 7.4 - nevertheless we should keep in mind that PHP 7.4 has active support until 28 November 2021 and security support until 28 November 2022.
SourceThis gives us a year time until PHP 7.4 is no longer patched.
-
I’m using the combined backend with caldav, carddav, imap, stickynotes and searchldap for GAL.
Yes, PHP 8 will be mandatory in a year. -
Change (/usr/share/z-push)backend/ipcsharedmemoryprovider.php:45 as follows:
if ($this->initSharedMem()) ZLog::Write(LOGLEVEL_DEBUG, sprintf("%s(): Initialized %s and %s.", $class, $this->mutexid::class, $this->memid::class));
Using backends kopano, ipcsharedmemory and sqlstatemachine, this seems to be the only showstopper for PHP 8.0, sofar.
++umgfoin -
I would definitly not migrate to Ubuntu 18.04 since all packages are already available for Ubuntu 20.04.
Important is that while the installation is happening to deactivate universe repositories to not have a mix with the packages in it.
You can activate it afterwards. And best is to stay if possible on the default system packages of the latest supported OS version since php7.4 is the system default php in Ubuntu 20.04. 18.04 is php7.2.
For php8.0 it will be supported with the support of Ubuntu 22.04, so it will take approx one more year if the development is in the same speed as of now.
-
What is the current status here?
Is there any info yet about PHP 8.X support? -
I did the update because of Ubuntu 22.04:
by now i have had to fix two issues:
- Memcache @umgfoin thanks again for the code ;-)
- in my policies file i had to set maxattsize = -1 in my old version it was set to “” which caused z-push to not work.
It is now somehow working for (outlook (PC), ios, android). But i have been only using it for 4 days.
-
@umgfoin Hello,
I have another issue with PHP8.1. Posted it here recently. 8.0 the same problem. -
@kordian
Which problem are you referring to?
I’m not using the Zimbra-backend, so my PHP8.x-branch might not cover all functions required by this particular backend. -
@umgfoin
https://forum.kopano.io/topic/4047/z-push-php8-1-problem
Seems to be z-push, not the backend problem. -
@kordian said in Z-Push with Zimbra backend PHP 8.0 not working:
Seems to be z-push, not the backend problem.
Might be the case, but hard to debug without having a configured/working Zimbra-backend.
You have to find out, when and why$this->{$map[self::STREAMER_VAR]}
resolves (or implicitely casts) to string although a stream-object is expected in$encoder->contentStream(...)
. -
@umgfoin
Ha, thank you, but I am no programmer, so absolutely no idea what you are talking about :-) -
@umgfoin said in Z-Push with Zimbra backend PHP 8.0 not working:
@kordian said in Z-Push with Zimbra backend PHP 8.0 not working:
Seems to be z-push, not the backend problem.
Might be the case, but hard to debug without having a configured/working Zimbra-backend.
You have to find out, when and why$this->{$map[self::STREAMER_VAR]}
resolves (or implicitely casts) to string although a stream-object is expected in$encoder->contentStream(...)
.Answer from backend:
This error is not in the zimbra backend.The Z-Push core is not tested with PHP 8.0 as yet, never mind PHP 8.1
There are a number of known issues that people have submitted fixes for to the z-push code repository but nobody at Kopano is picking up the pull requests so the code is just left sitting there.
As I said, I have no knowledge to analyse.
-
@kordian said in Z-Push with Zimbra backend PHP 8.0 not working:
The Z-Push core is not tested with PHP 8.0 as yet, never mind PHP 8.1
Ah, I thought, you’re aware of this.
Sure, z–push as of maintainer’s current release 2.6.2 is not PHP8.x ready.It’s certainly not only about testing and I have no information, whether the maintainers currently have time/ resources/ intention to do the necessary work or merge PRs.
My PHP 8.x fork is work in progress and sufficiently stable to serve the kopano-backend (with a PHP8 MAPI-extension), but I never tested it against the requirements of the Zimbra-backend.
++umgfoin.