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
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:
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):
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:
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.
2
Answers
The error message you are encountering suggests that there is a problem with the scope type in the ScopeResolverPool class. The issue might be related to the interceptor classes or the configuration data. From your investigation, it seems that the processed object (an interceptor) does not have the "getScope" function, which is why it returns NULL and causes the error. Additionally, you mentioned that the resolution of the scope via the Zend cache comes back as a boolean false, which might indicate that the cache is incomplete.
Here are a few steps that you could try to resolve this issue:
I hope this helps, and good luck with resolving the issue!
The error message "InvalidArgumentException: Invalid scope type ”" in Magento 2 is typically caused by a misconfiguration in the scope settings. It’s possible that the values for scope type and/or code are missing or incorrect in the configuration data. You should check your database and make sure that the scope settings are correctly defined.
You should also check whether there are any custom modules or third-party extensions that could be interfering with the scope resolution process. It’s possible that some code changes are required to get the scope resolution working correctly. Finally, check the cache settings and clear the cache, as it could be that stale cache data is causing the issue.