Skip to content

“Class string does not exists” error – only on production

so here’s the situation.
It is PHP 7.4, Magento 2.4.3-p1

  • On the production server, an error is showing up on the exceptions.log. It reads as follows:
    Class string does not exist at /var/www/public/vendor/magento/framework/Webapi/ErrorProcessor.php:208, ReflectionException(code: -1): Class string does not exist at /var/www/public/vendor/magento/framework/Reflection/MethodsMap.php:166)"} []

  • I happens daily on the production server, but it does not happen on staging, dev, and worse, I cannot replicate the error on local.

  • The method gets called when loading a PLP, PDP, homepage and checkout&shipping (maybe on even more places) and cache has been cleared (locally). On prod, I assume when someone visits the page for the first time.

  • I’ve put a breakpoint in the method. The method seems to load a bunch of interfaces and caches them. Some of them are:

MagentoTaxApiDataTaxDetailsInterface

MagentoCatalogApiDataProductRenderInterface

MagentoCatalogApiDataProductRenderButtonInterface

etc...

Things I have tried

  • Running the master branch, with the production database, and in production mode. Nothing happens.
  • I’ve added a logger to the method in question. It just shows the interface being called, and on which page.
  • Since I think this has something to do with the phpdocs, I have tried messing around with the various phpdocs on the loaded interfaces, and the classes which implement the interfaces, but no luck.

Any ideas?
Cheers!