Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

amqp.connect calls error callback twice when bad credentials are given #263

Closed
Froren opened this issue Jul 29, 2016 · 3 comments
Closed

Comments

@Froren
Copy link

Froren commented Jul 29, 2016

I'm using version 0.4.2 of the library and I'm having some issues during connection. The callback seems to be called twice with errors, when given this (invalid) url.

var amqp = require('amqplib/callback_api');

var amqpUrl = "amqp://username:[email protected]";

var counter = 0;

function output(err) {
    console.log('Error: ' + JSON.stringify(err));
    console.log(++counter);
}

amqp.connect(amqpUrl, {}, function(err, conn) {
    if (err) {
        return output(err);
    }
    console.log("No error");
});
@SimonWoolf
Copy link

I can confirm this -- the connect callback is called once with Error: Handshake terminated by server: 403 (ACCESS-REFUSED) with message "ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN., then a second time a couple seconds later with read ECONNRESET.

@morus12
Copy link

morus12 commented Feb 22, 2017

I confirm @SimonWoolf confirmation in 2017.

This is related to #266 - general connection error handling. We can read there - listen for 'error' on the connection object. But there is no connection object.

@cressie176
Copy link
Collaborator

Duplicate of #354

@cressie176 cressie176 marked this as a duplicate of #354 May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants