2

I'm trying to enable bulk endpoints to upload multiple products at once (The CSV uploader seems to be completely broken, so I'm going this route instead).

When I try to enable bulk endpoints (php bin/magento queue:consumers:start async.operations.all), I get a message saying "Unknown connection name amqp".

This seems to be related to RabbitMQ, which I can't install because I'm on a cloudways server.

Is there any way around this error, or am I going to have to write some custom functionality to upload my products?

Magento 2.3.1 CE

2 Answers 2

0

master. I faced the same issue, and the solution I've found was to disable the async.operations.all to be queued. You have to add this to your app/etc/env.php file (last array). Magento reference here.

...
'cron_consumers_runner' => [
    'cron_run' => false,
    'max_messages' => 20000,
    'consumers' => ['async.operations.all']
],
...

In my case, the issue was related to the crontabs, which was getting in conflict with the flock.

What I did was: put all the consumers out of cronjob execution. Note empty array at the consumers:

...
'cron_consumers_runner' => [
    'cron_run' => false,
    'max_messages' => 20000,
    'consumers' => []
],
...

And then, set one cron for each consumer:

* * * * * flock -n /tmp/magento-cron.lock bin/magento cron:run > /dev/null 2>&1;
* * * * * flock -n /tmp/consumer-cron.lock bin/magento queue:consumers:start inventoryQtyCounter > /dev/null 2>&1;

Of course, you got to add a crontab for each consumer queue you want to execute, see the list of consumers queue here.

But I believe, for your case, the first option should work.

11
  • Thanks for responding. When I added that to my list (I had seen that documentation earlier), I get the same error message. Is there anything else that has to be run afterwards? Thanks
    – web master
    Commented Oct 2, 2019 at 20:41
  • Please add this to your env.php file: ... 'cron_consumers_runner' => [ 'cron_run' => false, 'max_messages' => 20000, 'consumers' => ['async.operations.all'] ], ... And do not execute the bin/magento queue:consumers:start async.operations.all The actions will be done without RabbitMQ. Commented Oct 3, 2019 at 8:30
  • When I try that, the response message is: "message": "Unknown connection name amqp"
    – web master
    Commented Oct 3, 2019 at 12:36
  • Put the consumers' array empty: 'consumers' => []. It might be necessary to execute the others' queues manually. But do not execute the async.operations.all. Let the async process to be done via database. Commented Oct 7, 2019 at 9:26
  • 1
    @WillianLevinskiKeller the OP wants Bulk API to work. Neither of your solutions satisfies the question. This answer should be removed as it is misleading others to fix an error message only as opposed to configuring the feature properly. Commented Apr 22, 2020 at 21:26
0

You must install and configure RabbitMQ for the Bulk API feature to work.

Here's a complete walkthrough for Magento 2 BulkAPI enablement for CentOS/RHEL 7, 8.

Essentially, you need to install RabbitMQ and configure amqp details in the app/etc/env.php to match with the setup, e.g.:

    'queue' =>  [
        'amqp' =>  [
            'host' => '127.0.0.1', // IP address of RabbitMQ instance. Change it, if it is not running on the same machine with Magento
            'port' => '5672', // Port on which RabbitMQ running. 5672 is default port
            'user' => 'guest', // RabbitMQ user name
            'password' => 'guest', // RabbitMQ password
            'virtualhost' => '/' // The virtual host for connecting to RabbitMQ. The default is /.
        ],
    ],

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.