php-legacy-mongodb-2.0.0-1 => Fatal error: ... BSONArray.php on line 74
Arch devs, After update tonight of php-legacy-mongodb-2.0.0-1-x86_64.pkg.tar.zst, accessing mongodb through PHP results in the error: [Sat Apr 12 01:25:20.286158 2025] [php:error] [pid 685:tid 685] [client 192.168.6.224:53078] PHP Fatal error: Declaration of MongoDB\\Model\\BSONArray::bsonSerialize() must be compatible with MongoDB\\BSON\\Serializable::bsonSerialize(): stdClass|MongoDB\\BSON\\Document|MongoDB\\BSON\\PackedArray|array in /srv/http/vendor/mongodb/mongodb/src/Model/BSONArray.php on line 74, referer: https://2pi.3111skyline.com/tmp/db/jnl-grid/ This has never happened before and it is pointing to one of the package files. I updated all composer mongodb/mongodb files thinking that may help. It didn't. I also built php-legacy-mongodb from: https://gitlab.archlinux.org/archlinux/packaging/packages/php-mongodb/-/tree... And downgraded, restarted httpd and everything works fine again. New bug or is there some known break with backwards compatibility? The changelog on Serializable::bsonSerialize makes no mention of a break: https://www.php.net/manual/en/mongodb-bson-serializable.bsonserialize.php -- David C. Rankin, J.D.,P.E.
On 4/12/25 2:21 AM, David C Rankin wrote:
New bug or is there some known break with backwards compatibility? The changelog on Serializable::bsonSerialize makes no mention of a break:
https://www.php.net/manual/en/mongodb-bson-serializable.bsonserialize.php
This appears to be an upstream bug. There is no changes mentioned or suggested https://www.mongodb.com/docs/drivers/php-drivers/ and all package versions are 100% supported. I've opened a forum request upstream. There is an issue in php-legacy-mongodb-2.0.0 that does not play nicely with the driver. I ensured that the driver (and composer) were updated. The actual driver files installed by composer have not changed since 9/24/24. -- David C. Rankin, J.D.,P.E.
participants (1)
-
David C Rankin