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

Bridge not working with a specific kind of topic #3067

Open
Anzal-calixto opened this issue Jun 13, 2024 · 18 comments
Open

Bridge not working with a specific kind of topic #3067

Anzal-calixto opened this issue Jun 13, 2024 · 18 comments

Comments

@Anzal-calixto
Copy link

Here is the my broker configuration bridge file.

address broker.emqx.io:1883
#bridge_cafile /etc/mosquitto/certs/ca.crt
#bridge_certfile /etc/mosquitto/certs/client.crt
#bridge_keyfile /etc/mosquitto/certs/client.key
topic home-15646/# out 0
topic home-15646/# in 0

instead of this if give home/# the bridge will work fine.

1718281051: mosquitto version 2.0.11 starting
1718281051: Config loaded from /etc/mosquitto/mosquitto.conf.
1718281051: Opening ipv4 listen socket on port 1883.
1718281051: Opening ipv6 listen socket on port 1883.
1718281051: Connecting bridge (step 1) home_connection-15646 (test.mosquitto.org:1883)
1718281051: mosquitto version 2.0.11 running
1718281052: Connecting bridge (step 2) home_connection-15646 (test.mosquitto.org:1883)
1718281052: Error creating bridge: Broken pipe.
1718281052: New connection from 127.0.0.1:47960 on port 1883.
1718281052: New client connected from 127.0.0.1:47960 as mqttjs_1fbb6b9b (p2, c1, k60).

also its giving a broken pipe error.

@Daedaluz
Copy link
Contributor

try

address broker.emqx.io:1883
#bridge_cafile /etc/mosquitto/certs/ca.crt
#bridge_certfile /etc/mosquitto/certs/client.crt
#bridge_keyfile /etc/mosquitto/certs/client.key
topic home-15646/# both 0

But it feels like this might be something else.

tls settings good?

@Anzal-calixto
Copy link
Author

Tls settings are working fine when I try with emqx broker it's working but if I am connecting to mosquito broker it's not bridging

@hardillb
Copy link
Contributor

Try wrapping the topic in quotes

address broker.emqx.io:1883
#bridge_cafile /etc/mosquitto/certs/ca.crt
#bridge_certfile /etc/mosquitto/certs/client.crt
#bridge_keyfile /etc/mosquitto/certs/client.key
topic "home-15646/#" out 0
topic "home-15646/#" in 0

@Anzal-calixto
Copy link
Author

thanks @hardillb i tried using above method it doesn't seems to be working

@Daedaluz
Copy link
Contributor

I think there should be a "both" variant to "in" and "out", try that instead of in and out separately.

@Anzal-calixto
Copy link
Author

1719215263: Error creating bridge: Broken pipe. 1719215294: Connecting bridge (step 1) home_connection-15646(test.mosquitto.org:1883)
@Daedaluz tried that still gives the same error

@Daedaluz
Copy link
Contributor

What does emqx logs say?

@Anzal-calixto
Copy link
Author

1719220419: mosquitto version 2.0.11 starting 1719220419: Config loaded from /etc/mosquitto/mosquitto.conf. 1719220419: Opening ipv4 listen socket on port 1883. 1719220419: Opening ipv6 listen socket on port 1883. 1719220419: Connecting bridge (step 1) home_connection-15646 (broker.emqx.io:1883) 1719220419: mosquitto version 2.0.11 running 1719220420: Connecting bridge (step 2) home_connection-15646 (broker.emqx.io:1883) 1719220420: New connection from 127.0.0.1:60498 on port 1883. 1719220420: New client connected from 127.0.0.1:60498 as mqttjs_b48cce68 (p2, c1, k60). 1719220473: New connection from 192.168.1.174:52561 on port 1883. 1719220473: New client connected from 192.168.1.174:52561 as mqttx_384adf50 (p5,

this is the log for emqx

@Daedaluz
Copy link
Contributor

that looks like logs from mosquitto.

@Anzal-calixto
Copy link
Author

Anzal-calixto commented Jun 24, 2024

@Daedaluz In my setting my local broker is mosquitto and when i am trying to bridge this local broker to a mosquitto broker thats when it gives the error and bridge is not being connected. If i try to bridge it to an emqx broker bridge is working fine. my cloud broker is a mosquitto broker and the emqx broker is an open broker

@Anzal-calixto
Copy link
Author

@Daedaluz @hardillb any suggestions

@ckrey
Copy link

ckrey commented Jun 27, 2024

@Anzal-calixto "home-15646/#" is not a valid topic filter (because the # is not at the end).

Please correct to home-15646/# which is probably what you intended

@ckrey
Copy link

ckrey commented Jun 27, 2024

Can you try with a more recent version of mosquitto (2.0.18)? 2.0.11 is 3 years old

@Anzal-calixto
Copy link
Author

@ckrey i tried home-1546/# it was also havig the issue i will update mosquitto and try again

@Anzal-calixto
Copy link
Author

hello @ckrey i am using debian 11 it seems the latest version that is available for dedian 11 is 2.0.11

@ckrey
Copy link

ckrey commented Jun 28, 2024

Setting up a brigde to test.mosquitto.org:1883 works well with mosquitto 2.0.11 and 2.0.18

Please show us your complete config with bridge to test.mosquitto.org (all your snippets above show the config with emqx)

@Anzal-calixto
Copy link
Author

Anzal-calixto commented Jun 28, 2024

sure here is the settings

address test.mosquitto.org:1883
topic home-15646/# both 0 

@Anzal-calixto
Copy link
Author

Anzal-calixto commented Jul 5, 2024

@ckrey @Daedaluz @hardillb can you guys provide any other methods. it would be a great help

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