thin-edge / thin-edge.io

The open edge framework for lightweight IoT devices
https://thin-edge.io
Apache License 2.0
223 stars 55 forks source link

Always "No operation update required" published in `te/errors` when there is a change on `/etc/tedge/operations/c8y` #3252

Open rina23q opened 1 week ago

rina23q commented 1 week ago

Describe the bug Every time when there is a change on /etc/tedge/operations/c8y/, [te/errors] No operation update required is published. The message doesn't sound an error.

[c8y/s/us] 114,c8y_DeviceProfile,c8y_DownloadConfigFile,c8y_LogfileRequest,c8y_RelayArray,c8y_RemoteAccessConnect,c8y_Restart,c8y_SoftwareUpdate,c8y_UploadConfigFile
[te/errors] No operation update required
[c8y/s/us] 114,aaa,c8y_DeviceProfile,c8y_DownloadConfigFile,c8y_LogfileRequest,c8y_RelayArray,c8y_RemoteAccessConnect,c8y_Restart,c8y_SoftwareUpdate,c8y_UploadConfigFile
[te/errors] No operation update required

The corresponded code is here: https://github.com/thin-edge/thin-edge.io/blob/main/crates/extensions/c8y_mapper_ext/src/converter.rs#L174

    pub fn process_operation_update_message(&mut self, message: DiscoverOp) -> MqttMessage {
        let message_or_err = self.try_process_operation_update_message(&message);
        match message_or_err {
            Ok(Some(msg)) => msg,
            Ok(None) => MqttMessage::new(
                &self.get_mapper_config().errors_topic,
                "No operation update required",
            ),
            Err(err) => self.new_error_message(err),
        }
    }

Can we just get rid of this message?

To Reproduce Just run this:

touch /etc/tedge/operations/c8y/foo

Then check the output of tedge mqtt sub "#"

[c8y/s/us] 114,c8y_DeviceProfile,c8y_DownloadConfigFile,c8y_LogfileRequest,c8y_RelayArray,c8y_RemoteAccessConnect,c8y_Restart,c8y_SoftwareUpdate,c8y_UploadConfigFile,foo
[te/errors] No operation update required

Expected behavior I'm actually not sure what No operation update required is intended for. At least, I'm sure that it should not be published in te/errors.

Screenshots

Environment (please complete the following information):

Additional context

didier-wenzek commented 1 week ago

Can we just get rid of this message?

Yes, there is no point to publish anything on te/errors. And also no point to log anything.