-
Notifications
You must be signed in to change notification settings - Fork 72
tedge mqtt sub panics when user provides an invalid MQTT topic #3395
Copy link
Copy link
Closed
Description
Describe the bug
tedge mqtt sub panics when provided with an invalid MQTT topic subscription, e.g. # .
$ tedge mqtt sub '# ' --log-level debug
2025-02-12T09:18:59.260233594Z DEBUG tedge_config::tedge_config_cli::tedge_config_location: Loading configuration from "/etc/tedge/tedge.toml"
INFO: Connected
thread 'main' panicked at crates/core/tedge/src/cli/mqtt/subscribe.rs:116:63:
called `Result::unwrap()` on an `Err` value: Request(Subscribe(Filters = [Filter = # , Qos = AtMostOnce], Packet id = 0))
note: run with `RUST_BACKTRACE=1` environment variable to display a backtraceWhere as publishing an MQTT message to an invalid topic does not panic, but shows an error.
tedge mqtt pub '# ' ''
Error: failed to publish the message "" on the topic "# " with QoS "AtMostOnce".
Caused by:
Failed to send mqtt requests to eventloopTo Reproduce
You can reproduced by running:
$ tedge mqtt sub '# ' --log-level debugExpected behavior
It should not panic, but instead return the error to the user.
Screenshots
Environment (please complete the following information):
| Property | Value |
|---|---|
| OS [incl. version] | Debian GNU/Linux 12 (bookworm) |
| Hardware [incl. revision] | unknown |
| System-Architecture | Linux tedge 6.8.0-39-generic #39-Ubuntu SMP PREEMPT_DYNAMIC Sat Jul 6 02:50:39 UTC 2024 aarch64 GNU/Linux |
| thin-edge.io version | tedge 1.4.3~135+g9a70777 |
Additional context
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working