Following the instructions on https://devdocs.magento.com/guides/v2.3/comp-mgr/cli/cli-upgrade.html for upgrading Magento, I got this error when executing the command "php bin/magento setup:upgrade"
"autoload": {
"psr-4": {
"Magento\Framework\": "lib/internal/Magento/Framework/",
"Magento\Setup\": "setup/src/Magento/Setup/",
"Magento\": "app/code/Magento/",
"Zend\Mvc\Controller\": "setup/src/Zend/Mvc/Controller/"
},
...
}
Type Error occurred when creating object: Magento\Framework\Communication\Config\DataIn the system.log I see the whole message:
[2019-05-07 13:47:47] main.CRITICAL: 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 /var/www/vhosts/schuhjaeger.at/magento2_test/shop-v2/vendor/magento/framework/Reflection/TypeProcessor.php on line 535 [] []
This is the function from TypeProcess.php:
`
/**
* Get the parameter type
*
* @param ParameterReflection $param
* @return string
* @throws \LogicException
*/
public function getParamType(ParameterReflection $param)
{
$type = $param->detectType();
if ($type === 'null') {
throw new \LogicException(sprintf(
'@param annotation is incorrect for the parameter "%s" in the method "%s:%s".'
. ' First declared type should not be null. E.g. string|null',
$param->getName(),
$param->getDeclaringClass()->getName(),
$param->getDeclaringFunction()->name
));
}
if ($type === 'array') {
// try to determine class, if it's array of objects
$paramDocBlock = $this->getParamDocBlockTag($param);
$paramTypes = $paramDocBlock->getTypes();
$paramType = array_shift($paramTypes);
$paramType = $this->resolveFullyQualifiedClassName($param->getDeclaringClass(), $paramType);
return strpos($paramType, '[]') !== false ? $paramType : "{$paramType}[]";
}
return $this->resolveFullyQualifiedClassName($param->getDeclaringClass(), $type);
}
`
According to the error message, the variable $type is null.
How can I solve this?
Thank you very much in advance!
Hi @akamenew. Thank you for your report.
To help us process this issue please make sure that you provided the following information:
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
@magento-engcom-team give me 2.3-develop instance - upcoming 2.3.x release
For more details, please, review the Magento Contributor Assistant documentation.
@akamenew do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?
Hi @GovindaSharma. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.[ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.
[ ] 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.
[ ] 4. Verify that the issue is reproducible on 2.3-develop branchDetails
- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!
[ ] 5. Verify that the issue is reproducible on 2.2-develop branch. Details
- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x
Hi @shikhamis11. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.[ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.
[ ] 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.
[ ] 4. Verify that the issue is reproducible on 2.3-develop branchDetails
- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!
[ ] 5. Verify that the issue is reproducible on 2.2-develop branch. Details
- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x
[ ] 6. Add label Issue: Confirmed once verification is complete.
[ ] 7. Make sure that automatic system confirms that report has been added to the backlog.
@akamenew Thank you for your report, I followed the same step and I am not able to reproduce the issue. Let me know If It requires any additional step too to reproduce the issue.
@shikhamis11 Actually that were all the steps I went through to observe this behaviour. Do you have any idea on how to resolve this? I have tried different approaches (like cleaning cache, deleting stuff in generated and var folder) but nothing worked yet. Any help is highly appreciated.
Im also having the same issue. Upgraded from 2.3.0 to 2.3.1, Error getting thrown after Module 'Magento_AMQP' in setup:upgrade. I am using AMQP in my build.

For some more information:
The error is occurring on trying to define the "type" for Magento\Framework\MessageQueue\Consumer::process docblock. In the screenshot you can see the Docblock for the method. It has a param.

Problem is the Zend\Code\Reflection\ParameterReflection::detectType method is returning null. This is because the DocBlock params aren't being picked up on line 107, but as you can see in the screenshot the param type is available on the Interface. In the screenshot below you can see there are no tags.

I also got his error but only with payment module,
I have a payment module for Magento for one Croatian online payment provider, i tried it to install on Magento 2.3.1 and everything is fine but when i want to go on Checkout it says https://www.example.com/rest/default/V1/guest-carts/auIzs7o1NSN0KyEoq6jHv5MJkbcnUbC7/estimate-shipping-methods - Failed to load resource: the server responded with a status of 500 () and i have no shipping methods?
Module 'Magento_Amqp':
Type Error occurred when creating object: Magento\Framework\Communication\Config\Data
debug.log
[2019-06-06 11:57:30] main.CRITICAL: 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 /home/nulledzo/capriolo.hr/vendor/magento/framework/Reflection/TypeProcessor.php on line 535 [] [] [2019-06-06 11:57:30] main.ERROR: Type Error occurred when creating object: Magento\Framework\Communication\Config\Data [] []
system.log
[2019-06-06 11:57:30] main.CRITICAL: 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 /home/nulledzo/capriolo.hr/vendor/magento/framework/Reflection/TypeProcessor.php on line 535 [] [] [2019-06-06 11:57:30] main.ERROR: Type Error occurred when creating object: Magento\Framework\Communication\Config\Data [] []
Report:
{"0":"Type Error occurred when creating object: Magento\Framework\Communication\Config\Data","1":"#1 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() called at [vendor/magento/framework/ObjectManager/ObjectManager.php:70]\n#2 Magento\Framework\ObjectManager\ObjectManager->get() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:160]\n#3 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:246]\n#4 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34]\n#5 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59]\n#6 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() called at [vendor/magento/framework/ObjectManager/ObjectManager.php:70]\n#7 Magento\Framework\ObjectManager\ObjectManager->get() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:160]\n#8 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:246]\n#9 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34]\n#10 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59]\n#11 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() called at [vendor/magento/framework/ObjectManager/ObjectManager.php:70]\n#12 Magento\Framework\ObjectManager\ObjectManager->get() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:160]\n#13 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:246]\n#14 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34]\n#15 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59]\n#16 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() called at [vendor/magento/framework/ObjectManager/ObjectManager.php:70]\n#17 Magento\Framework\ObjectManager\ObjectManager->get() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:160]\n#18 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:246]\n#19 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34]\n#20 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59]\n#21 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() called at [vendor/magento/framework/ObjectManager/ObjectManager.php:70]\n#22 Magento\Framework\ObjectManager\ObjectManager->get() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:160]\n#23 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:246]\n#24 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34]\n#25 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59]\n#26 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() called at [vendor/magento/framework/ObjectManager/ObjectManager.php:70]\n#27 Magento\Framework\ObjectManager\ObjectManager->get() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:196]\n#28 Magento\Framework\ObjectManager\Factory\AbstractFactory->parseArray() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:172]\n#29 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:246]\n#30 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34]\n#31 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59]\n#32 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() called at [vendor/magento/framework/ObjectManager/ObjectManager.php:70]\n#33 Magento\Framework\ObjectManager\ObjectManager->get() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:160]\n#34 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:246]\n#35 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34]\n#36 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59]\n#37 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() called at [vendor/magento/framework/ObjectManager/ObjectManager.php:70]\n#38 Magento\Framework\ObjectManager\ObjectManager->get() called at [vendor/magento/framework/App/Http.php:135]\n#39 Magento\Framework\App\Http->launch() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:24]\n#40 Magento\Framework\App\Http\Interceptor->launch() called at [vendor/magento/framework/App/Bootstrap.php:258]\n#41 Magento\Framework\App\Bootstrap->run() called at [index.php:39]\n","url":"/rest/default/V1/guest-carts/auIzs7o1NSN0KyEoq6jHv5MJkbcnUbC7/estimate-shipping-methods","script_name":"/index.php"}
Any Help???
For anyone want to fix this issue.
The root cause is magento read the configurations files of queue and it try to resolve the parameter in consumer handler method.

@akamenew @just-tom just-tom
change function
Path: Magento\Framework\Reflection\TypeProcessor
public function getParamType(ParameterReflection $param)
{
$type = $param->detectType();
if ($type === 'null') {
throw new \LogicException(sprintf(
'@param annotation is incorrect for the parameter "%s" in the method "%s:%s".'
. ' First declared type should not be null. E.g. string|null',
$param->getName(),
$param->getDeclaringClass()->getName(),
$param->getDeclaringFunction()->name
));
}
if ($type === 'array') {
// try to determine class, if it's array of objects
$paramDocBlock = $this->getParamDocBlockTag($param);
$paramTypes = $paramDocBlock->getTypes();
$paramType = array_shift($paramTypes);
$paramType = $this->resolveFullyQualifiedClassName($param->getDeclaringClass(), $paramType);
return strpos($paramType, '[]') !== false ? $paramType : "{$paramType}[]";
}
return $type;
}
Im also having the same issue. Upgraded from 2.3.0 to 2.3.1, Error getting thrown after Module 'Magento_AMQP' in setup:upgrade. I am using AMQP in my build.
What is solution for this ..? i am slo got same issue and why ?
Most helpful comment
For anyone want to fix this issue.
The root cause is magento read the configurations files of queue and it try to resolve the parameter in consumer handler method.
add PHPDOC block for all consumer class in your custom module.
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.