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

Custom MQTT port is not respected when connecting using tedge connect c8y #2787

Closed
reubenmiller opened this issue Mar 17, 2024 · 1 comment
Closed
Assignees
Labels
bug Something isn't working theme:c8y Theme: Cumulocity related topics theme:mqtt Theme: mqtt and mosquitto related topics
Milestone

Comments

@reubenmiller
Copy link
Contributor

reubenmiller commented Mar 17, 2024

Describe the bug

The tedge connect c8y does not use the port given via the c8y.mqtt configuration setting (feature introduced in #1931).

This affects cases where Cumulocity IoT is configured to use a non-default port of 8883.

The code currently incorrectly uses a static value of 8883 (see below):

let mut mqtt_options = MqttOptions::new(bridge_config.remote_clientid.clone(), host[0], 8883);

However it must be noted that the c8y-bridge.conf uses the configured c8y.mqtt host/port.

To Reproduce

The easiest way to check this is to set an incorrect port which should cause thin-edge.io not to connect (due to the misconfigured port).

  1. Set the c8y.url

    tedge config c8y.url thin-edge-io.eu-latest.cumulocity.com
  2. Set a custom c8y.mqtt value which uses an invalid port 1234

    tedge config set c8y.mqtt thin-edge-io.eu-latest.cumulocity.com:1234
  3. It is expected that the tedge connect c8y should fail (due to the incorrect port)

    tedge connect c8y

Expected behavior

When the user specifies a custom MQTT port using the c8y.mqtt configuration.

Screenshots

Environment (please complete the following information):

  • OS [incl. version]: Any
  • Hardware [incl. revision]: Any
  • System-Architecture [e.g. result of "uname -a"]: Any
  • thin-edge.io version [e.g. 0.1.0]: 1.0.1

Additional context

@reubenmiller reubenmiller added bug Something isn't working theme:mqtt Theme: mqtt and mosquitto related topics theme:c8y Theme: Cumulocity related topics labels Mar 17, 2024
albinsuresh pushed a commit to albinsuresh/thin-edge.io that referenced this issue Mar 18, 2024
albinsuresh pushed a commit to albinsuresh/thin-edge.io that referenced this issue Mar 18, 2024
albinsuresh pushed a commit to albinsuresh/thin-edge.io that referenced this issue Mar 20, 2024
albinsuresh pushed a commit to albinsuresh/thin-edge.io that referenced this issue Mar 22, 2024
albinsuresh pushed a commit to albinsuresh/thin-edge.io that referenced this issue Mar 22, 2024
albinsuresh pushed a commit to albinsuresh/thin-edge.io that referenced this issue Mar 22, 2024
albinsuresh pushed a commit to albinsuresh/thin-edge.io that referenced this issue Mar 22, 2024
albinsuresh pushed a commit to albinsuresh/thin-edge.io that referenced this issue Mar 28, 2024
albinsuresh pushed a commit to albinsuresh/thin-edge.io that referenced this issue Mar 28, 2024
jarhodes314 pushed a commit to jarhodes314/thin-edge.io that referenced this issue Apr 8, 2024
@gligorisaev gligorisaev self-assigned this Apr 22, 2024
@gligorisaev
Copy link
Contributor

QA has thoroughly checked the bug and here are the results:

  • Test for ticket covered by unit tests.
  • QA has tested the bug and it's not reproducable anymore

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:c8y Theme: Cumulocity related topics theme:mqtt Theme: mqtt and mosquitto related topics
Projects
None yet
Development

No branches or pull requests

3 participants