Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Unable to load dynamic library 'mbstring.so'

    General pfSense Questions
    2
    6
    1.3k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      molinard
      last edited by

      Hello, I upgraded yesterday to pfSense Plus 22.05-RELEASE (arm) running on Netgate-SG3100 and since then, I am enable to access the GUI

      Once I authenticate with the Web GUI interface, I get the below error message:

      Fatal error: Uncaught Error: Call to undefined function Nette\Utils\mb_strtolower() in /usr/local/pfSense/include/vendor/nette/utils/src/Utils/Strings.php:261 Stack trace: #0 /usr/local/pfSense/include/vendor/nette/utils/src/Utils/Strings.php(320): Nette\Utils\Strings::lower('/') #1 /usr/local/pfSense/include/Services/Filesystem/Provider/SystemProvider.php(74): Nette\Utils\Strings::compare('/', '/var/run') #2 /usr/local/pfSense/include/Services/Filesystem/Provider/SystemProvider.php(50): pfSense\Services\Filesystem\Provider\SystemProvider->_getParentFilesystemPath('/') #3 /usr/local/pfSense/include/Services/Filesystem/Filesystems.php(117): pfSense\Services\Filesystem\Provider\SystemProvider->getFilesystems() #4 /usr/local/pfSense/include/Services/Filesystem/Filesystems.php(47): pfSense\Services\Filesystem\Filesystems->_initFilesystems() #5 /usr/local/www/widgets/include/disks.inc(41): pfSense\Services\Filesystem\Filesystems->__construct() #6 /usr/local/www/index.php(83): include_once('/usr/local/www/...') #7 {main} thro in /usr/local/pfSense/include/vendor/nette/utils/src/Utils/Strings.php on line 261 PHP ERROR: Type: 1, File: /usr/local/pfSense/include/vendor/nette/utils/src/Utils/Strings.php, Line: 261, Message: Uncaught Error: Call to undefined function Nette\Utils\mb_strtolower() in /usr/local/pfSense/include/vendor/nette/utils/src/Utils/Strings.php:261 Stack trace: #0 /usr/local/pfSense/include/vendor/nette/utils/src/Utils/Strings.php(320): Nette\Utils\Strings::lower('/') #1 /usr/local/pfSense/include/Services/Filesystem/Provider/SystemProvider.php(74): Nette\Utils\Strings::compare('/', '/var/run') #2 /usr/local/pfSense/include/Services/Filesystem/Provider/SystemProvider.php(50): pfSense\Services\Filesystem\Provider\SystemProvider->_getParentFilesystemPath('/') #3 /usr/local/pfSense/include/Services/Filesystem/Filesystems.php(117): pfSense\Services\Filesystem\Provider\SystemProvider->getFilesystems() #4 /usr/local/pfSense/include/Services/Filesystem/Filesystems.php(47): pfSense\Services\Filesystem\Filesystems->_initFilesystems() #5 /usr/local/www/widgets/include/disks.inc(41): pfSense\Services\Filesystem\Filesystems->__construct() #6 /usr/local/www/index.php(83): include_once('/usr/local/www/...') #7 {main} thro

      Accessing the console, the mbstring library (providing the mb_strtolower function) failed to load with the following error:

      Warning: PHP Startup: Unable to load dynamic library 'mbstring.so' (tried: /usr/local/lib/php/20190902/mbstring.so (/usr/local/lib/php/20190902/mbstring.so: Undefined symbol "OnigSyntaxPerl"), /usr/local/lib/php/20190902/mbstring.so.so (/usr/local/lib/php/20190902/mbstring.so.so: invalid file format)) in Unknown on line 0

      I forced a reinstall of all required php libraries but this unfortunately did not solve the problem. Before spending more time troubleshooting this, I am keen to see if anyone had the same issue.

      Thank you!

      GertjanG 1 Reply Last reply Reply Quote 0
      • M
        molinard
        last edited by

        Forcing re-install of php74-mbstring and oniguruma php pkg and rebooting the machine solved the issue and I can now access the Web GUI:

        pkg install -f php74-mbstring
        pkg install -f oniguruma

        1 Reply Last reply Reply Quote 1
        • GertjanG
          Gertjan @molinard
          last edited by

          @molinard said in Unable to load dynamic library 'mbstring.so':

          I upgraded yesterday

          Check the upgrade log to see what went wrong.
          Or : what did you saw on the screen during upgrading ?

          @molinard said in Unable to load dynamic library 'mbstring.so':

          pkg install -f oniguruma

          Why ?

          No "help me" PM's please. Use the forum, the community will thank you.
          Edit : and where are the logs ??

          M 1 Reply Last reply Reply Quote 0
          • M
            molinard @Gertjan
            last edited by

            @gertjan the PHP mbstring.so library (which provides mb_strtolower function invoked by pfSense on initialisation) failed because OnigSyntaxPerl was undefined as per the error. OnigSyntaxPerl I believe was used by oniguruma library.

            While troubleshooting, I also noticed mbstring binaries mbstring.so and mbstring.so.so were empty (file exist, size 0)

            So I forced reloaded both php libraries which appears to have fixed my issue. Post force reload, mbstring binaries are as followed:
            -rw-r--r-- 1 root wheel 1004320 Jun 2 06:34 mbstring.so
            -rw------- 1 root wheel 0 Jul 23 10:42 mbstring.so.so

            On your first question, I did not think looking at the pfSense upgrade logs (and I did not check them post upgrade). I briefly scanned through them but there wasn't any obvious errors during the upgrade itself (note I never looked at these logs in details):

            Jul 23 10:20:18 pfSense php-fpm[740]: /pkg_mgr_install.php: Configuration Change: admin@192.168.101.244 (Local Database): Creating restore point before upgrade.
            Jul 23 10:20:18 pfSense check_reload_status[399]: Syncing firewall
            Jul 23 10:20:36 pfSense suricata[32367]: [1:2210054:1] SURICATA STREAM excessive retransmissions [Classification: Generic Protocol Command Decode] [Priority: 3] {TCP} 192.168.1.2:16771 -> 17.253.67.204:
            443
            Jul 23 10:20:36 pfSense suricata[32367]: [1:2210054:1] SURICATA STREAM excessive retransmissions [Classification: Generic Protocol Command Decode] [Priority: 3] {TCP} 192.168.1.2:19842 -> 17.253.67.204:
            443
            Jul 23 10:20:38 pfSense pkg-static[62491]: pfSense-upgrade upgraded: 1.0_12 -> 1.0_26
            Jul 23 10:20:38 pfSense suricata[32367]: [1:2210054:1] SURICATA STREAM excessive retransmissions [Classification: Generic Protocol Command Decode] [Priority: 3] {TCP} 192.168.1.2:13509 -> 17.253.67.204:
            443
            Jul 23 10:21:11 pfSense php-fpm[740]: /firewall_rules.php: Configuration Change: admin@192.168.101.244 (Local Database): Firewall: Rules - enabled a firewall rule.
            Jul 23 10:21:11 pfSense check_reload_status[399]: Syncing firewall
            Jul 23 10:21:14 pfSense php-fpm[28603]: /firewall_rules.php: Configuration Change: admin@192.168.101.244 (Local Database): Firewall: Rules - disabled a firewall rule.
            Jul 23 10:21:14 pfSense check_reload_status[399]: Syncing firewall
            Jul 23 10:21:16 pfSense check_reload_status[399]: Reloading filter
            Jul 23 10:22:59 pfSense suricata[32367]: [1:2210007:2] SURICATA STREAM 3way handshake SYNACK with wrong ack [Classification: Generic Protocol Command Decode] [Priority: 3] {TCP} 17.253.144.10:443 -> 192
            .168.1.2:14646
            Jul 23 10:22:59 pfSense suricata[32367]: [1:2210007:2] SURICATA STREAM 3way handshake SYNACK with wrong ack [Classification: Generic Protocol Command Decode] [Priority: 3] {TCP} 17.253.144.10:443 -> 192
            .168.1.2:38384
            Jul 23 10:26:00 pfSense sshguard[98822]: Exiting on signal.
            Jul 23 10:26:00 pfSense sshguard[84225]: Now monitoring attacks.
            Jul 23 10:29:11 pfSense pkg-static[518]: pfSense-rc upgraded: 22.01 -> 22.05
            Jul 23 10:29:57 pfSense pkg-static[3133]: pfSense-kernel-pfSense-3100 upgraded: 22.01 -> 22.05
            Jul 23 10:30:04 pfSense check_reload_status[399]: Reloading filter
            Jul 23 10:30:05 pfSense check_reload_status[399]: Starting packages
            Jul 23 10:30:06 pfSense php-fpm[92508]: /rc.start_packages: Restarting/Starting all packages.
            Jul 23 10:30:07 pfSense php-fpm[92508]: /rc.start_packages: Configuration Change: (system): Removed cron job for snort2c
            Jul 23 10:30:07 pfSense check_reload_status[399]: Syncing firewall
            Jul 23 10:30:07 pfSense php-fpm[92508]: /rc.start_packages: Configuration Change: (system): Installed cron job for /usr/bin/nice -n20 /sbin/pfctl -q -t snort2c -T expire 3600
            Jul 23 10:30:08 pfSense check_reload_status[399]: Syncing firewall
            Jul 23 10:30:08 pfSense php-fpm[92508]: /rc.start_packages: Configuration Change: (system): Removed cron job for snort2c
            Jul 23 10:30:09 pfSense php-fpm[92508]: /rc.start_packages: Configuration Change: (system): Installed cron job for /usr/bin/nice -n20 /sbin/pfctl -q -t snort2c -T expire 900
            Jul 23 10:30:09 pfSense check_reload_status[399]: Syncing firewall
            Jul 23 10:30:15 pfSense reboot[28629]: rebooted by root
            Jul 23 10:30:16 pfSense syslogd: exiting on signal 15
            Jul 23 10:38:50 pfSense syslogd: kernel boot file is /boot/kernel/kernel
            Jul 23 10:38:50 pfSense kernel: ---<<BOOT>>---
            Jul 23 10:38:50 pfSense kernel: Copyright (c) 1992-2021 The FreeBSD Project.

            So it looks like some php packages failed to load but the upgrade continued (a very broad guess). On a side note, I have a VPN configured and once noticed that some remote package directory sometimes block pull of packages presumably because the request origin is blacklisted.

            GertjanG 1 Reply Last reply Reply Quote 0
            • GertjanG
              Gertjan @molinard
              last edited by

              @molinard said in Unable to load dynamic library 'mbstring.so':

              -rw------- 1 root wheel 0 Jul 23 10:42 mbstring.so.so

              Never saw or used a "so.so" file - it's not needed.
              This is the place, right : /usr/local/lib/php/20190902/ ?

              Still, I'm using 22.05 and no oniguruma.so for me. I wonder who is using that PHP extension.

              Btw : when upgrading, I would take VPN and Suricata off line ... ;)

              No "help me" PM's please. Use the forum, the community will thank you.
              Edit : and where are the logs ??

              M 1 Reply Last reply Reply Quote 0
              • M
                molinard @Gertjan
                last edited by

                @gertjan yes, /usr/local/lib/php/20190902 is the location.

                I also saw that Netgate mentioned about potential PHP errors in their upgrade documentation: Upgrading from versions older than pfSense 2.5.0

                My previous upgrade worked fine with the VPN and Suricata so it might not be the root cause (in fact, this is the fist time I have an issue with the upgrade). I'll monitor this for the next upgrades.

                Either way, everything is working fine for now. Thank you for checking!

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.