Call to undefined function lib\\core\mb_strlen()

Hi everyone (tagging @Teodor as my production is down).

I did a small upgrade to an app this morning (I am using cloudfoundry, and I need to manually copy/paste the files to my production folder, I never had a major issue until now) and since, any serverside action (php) that counts the length of a field returns a 500 error.

  "code": 0,
  "file": "/home/vcap/app/htdocs/dmxConnectLib/lib/formatters/text.php",
  "line": 154,
  "message": "Call to undefined function lib\\core\\mb_strlen()",
  "trace": "#0 [internal function]: lib\\core\\formatter_length('338805')\n#1 /home/vcap/app/htdocs/dmxConnectLib/lib/core/Parser.php(419): call_user_func_array('\\\\lib\\\\core\\\\forma...', Array)\n#2 /home/vcap/app/htdocs/dmxConnectLib/lib/core/Parser.php(372): lib\\core\\Parser->objectMember(Object(Closure))\n#3 /home/vcap/app/htdocs/dmxConnectLib/lib/core/Parser.php(314): lib\\core\\Parser->primary()\n#4 /home/vcap/app/htdocs/dmxConnectLib/lib/core/Parser.php(291): lib\\core\\Parser->group()\n#5 /home/vcap/app/htdocs/dmxConnectLib/lib/core/Parser.php(271): lib\\core\\Parser->unary()\n#6 /home/vcap/app/htdocs/dmxConnectLib/lib/core/Parser.php(261): lib\\core\\Parser->multiplicative()\n#7 /home/vcap/app/htdocs/dmxConnectLib/lib/core/Parser.php(251): lib\\core\\Parser->addictive()\n#8 /home/vcap/app/htdocs/dmxConnectLib/lib/core/Parser.php(241): lib\\core\\Parser->bitwiseShift()\n#9 /home/vcap/app/htdocs/dmxConnectLib/lib/core/Parser.php(231): lib\\core\\Parser->relational()\n#10 /home/vcap/app/htdocs/dmxConnectLib/lib/core/Parser.php(221): lib\\core\\Parser->equality()\n#11 /home/vcap/app/htdocs/dmxConnectLib/lib/core/Parser.php(211): lib\\core\\Parser->bitwiseAnd()\n#12 /home/vcap/app/htdocs/dmxConnectLib/lib/core/Parser.php(201): lib\\core\\Parser->bitwiseXor()\n#13 /home/vcap/app/htdocs/dmxConnectLib/lib/core/Parser.php(191): lib\\core\\Parser->bitwiseOr()\n#14 /home/vcap/app/htdocs/dmxConnectLib/lib/core/Parser.php(179): lib\\core\\Parser->logicalAnd()\n#15 /home/vcap/app/htdocs/dmxConnectLib/lib/core/Parser.php(163): lib\\core\\Parser->logicalOr()\n#16 /home/vcap/app/htdocs/dmxConnectLib/lib/core/Parser.php(159): lib\\core\\Parser->conditional()\n#17 /home/vcap/app/htdocs/dmxConnectLib/lib/core/Parser.php(104): lib\\core\\Parser->expression()\n#18 /home/vcap/app/htdocs/dmxConnectLib/lib/App.php(258): lib\\core\\Parser->parse('lookup_escalati...', NULL)\n#19 /home/vcap/app/htdocs/dmxConnectLib/lib/App.php(237): lib\\App->parseObject('{{lookup_escala...', NULL)\n#20 /home/vcap/app/htdocs/dmxConnectLib/modules/core.php(137): lib\\App->parseObject(Object(stdClass))\n#21 /home/vcap/app/htdocs/dmxConnectLib/lib/App.php(204): modules\\core->setvalue(Object(stdClass), 'ticket_length', Array)\n#22 /home/vcap/app/htdocs/dmxConnectLib/lib/App.php(176): lib\\App->execSteps(Object(stdClass))\n#23 /home/vcap/app/htdocs/dmxConnectLib/lib/App.php(144): lib\\App->execSteps(Array)\n#24 /home/vcap/app/htdocs/dmxConnectLib/lib/App.php(133): lib\\App->exec(Object(stdClass), false)\n#25 /home/vcap/app/htdocs/dmxConnectLib/lib/App.php(111): lib\\App->exec(Object(stdClass))\n#26 /home/vcap/app/htdocs/dmxConnect/api/Escalations/vmap_check.php(8): lib\\App->define(Object(stdClass))\n#27 {main}"
}

I’ve checked \lib\core\mb_strlen() and the files are identical, and I cannot reproduce the issue on my dev environment.

Would you have a suggestion on how to finger point the issue further? The php buildbpack deployed is 7.4.27.

Thanks!
Nathaniel

See maybe:

1 Like

Thanks @George, it would make sense it could be a platform limitation since none of the changes I’ve made seem to correlate.

Just check the PHP manual explaining how to install/enable mbstring:

https://www.php.net/manual/en/mbstring.installation.php

1 Like

You’ve both been lifesavers. Someone made changes to the phpbuildpack on CloudFoundry - I declared the extension (https://docs.cloudfoundry.org/buildpacks/php/gsg-php-config.html) and things seem to work again.

Thanks again.

1 Like