Closed reubenmiller closed 10 months ago
The solution was implemented according to the second suggestion in this ticket, i.e. if a failure reason is longer than 500 bytes, truncate it and warn the user about it. The easiest way to test this solution is to use c8y-command-plugin
and force non-zero exit code with long (>500 bytes) error message.
QA has thoroughly checked the bug and here are the results:
Describe the bug
When a custom Cumulocity IoT operation fails and there a large standard error output greater than the max MQTT message size, then it results in an ill-formed SmartREST message as the failure reason quote is not terminated:
For example, a
502
SmartREST message is sent where only the opening quote is included in the failure reason (e.g. the 3rd field of the CSV text).To Reproduce
c8y_Command
operation handler)Expected behavior
Long failure reasons are generally not that helpful as it causes visualization problems in UIs and is anyway unreadable.
The following are the suggested rules to apply to the failure reason handling:
502,c8y_NodeRed,"some long text..."
Screenshots
Environment (please complete the following information):
Debian GNU/Linux 12 (bookworm)
unknown
Linux f28a6f153954 6.5.0-10-generic #10-Ubuntu SMP PREEMPT_DYNAMIC Fri Oct 13 18:28:22 UTC 2023 aarch64 GNU/Linux
tedge 1.0.0-rc.1
Additional context
Below shows the subscription to the
c8y/#
topic where the error was spotted: