-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Broker Disconnect After CONNECT Request #4360
Comments
@pascaldekloe Can you provide the emqx log, it is usually |
The issue is not about the client. I have given you a full analysis + steps to reproduce. |
@pascaldekloe could you provide source code of mqttc? |
Hi. We are not blaming the client, this is such a basic scenario, sometimes it's a lot easier to understand what went wrong if you happen to have tried other clients to compare the behaviour on both client/server side. And I find your comment a bit harsh, not to mention it's a random bash script you are asking us to download and run. |
@qzhuyan it's a shebang bin/sh which downloads some other binary and run if I understand correct from my quick glance |
this? https://github.com/pascaldekloe/mqtt |
I failed. It does not seem to be allowed to create an issue in your repo: https://github.com/pascaldekloe/mqtt default branch go run crashes
|
Seems like your Go runtime doesn't like the OS it's on. 😬 You need Go version 1.16 for this project though. What I'm trying to say is that the client of choice doesn't matter. It's just a plain connection close after the intial CONNECT packet. You can even use netcat to reproduce.
|
To be clear: this issue exists only for a second or two during startup. Once the daemon is fully started, things are fine. Also, EMQ X is not the only one with this boot problem. |
Maybe allow the service to start successfully ? i.e. Wait for |
How would parsing text for daemon ready-ness work? Do you suggest a script with a regular expression, which exposes the TCP port on a match? Better hope that log line does not change in future versions then. 😄 |
if you are suggesting that there should be a readiness probe for the service running in the container. |
I'm suggesting the daemon should be ready when it listens to a socket. Fixing this issue prevents a whole lot of complexity on container level. |
docker exposes the port immediately to your host. |
if you are writing automated tests, I guess you'll need some sort of readiness probe? |
tested it with: there is no error. |
Environment:
Docker image emqx/emqx:4.2.5.
What happened and what you expected to happen:
The broker closes the connection after receiving a CONNECT request during startup shortly.
The broker must respond to incoming CONNECT requests when listening on a TCP port.
How to reproduce it (as minimally and precisely as possible):
(1) Download client from https://gobinaries.com/pascaldekloe/mqtt/cmd/mqttc.
(2) Start broker with something like
docker run -d -p 1883:1883 emqx/emqx:4.2.5
.(3) Run
mqttc localhost
quickly after (2).The error printed is
mqtt: broker closed the connection (EOF); CONNECT not confirmed
. Wireshark confirms connection loss after request submission.The text was updated successfully, but these errors were encountered: