Skip to content

thin-edge health-check not functioning when mqtt bind address is changed #1380

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

Closed
gligorisaev opened this issue Aug 31, 2022 · 4 comments
Closed
Labels
bug Something isn't working theme:mqtt Theme: mqtt and mosquitto related topics

Comments

@gligorisaev
Copy link
Contributor

gligorisaev commented Aug 31, 2022

Describe the bug
thin-edge health-check not functioning when mqtt bind address is changed

To Reproduce

Preconditions

  • thin-edge is installed on DUT
  • DUT is connected to c8y
  • tedge-mapper-c8y.service file is updated with WatchdogSec+30
  • Subscribed to tedge/health tedge mqtt sub tedge/health/#
  • The expected payload is received as expected
  • Unsubdscribed from mqtt with Ctrl+c

Steps to reproduce

  1. Change the MQTT bind address sudo tedge config set mqtt.bind_address XXX.XXX.XXX.XXX
  2. Disconnect from c8y sudo tedge disconnect c8y
  3. Connect to c8y sudo tedge connect c8y
  4. Check the tedge settings tedge config list and observe that the mqtt.bind_address is changed to the address from Step 2
  5. Subscribe to tedge/health tedge mqtt sub tedge/health/#

Observe that no messages will be received

Expected behavior
Health messages to be received as before the bind address change

Screenshots

Environment (please complete the following information):

Additional context

@gligorisaev gligorisaev added the bug Something isn't working label Aug 31, 2022
@rina23q
Copy link
Member

rina23q commented Aug 31, 2022

Can you tell which services are up on your device? Only tedge-mapper-c8y and tedge-agent?

If you have other services like tedge-mapper-collectd, c8y-log-plugin, those are not managed by tedge connect, if you change the MQTT address, you need to restart those services. Otherwise, their mqtt clients cannot know the address change.

@didier-wenzek
Copy link
Contributor

In order to connect to thin-edge MQTT bus, you have to use the external mqtt address

When you configure an external address with:

sudo tedge config set mqtt.external.bind_address XXX.XXX.XXX.XXX

then thin-edge is accessible from two different addresses:

  • The thin-edge components use the localhost interface.
  • While child-devices and other systems (for instance the tests) use the mqtt.external.bind_address.

The use of mqtt.bind_address is very specific. This is when a thin-edge component is not deployed on the same host as the mosquitto server. For instance, if the mapper is running in a container, this mapper must be configured with a mqtt.bind_address set to the mqtt.external.bind_address of the main thin-edge box where mosquitto is running.

=> I see this as a documentation bug. A visual representation might help a lot here as suggested by #1238.

@gligorisaev
Copy link
Contributor Author

In order the new bind address to be working the relevant service needs to be restarted after change is made.
The How to: https://thin-edge.github.io/thin-edge.io/html/howto-guides/008_config_local_mqtt_bind_address_and_port.html
is outdated and missleading.
My expectation would be that with propper change of the How to guide this bug could be closed

@reubenmiller reubenmiller added the theme:mqtt Theme: mqtt and mosquitto related topics label Dec 1, 2022
@gligorisaev gligorisaev removed their assignment Mar 2, 2023
@reubenmiller
Copy link
Contributor

The bug is no longer applicable as of 0.10.0

@reubenmiller reubenmiller closed this as not planned Won't fix, can't repro, duplicate, stale Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working theme:mqtt Theme: mqtt and mosquitto related topics
Projects
None yet
Development

No branches or pull requests

4 participants