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

mosquitto keeps restarting if upstream bridge is offline #2729

Closed
rejuce opened this issue Jan 16, 2023 · 4 comments
Closed

mosquitto keeps restarting if upstream bridge is offline #2729

rejuce opened this issue Jan 16, 2023 · 4 comments

Comments

@rejuce
Copy link

rejuce commented Jan 16, 2023

v1.6.9 from Ubut20.04 repositories

We have a local broker which does most of the work. A bridge broker is configured where some selected topics with low priority are forwarded. Everything works as long as the upstream broker is online.

If the cloud broker is offline and the brdige connection can not be established, the local broker also keeps crashing and restarting logging that error:

Error creating bridge: Protocol error.

which is quite problematic as the local broker is essential for the system, while the brdige to the cloud broker is nice to have

@tannker
Copy link

tannker commented Feb 8, 2023

@rejuce Have you found any solution to this problem?
We encountered the same problem with v1.6.9.

Our configuration file is

pid_file /var/run/mosquitto.pid
persistence true
persistence_location /var/lib/mosquitto/
log_dest file /var/log/mosquitto/mosquitto.log

connection iot
address #########
bridge_capath /etc/ssl/certs/
bridge_insecure false
topic iot/17/# both 1
remote_clientid #########
remote_username #########
remote_password #########
start_type automatic

include_dir /etc/mosquitto/conf.d

Error logs do not show much

1675766163: mosquitto version 1.6.9 starting
1675766163: Config loaded from /etc/mosquitto/mosquitto.conf.
1675766163: Opening ipv4 listen socket on port 1883.
1675766163: Opening ipv6 listen socket on port 1883.
1675766163: Connecting bridge (step 1) #########
1675766163: New connection from ######### on port 1883.
1675766163: New client connected from ######### as auto-5C0EEB2A-42B6-DE36-1153-7EB1A144CF88 (p2, c1, k60, u'dd').
1675766164: New connection from ######### on port 1883.
1675766164: New client connected from ######### as auto-609E8EB7-4C27-DB1A-AF43-C06947BAB253 (p2, c1, k60, u'dd').
1675766166: Connecting bridge (step 2) #########
1675766168: New connection from ######### on port 1883.
1675766168: New bridge connected from ######### as broker0 (p2, c1, k60, u'dd').
1675766169: Error creating bridge: Protocol error.
1675766175: Connecting bridge (step 1) #########
1675766178: Connecting bridge (step 2) #########
1675766181: mosquitto version 1.6.9 starting

With debugging we have found out that restarts happen only when messages are sent to broker by clients. If there are no incoming messages broker does not make any restarts

@rejuce
Copy link
Author

rejuce commented Feb 8, 2023

nope...for now not using cloud broker at all...or if we have to, use a second isntance of async client

@tannker
Copy link

tannker commented Feb 14, 2023

@rejuce FYI: We updated our broker to 2.0.15. The problem has now disappeared.

@ralight
Copy link
Contributor

ralight commented Apr 7, 2023

This is fixed in later versions already, so I'm closing this issue. Thanks for the report anyway.

@ralight ralight closed this as completed Apr 7, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants