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

Tedge Agent terminates mqtt connection when it tries to parse the incorrect payload #2225

Closed
Ruadhri17 opened this issue Sep 6, 2023 · 1 comment
Assignees
Labels
bug Something isn't working theme:mqtt Theme: mqtt and mosquitto related topics
Milestone

Comments

@Ruadhri17
Copy link
Contributor

Describe the bug
Tedge Agent closes mqtt connection when there was a problem while parsing the payload. It applies to any tedge agent's topic. After closing the mqtt channel it cannot get any more messages and requires restart.

To Reproduce

  1. Start thin-edge.io and all its components
  2. Send mqtt message with incorrect payload to one of tedge agent's topics using tedge mqtt pub, e.g. tedge mqtt pub 'tedge/commands/req/software/list' '{"ids": "100"}'.
  3. You can check that tedge-agent got error message using systemctl status tedge-agent.service.
  4. Try to send the same message again.
  5. Check tedge-agent status again, it will show message: INFO mqtt_channel::connection: MQTT connection closed

Expected behavior
Tedge-agent should continue running MQTT session when getting errors unless it is problem with MQTT actor.

Log Output

2023-09-06T14:24:55.178009719Z  INFO mqtt_channel::connection: MQTT connection established    
2023-09-06T14:24:55.205492916Z  INFO plugin_sm::plugin_manager: Plugin activated: /etc/tedge/sm-plugins/apt
2023-09-06T14:24:55.205552216Z  INFO plugin_sm::plugin_manager: Default plugin type: Not configured
2023-09-06T14:24:59.516701347Z ERROR Runtime: Actor TedgeOperationConverter-5 has finished unsuccessfully: ActorError(FromSerdeJson(Error("unknown field `ids`, expected `id`", line: 1, column: 6)))    
2023-09-06T14:25:00.194768512Z ERROR Runtime: Actor MQTT-2 has finished unsuccessfully: ChannelError(SendError(SendError { kind: Disconnected }))    
2023-09-06T14:25:00.194861412Z  INFO mqtt_channel::connection: MQTT connection closed   

Environment (please complete the following information):

  • OS [incl. version] : Debian 11
  • Hardware [incl. revision]:
  • System-Architecture [e.g. result of "uname -a"] : Linux 57954d635aa0 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 GNU/Linux
  • thin-edge.io version [e.g. 0.1.0]: 0.12.1~221+gd7c6e05

Additional context

We had similar issue in c8y-log-plugin: #2161 so it might be similar problem here.

@Ruadhri17 Ruadhri17 added bug Something isn't working theme:mqtt Theme: mqtt and mosquitto related topics labels Sep 6, 2023
@Ruadhri17 Ruadhri17 self-assigned this Sep 8, 2023
@reubenmiller reubenmiller added this to the 0.13.0 milestone Sep 12, 2023
@gligorisaev
Copy link
Contributor

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

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

3 participants