9

While upgrading a 2.2.8 database to 2.3.2 I got this error today:

  Schema post-updates:                                                         
  Module 'Magento_Store':                                                      
  Module 'Magento_Directory':                                                  
  Module 'Magento_Theme':                                                      
  Module 'Magento_Eav':                                                        
  Module 'Magento_AdvancedPricingImportExport':                                
  Module 'Magento_Rule':                                                       
  Module 'Magento_Customer':                                                   
  Module 'Magento_Amqp':                                                       
  Error while checking if topic is synchronous                                 

It must have something to do with environment configuration because on the same DB snapshot with the same code base, it worked on a test environment.

We do not use the Magento_Amqp module at all, so there is no AMQP configuration on either system.

I looked where the error message can be thrown and found:

\Magento\Framework\MessageQueue\Topology\Config\QueueConfigItem\DataMapper::isSynchronousTopic

which can be traced back to:

\Magento\Framework\MessageQueue\Topology\Config\QueueConfigItem\Iterator::__construct

And the exception is thrown if in

\Magento\Framework\Communication\Config::getTopic()

a configuration path (topics/$topicName, from cache id communication_config_cache) cannot be found.

But now I'm lost: Why should this configuration be present in one installation and not in the other? Or why would Magento look for the configuration at all during DB schema updates?

The output suggests, that the recurring schema update (\Magento\Amqp\Setup\Recurring) of Magento_Amqp are not even started (No "Running schema recurring"), so I guess the error comes while instantiating it.

Trying to find a dependency path to the class from above, that throws the exception in its constructor:

  • \Magento\Framework\Amqp\TopologyInstaller
  • \Magento\Framework\MessageQueue\Topology\Config
  • \Magento\Framework\MessageQueue\Topology\Config\QueueConfigItem\Iterator

Yes! We have a trace. (but still no idea, why. I'll keep this updated)

2 Answers 2

4

Oh dear, I found it. With the update, I've removed the module magento/module-url-rewrite-import-export because Magento yet has to release a version that's compatible with Magento 2.3

This module came with a queue. On the live system, this queue configuration was still present:

         "queue--url_rewrite_import--url.rewrite.import" => [
           "id" => "queue--url_rewrite_import--url.rewrite.import",
           "destinationType" => "queue",
           "destination" => "url_rewrite_import",
           "disabled" => false,
           "topic" => "url.rewrite.import",
           "arguments" => [],
         ],

Apparently still when setup:upgrade was executed during deployment. But the configuration for its "topic" was not found anymore.

Still unclear: Why is that queue configuration present? At that point, we operate on the new code and the cache has been flushed.

New answer, November 2021

With the update to Magento 2.4.3 we occasionally got this error as well.

Adding

    'queue' => [
        'consumers_wait_for_messages' => 1
    ],

to env.php helped. Apparently Magento adds this configuration itself but sometimes not. Without it, the queue does not work and we get this error during recurring updates of the queue modules

5
  • Did you ever figure out why the queue config was present? I just had the same error on a 2.3.6-2.4.2 upgrade.
    – Laura
    Apr 25, 2021 at 16:25
  • @Laura No, it's going to be a mystery forever Apr 26, 2021 at 7:20
  • Also got the issue...
    – Sebastien
    May 28, 2021 at 9:32
  • When you say "On the live system, this queue configuration was still present", do you mean in env.php, config.php, or somewhere else?
    – Erfan
    Oct 4, 2021 at 7:42
  • 1
    @Erfan that must have been env.php Oct 4, 2021 at 14:51
4

Check for communication.xml file (add it if missing) to the module with the consumer.

https://devdocs.magento.com/guides/v2.3/extension-dev-guide/message-queues/config-mq.html

1
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review Mar 9 at 3:23

Your Answer

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

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