7

The upgrade process in composer works fine. After upgrading in composer en trying to run bin/magento setup:upgrade I get the following error:

Type Error occurred when creating object: Magento\Framework\Communication\Config\Data, Argument 2 passed to Magento\Framework\Reflection\TypeProcessor::resolveFullyQualifiedClassName() must be of the type string, null given, called in /data/web/magento2/vendor/magento/framework/Reflection/TypeProcessor.php on line 550

Anybody came across the same error? Any possible fix available?

EDIT:

To know which extension/class is responsible for the error, do the follow:

Open: vendor/magento/framework/Reflection/MethodsMap.php find the method getMethodMapViaReflection() and add the following to the first line:

echo $interfaceName . PHP_EOL;

Run bin/magento setup:upgdrade again. The last class just before the error is the suspect.

Credits to @JorgB for his answer.

3 Answers 3

17

One of your custom modules is not Magento 2.4.4 compatible..

How to fix? add PHPDOC block for all consumer class in your custom module.

How to find all consumer class? you can set break point debugger in vendor/magento/framework/Reflection/MethodsMap.php or just wrap this method in try/catch block and print the class you need to fix.

Or if you dont care to fix the modules now You can change line 550 of vendor/magento/framework/Reflection/TypeProcessor.php to "return $type;" that way you can proceed with setup:upgrade.

2
  • Thanks, how do you know that? And how do I resolve which one it is?
    – Akif
    Apr 13, 2022 at 9:07
  • 1
    Edited my question with more information
    – JorgB
    Apr 13, 2022 at 9:13
7

find your not compatible custom modules in Magento 2.4.4. add code in vendor/magento/framework/Reflection/MethodsMap.php line 143

    if($paramReflection->detectType() == NULL)
        {
            var_dump($paramReflection->getDeclaringClass());
            die();
        }

after you run setup:upgrade command, output showing like that

object(Laminas\Code\Reflection\ClassReflection)#7057 (2) {
  ["docBlock":protected]=>
  NULL
  ["name"]=>
  string(36) "Magefan\Blog\Api\ManagementInterface"
}

in this output Magefan_Blog module is not compatible in Magento 2.4.4

1
0

I recently upgraded my magento version from 2.3.5-p1 to version 2.4.5-p1 and I was facing the similar issue. I tried the solutions provided but it is not working anymore.

On the magento 2.4.5-p1 version, in order to find the class that is not compatible with the magento version, you have to do the following steps.

  1. Open the file vendor/magento/framework/Webapi/ServiceOutputProcessor.php

  2. In the process method, just after the line $dataType = $this->methodsMapProcessor->getMethodReturnType($serviceClassName, $serviceMethodName);

  3. Add the below line of code, and it will give you the Class name and method name. if($dataType === null || empty($dataType)){echo $serviceClassName.'<>'.$serviceMethodName . PHP_EOL;}

Putting it here in case if someone need it.

Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.