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

'socket_domain ipv4' breaks config (listen twice -> Address already in use) #3072

Open
antoine-sac opened this issue Jun 22, 2024 · 0 comments

Comments

@antoine-sac
Copy link

I have been troubleshooting a bug preventing mosquitto from booting because it attempts to listen twice to the same port. I finally tracked it down to the socket_domain option.

Here is the simplest reproducible example which fails to start.

cat /etc/mosquitto/test.conf

listener 1885 localhost
socket_domain ipv4

mosquitto -c /etc/mosquitto/test.conf -v

1719099713: mosquitto version 2.0.18 starting
1719099713: Config loaded from /etc/mosquitto/test.conf.
1719099713: Opening ipv4 listen socket on port 1885.
1719099713: Opening ipv4 listen socket on port 1885.
1719099713: Error: Address already in use

And no, I definitely do NOT have another instance running. I can reproduce the issue on any random port.

1719100410: mosquitto version 2.0.18 starting
1719100410: Config loaded from /etc/mosquitto/test.conf.
1719100410: Opening ipv4 listen socket on port 12345.
1719100410: Opening ipv4 listen socket on port 12345.
1719100410: Error: Address already in use

If I remove the "socket_domain" option, I get the expected behaviour:

mosquitto -c /etc/mosquitto/test.conf -v
1719100163: mosquitto version 2.0.18 starting
1719100163: Config loaded from /etc/mosquitto/test.conf.
1719100163: Opening ipv6 listen socket on port 1885.
1719100163: Opening ipv4 listen socket on port 1885.
1719100163: mosquitto version 2.0.18 running
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

1 participant