actumn / celery.node

Celery task queue client/worker for nodejs

Home Page:https://celery-node.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

inequivalent arg 'auto_delete' using the example

Yoshyn opened this issue · comments

Description

Hello,

I'm just trying to run the example and I got the following error return by rabbitmq :

Error: Channel closed by server: 406 (PRECONDITION-FAILED) with message "PRECONDITION_FAILED - inequivalent arg 'auto_delete' for exchange 'default' in vhost '/': received 'true' but current is 'false'"

Here is the code run node client.js :

"use strict";
const celery = require("celery-node");

const CELERY_BROKER_URL = process.env.CELERY_BROKER_URL

const client = celery.createClient(
    CELERY_BROKER_URL,
    'amqp://',
    'my_queue'
);

client.isReady().then(() => {
  debug('Connected to Celery successfully');
}).catch(error => console.log('Got an error', error))
  • What is the expected behavior?

Just no error I guess

  • Please tell us about your environment:

    • Version: 0.5.9
    • OS: [Docker with node:latest]
    • Language: [nodejs]
    • RabbitMQ 3.9.16 on Erlang 24.3.4 [jit]
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)

Here is the stacktrace in rabbitmq :

2022-05-16 16:32:02.615000+00:00 [info] <0.14146.7> accepting AMQP connection <0.14146.7> (127.0.0.1:47076 -> 127.0.0.1:5672)
2022-05-16 16:32:02.631865+00:00 [info] <0.14146.7> connection <0.14146.7> (127.0.0.1:47076 -> 127.0.0.1:5672): user 'user' authenticated and granted access to vhost '/'
2022-05-16 16:32:02.657675+00:00 [erro] <0.14155.7> Channel error on connection <0.14146.7> (127.0.0.1:47076 -> 127.0.0.1:5672, vhost: '/', user: 'user'), channel 1:
2022-05-16 16:32:02.657675+00:00 [erro] <0.14155.7> operation exchange.declare caused a channel exception precondition_failed: inequivalent arg 'auto_delete' for exchange 'default' in vhost '/': received 'true' but current is 'false'
2022-05-16 16:32:03.683960+00:00 [warn] <0.14146.7> closing AMQP connection <0.14146.7> (127.0.0.1:47076 -> 127.0.0.1:5672, vhost: '/', user: 'user'):
2022-05-16 16:32:03.683960+00:00 [warn] <0.14146.7> client unexpectedly closed TCP connection
`
``

I'm guess that there's some options that I should pass to rabbitmq. Are the example up to date ?

Ok, this was due to an existing exchange with auto-delete not set to true.
Not sure why I got this errors whereas whereas everything does fine when i'm using the python library or amqplib (in node js) directly.