0

I imported a CSV file with 5 products, the CSV is successfully validated and imported, however, when I went into one of the products that I imported, the update didn't have an effect. After one hour I checked again and it didn't work.

My CRONs jobs are working normally. But looking at the logs I saw these errors below right after import the CSV.

[2021-08-20 13:07:06] report.ERROR: Cron Job consumers_runner has an error: ACCESS_REFUSED - Login was refused using authentication mechanism AMQPLAIN. For details see the broker logfile.. Statistics: {"sum":0,"count":1,"realmem":0,"emalloc":0,"realmem_start":242221056,"emalloc_start":221501008} [] []
[2021-08-20 13:07:06] report.CRITICAL: ACCESS_REFUSED - Login was refused using authentication mechanism AMQPLAIN. For details see the broker logfile. {"exception":"[object] (PhpAmqpLib\\Exception\\AMQPProtocolConnectionException(code: 403): ACCESS_REFUSED - Login was refused using authentication mechanism AMQPLAIN. For details see the broker logfile. at /app/wjdydgvtb3kes/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Connection/AbstractConnection.php:729)"} []

It's a Magento Cloud project with the amqp configured in the env.php file and the credentials are correct.

How could I solve it?

2
  • Is this a PRO or STARTER account? Did you already raise a support ticket? Aug 22, 2021 at 13:35
  • I didn't need it, I found the answer, I'm posting it below @DilhanMaduranga Aug 23, 2021 at 14:36

1 Answer 1

0

There are 3 main steps to verify why RabbitMQ not working.

1 - Enable RabbitMQ

To have RabbitMQ working in your server you need to specify it in two files, as you can see in these examples below. You might be able to find the ideal RabbitMQ version in this image below.

Magento 2 System requirements

.magento/services.yaml

rabbitmq:
    type: rabbitmq:<version>
    disk: 1024

.magento.app.yaml

relationships:
    rabbitmq: "rabbitmq:rabbitmq"

dependencies:
    ruby:
        amqp-utils: "0.5.1"

2 - Get the credentials

Running one of these commands in your server you will be able to get the right credentials.

echo $MAGENTO_CLOUD_RELATIONSHIPS | base64 -d | json_pp

Or

php -r 'print_r(json_decode(base64_decode($_ENV["MAGENTO_CLOUD_RELATIONSHIPS"])));'

If you want to log in via SSH with the credentials, you can run this command below.

ssh -L <port-number>:mq.internal:<port-number> <project-ID>-<branch-ID>@ssh.us.magentosite.cloud

3 - Configure RabbitMQ

In your env.php your RabbitMQ might be configured like this example below.

'queue' =>
  array (
    'amqp' =>
    array (
      'host' => 'rabbitmq.example.com',
      'port' => '11213',
      'user' => 'magento',
      'password' => 'magento',
      'virtualhost' => '/'
     ),
  ),

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.