OPNsense Forum

English Forums => 26.7 Series => Topic started by: Smoky020 on July 15, 2026, 06:26:58 PM

Title: Startup: Unable to load dynamic library 'mongodb.so'
Post by: Smoky020 on July 15, 2026, 06:26:58 PM
Hi there, after the upgrade to 26.7 I get multiple times per second the following crashmessage
[15-Jul-2026 16:16:04 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'mongodb.so' (tried: /usr/local/lib/php/20250925/mongodb.so (Cannot open "/usr/local/lib/php/20250925/mongodb.so"), /usr/local/lib/php/20250925/mongodb.so.so (Cannot open "/usr/local/lib/php/20250925/mongodb.so.so")) in Unknown on line 0


I did uninstall ZA + the repository just to be sure it wasn't the cause, rebooted but still get the same warning multiple times every second.
I also found this topic
https://forum.opnsense.org/index.php?topic=52379.0

Though not the same error but there it also reports problems with mongodb. Could be coincidence of course. Any clue which plugin might be causing this or what troubleshooting steps can be taken? I checked the known issues so to be sure it wasnt ZA I removed all components.

User-Agent Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Safari/537.36 Edg/150.0.0.0
FreeBSD 15.1-RELEASE-p1 stable/26.7-n283674-12334a596709 SMP amd64
OPNsense 26.7 821598263
Plugins os-acme-client-4.16_1 os-bind-1.34_3 os-clamav-1.8.1 os-cpu-microcode-intel-1.1 os-etpro-telemetry-1.8_1 os-freeradius-1.10.2 os-igmp-proxy-1.5_6 os-nextcloud-backup-1.2 os-nginx-1.36_3 os-postfix-1.24.1 os-redis-1.1_4 os-rspamd-1.13_2 os-smart-2.4 os-wazuh-agent-1.3_1
Time Wed, 15 Jul 2026 18:16:44 +0200
OpenSSL 3.5.7
Python 3.13.14
PHP 8.5.8
Title: Re: Startup: Unable to load dynamic library 'mongodb.so'
Post by: franco on July 15, 2026, 07:18:16 PM
# pkg remove php83-pecl-mongodb

Disclaimer: we never install this package and we never recommend installing it without the automatic flag and a proper top level package depending on it indirectly to avoid such problems.


Cheers,
Franco
Title: Re: Startup: Unable to load dynamic library 'mongodb.so'
Post by: Smoky020 on July 15, 2026, 07:28:03 PM
Thanks Franco that cleared the warning but strange that it got installed in the first place if it isn't coming from Opnsense. Must have been one of the plugins i am running I guess. Never installed any tools or whatever.
Oh well..

It's gone now :)
Title: Re: Startup: Unable to load dynamic library 'mongodb.so'
Post by: franco on July 15, 2026, 07:33:01 PM
It's from Zenarmor.
Title: Re: Startup: Unable to load dynamic library 'mongodb.so'
Post by: Smoky020 on July 15, 2026, 07:35:31 PM
Ah that explains. Thanks
Title: Re: Startup: Unable to load dynamic library 'mongodb.so'
Post by: dinguz on July 15, 2026, 07:38:42 PM
Worth adding some context here: MongoDB support in Zenarmor isn't pending deprecation, it's already gone. As of Zenarmor 2.5 (September 2025), both MongoDB and Elasticsearch 5 were dropped as reporting backends, and new installs no longer offer MongoDB as an option at all. That's probably why this warning shows up on some 26.7 upgrades: php83-pecl-mongodb is a leftover dependency from an older Zenarmor version that used to require it, not something anyone installs on purpose (as Franco noted, OPNsense never installs it directly). Anyone still running the old MongoDB backend should migrate to SQLite for small setups or Elasticsearch 8 for larger ones (8GB+ RAM recommended for ES).
Title: Re: Startup: Unable to load dynamic library 'mongodb.so'
Post by: heaven73 on July 16, 2026, 07:49:42 AM
i also had the issue the package was of an earlier zenarmor installation i dont use anymore .
opnsense 26.7 i noticed uses now php 8.5 and the package provoking this error is this one:

pkg info | grep -i mongodb
pkg: warning: database version 37 is newer than libpkg(3) version 36, but still compatible
php83-pecl-mongodb-1.21.0      PECL classes for MongoDB

since i have nothing which uses mongo anymore and Franco stated its not used i removed this old php83 module with mongo:

 pkg delete php83-pecl-mongodb

and by restarting the gui

configctl webgui restart

no error appeared anymore.

so you need ssh or console access for this way to remove the issue.

hope was helpful
Title: Re: Startup: Unable to load dynamic library 'mongodb.so'
Post by: franco on July 16, 2026, 08:09:08 AM
> pkg: warning: database version 37 is newer than libpkg(3) version 36, but still compatible

This tells me you had the FreeBSD pkg version installed.  Have to be very careful with that.


Cheers,
Franco