MQTT Plugin - BAD_CREDENTIALS

114 views
Skip to first unread message

Raiziell Lima

unread,
Oct 23, 2019, 12:49:49 PM10/23/19
to rabbitmq-users
Hi there
I'm very worried about this problem because I've tried so many things to solve it, with no success. 

I'm trying to publish a hello world message from an ESP8266 to the RabbitMQ broker.

Yes, I've enabled the MQTT plugin, set the default user and password for it and also the port (1883).
From the ESP, I try to connect to the broker, but it returns an error and the value 4, which means (by the documentation) "MQTT_CONNECT_BAD_CREDENTIALS - the username/password were rejected".

I'm sure it's everything fine with the ESP code because I can connect to other brokers, like Mosquitto, for example.
The rabbit server is running on Windows 10 and I can access the management page with no problems, from my PC and from the others on the same network.
It's the version 3.8.0 of Rabbit

Could anybody help me?

Luke Bakken

unread,
Oct 23, 2019, 5:14:11 PM10/23/19
to rabbitmq-users
Hi Raiziell,

Please provide the following information:

* The output of rabbitmqctl environment - save the output in a file, and attach it to your response.
* Your complete RabbitMQ configuration files.
* The contents of the RabbitMQ log files when the error message is returned to your client.
* The commands you ran to create the user you are using, and the commands you ran to give that user permissions within RabbitMQ.

Thanks,
Luke

Raiziell Lima

unread,
Oct 24, 2019, 1:44:18 PM10/24/19
to rabbitmq-users
Hi, Luke

First of all, thanks so much for your answer.

Well, I attached the config and log output files to you have an idea about what's happening.

(Sorry, I didn't understand what you asked when you said "rabbitmqctl environment")

The commands I ran to create the user I'm using (and give it the permissions) were:

> rabbitmqctl add_user mqtt mqtt
> rabbitmqctl set_permissions -p / mqtt ".*" ".*" ".*"
> rabbitmqctl set_user_tags mqtt management

Thanks again,
Raiziell
Log output.txt
advanced.config

Luke Bakken

unread,
Oct 24, 2019, 2:02:56 PM10/24/19
to rabbitmq-users
Hi Raizell,

Your configuration file should be named rabbitmq.config, not advanced.config. I have attached a file that removes some settings you don't need at the moment.

The logs you provided show that your client is connecting to a vhost named vhost1, or perhaps your RabbitMQ configuration is incorrect and you have mistakenly specified vhost1 as the MQTT vhost.

Log into your RabbitMQ server as the root user, and run this command:

rabbitmqctl environment

Provide the output in your response.

Thanks,
Luke
rabbitmq.config
Reply all
Reply to author
Forward
0 new messages