symfonyrabbitmqsymfony-messenger

Symfony\\Component\\Messenger\\Bridge\\Amqp\\Transport\\Connection::ack(): Return value must be of type bool, null returned


I get this error when handling message, where is the problem? It works before restart. I can connect to rabbit. I didn't change anything, composer update with that composer config. queue stop working.

This is response from component - my handler returns nothing...

Where search solution? Is this a problem with rabbit? Or the symfony rabbit library?

 Received message App\Message\RecalculateInventoryMessage {"class":"App\\Message\\RecalculateInventoryMessage"} []
[2024-01-26T10:33:55.699255+00:00] messenger.INFO: Message App\Message\RecalculateInventoryMessage handled by App\MessageHandler\RecalculateInventoryMessageHandler::__invoke {"class":"App\\Message\\RecalculateInventoryMessage","handler":"App\\MessageHandler\\RecalculateInventoryMessageHandler::__invoke"} []
[2024-01-26T10:33:55.701369+00:00] messenger.INFO: App\Message\RecalculateInventoryMessage was handled successfully (acknowledging to transport). {"class":"App\\Message\\RecalculateInventoryMessage"} []
[2024-01-26T10:33:55.705393+00:00] console.CRITICAL: Error thrown while running command "messenger:consume recalculate_inventory --time-limit=3600". Message: "Symfony\Component\Messenger\Bridge\Amqp\Transport\Connection::ack(): Return value must be of type bool, null returned" {"exception":"[object] (TypeError(code: 0): Symfony\\Component\\Messenger\\Bridge\\Amqp\\Transport\\Connection::ack(): Return value must be of type bool, null returned at /application/vendor/symfony/amqp-messenger/Transport/Connection.php:440)","command":"messenger:consume recalculate_inventory --time-limit=3600","message":"Symfony\\Component\\Messenger\\Bridge\\Amqp\\Transport\\Connection::ack(): Return value must be of type bool, null returned"} []
[2024-01-26T10:33:55.707673+00:00] console.DEBUG: Command "messenger:consume recalculate_inventory --time-limit=3600" exited with code "1" {"command":"messenger:consume recalculate_inventory --time-limit=3600","code":1} []

My composer

"require": {
    "php": ">=8.2.3",
    "ext-ctype": "*",
    "ext-iconv": "*",
    "beberlei/doctrineextensions": "^1.3",
    "ccampbell/chromephp": "^4.1",
    "doctrine/annotations": "^2.0",
    "doctrine/dbal": "^3.6",
    "doctrine/doctrine-bundle": "*",
    "doctrine/doctrine-migrations-bundle": "^3.2",
    "doctrine/orm": "^2.14",
    "elliotjreed/royal-mail-tracking": "^3.0",
    "friendsofsymfony/ckeditor-bundle": "^2.4",
    "friendsofsymfony/jsrouting-bundle": "^3.2",
    "gnikyt/basic-shopify-api": "^11.0",
    "jms/serializer-bundle": "*",
    "knplabs/knp-paginator-bundle": "^6.2",
    "lcobucci/jwt": "^5.0",
    "moneyphp/money": "^3.3",
    "nesbot/carbon": "^2.66",
    "openai-php/client": "^0.6.1",
    "phpdocumentor/reflection-docblock": "^5.3",
    "phpstan/phpdoc-parser": "^1.16",
    "sensio/framework-extra-bundle": "^6.2",
    "setasign/fpdf": "^1.8",
    "setasign/fpdi": "^2.3",
    "shopify/shopify-api": "^4.2",
    "sonata-project/admin-bundle": "^4.27.1",
    "sonata-project/doctrine-orm-admin-bundle": "^4.10",
    "sonata-project/user-bundle": "^5.6",
    "stof/doctrine-extensions-bundle": "*",
    "symfony/amqp-messenger": "6.2.*",
    "symfony/asset": "6.2.*",
    "symfony/console": "6.2.*",
    "symfony/debug-bundle": "6.2.*",
    "symfony/doctrine-messenger": "6.2.*",
    "symfony/dotenv": "6.2.*",
    "symfony/expression-language": "6.2.*",
    "symfony/flex": "^2",
    "symfony/form": "6.2.*",
    "symfony/framework-bundle": "6.2.*",
    "symfony/http-client": "6.2.*",
    "symfony/intl": "6.2.*",
    "symfony/lock": "6.2.*",
    "symfony/mailer": "6.2.*",
    "symfony/mercure-bundle": "^0.3.6",
    "symfony/mime": "6.2.*",
    "symfony/monolog-bundle": "^3.0",
    "symfony/notifier": "6.2.*",
    "symfony/process": "6.2.*",
    "symfony/property-access": "6.2.*",
    "symfony/property-info": "6.2.*",
    "symfony/rate-limiter": "6.2.*",
    "symfony/runtime": "6.2.*",
    "symfony/security-bundle": "6.2.*",
    "symfony/serializer": "6.2.*",
    "symfony/string": "6.2.*",
    "symfony/translation": "6.2.*",
    "symfony/twig-bundle": "6.2.*",
    "symfony/validator": "6.2.*",
    "symfony/web-link": "6.2.*",
    "symfony/webpack-encore-bundle": "^1.16",
    "symfony/yaml": "6.2.*",
    "symfonycasts/verify-email-bundle": "^1.13",
    "tbbc/money-bundle": "^5.0",
    "twig/extra-bundle": "^2.12|^3.0",
    "twig/twig": "^2.12|^3.0",
    "vich/uploader-bundle": "2.1.1",
  "ext-bcmath": "*"
},

here is docker-compose config for rabbit

  rabbit:
    image: "rabbitmq:3.8-management"
    hostname: "rabbit"

Solution

  • This is now fixed in "symfony/amqp-messenger". You have to update your dependency