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

Unable to Run MQTT Example Successfully #724

Closed
halkony opened this issue Jan 10, 2024 · 5 comments
Closed

Unable to Run MQTT Example Successfully #724

halkony opened this issue Jan 10, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@halkony
Copy link

halkony commented Jan 10, 2024

Describe the bug
After following these instructions and starting the given stack, I am unable to connect to the Kafka broker using MQTT.

I seem to be able to talk to the zilla instance, but attempting to connect to mqtt://host.docker.internal:7183 results in repeated Client null sending CONNECT errors

To Reproduce
Follow these instructions on Windows 10.

Expected behavior
I expected to be able to complete the tutorial as described.
Screenshots
After successfully running the stack in the tutorial:
image

Desktop (please complete the following information):
Windows 10
Docker v4.26.1

Additional context
I've tried connecting with multiple MQTT clients with no luck.

Only other thing I can think to try is running Docker in Linux.

@halkony
Copy link
Author

halkony commented Jan 11, 2024

I am unable to run the example on Ubuntu as well. Tried version 0.9.64 and 63 of the Zilla image.
image

Im able to connect to kafka and the topics are successfully created for MQTT.

@halkony
Copy link
Author

halkony commented Jan 11, 2024

I narrowed this down to rootless docker networking. The example is working on Ubuntu 22.04.

@vordimous vordimous self-assigned this Jan 11, 2024
@vordimous
Copy link
Contributor

@halkony Thank you for reporting and triaging this issue.

I narrowed this down to rootless docker networking. The example is working on Ubuntu 22.04.

Do you mean you were running the docker example in rootless mode which was causing the host network not to work as the example expects?

"--net=host doesn't listen ports on the host network namespace" from the docker docs looks to mean the examples as written won't work in rootless mode.

@halkony
Copy link
Author

halkony commented Jan 12, 2024

Correct. I did get it running in rootless docker, however.

It turns out Ubuntu has permissions problems when installing docker with snap. Installing from the official docker docs via .deb fixed a lot of my issues. Additionally, I set ~/.config/docker/daemon.json to

{
    "default-address-pools": [
        {"base":"172.16.0.0/16","size":24},
        {"base":"172.20.0.0/16","size":24}
    ]
}

so the rootless address space doesn't conflict with my localhost (this fixes the rootless 2181 zookeeper collisions I had out of the box). I also removed the

networks:
  default:
    driver: bridge

section I had added manually because I mistook bridge mode for the default host mode.

None of these seemed to explicitly solve my problem, but as is typical of linux voodoo, solving several small problems usually fixes one big one. Cheers.

@vordimous
Copy link
Contributor

That makes sense, thank you for sharing your troubleshooting experience. Running examples in docker can be a blessing and a curse sometimes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants