Search code examples
phpzend-frameworkdb2magento2interceptor

MAGENTO2 Error InvalidArgumentException: Invalid scope type ''


I'm currently trying to integrate MAGENTO (Open source ver. 2.4.5) with IBM DB2 LUW.

I have succesfully communicated the framework with the DB2 database, done by changing backend classes (PDO, and ZEND mostly). I have not touched any modules code as of now only changed the config settings in the ENV to fit DB2.

When I'm trying to run the store, or to compile or to upgrade these errors pop:

InvalidArgumentException: Invalid scope type '' in /var/www/html/magento2/vendor/magento/framework/App/ScopeResolverPool.php:43 

enter image description here

I've made an investigation over the classes. The reason behind this is that the processed object (which is an INTERCEPTOR) does not have a function called "getScope" so it returns NULL and this is the reason it causes the error. Proof:

enter image description here

Currently this is the stack I've made, it paints the processed classes and the scope that /could/ be in said classes (that runs twice, throws a NULL):

https://www.dropbox.com/s/lvr5qcnjcqif7wb/PROBLEMASISTACK3.txt?dl=0

I'm echoing the strings of the classes processed in ObjectManager/Factory/AbstractFactory.php, the last straw appears to be an Interceptor, and it could be related to the config classes and the config data, however I have validated that the data obtained from the database is correct (in Zend/Db/Adapter/Abstract.php) (everything was imported from MySQL and the scopes are all "default", which in MySQL Magento OOTB integration worked):

enter image description here

What could be the issue?

EDIT: I discovered that the interceptors were not being generated correctly, I changed them to the original values and found no difference, I still have the same error:

enter image description here

UPDATE (09/02/2023): I have discovered that the resolution of the scope via the Zend cache comes back to a boolean false.

I am off to find out WHY the cache is incomplete.

enter image description here


Solution

  • This issue requires a full conversion of the MAGENTO OPEN SOURCE framework to accept IBM DB2, it is a long process that involves many errors and cannot be answered in a simple way.

    I have made my progress public in this github space:

    https://github.com/CarlosSRHeapst/Magento2_POC_IBM

    Once we are done with it we will eventually merge it into the MAGENTO OPEN SOURCE github as a new branch.