Closed reubenmiller closed 3 weeks ago
The event seems to have occurred again on the device under test, below are the tedge-mapper-c8y logs:
Jul 01 13:02:10 rackfslot2 tedge-mapper[2219788]: 2024-07-01T11:02:10.065543723Z INFO mqtt_channel::connection: MQTT connection established
Jul 01 13:02:10 rackfslot2 tedge-mapper[2219788]: 2024-07-01T11:02:10.087623181Z INFO c8y_api::http_proxy: JWT token requested
Jul 01 13:02:10 rackfslot2 tedge-mapper[2219788]: 2024-07-01T11:02:10.103873283Z INFO c8y_api::http_proxy: JWT token received
Jul 01 13:02:10 rackfslot2 tedge-mapper[2219788]: 2024-07-01T11:02:10.104461628Z INFO mqtt_channel::connection: MQTT connection closed
Jul 01 13:02:10 rackfslot2 tedge-mapper[2219788]: 2024-07-01T11:02:10.154844303Z INFO tedge_uploader_ext::actor: Uploading from /tmp/.tmpRAJ3RK/:etc:tedge:tedge.toml-c8y-mapper-10882415 to url: http://127.0.0.1:8001/c8y/event/events/10883500/binaries
Jul 01 13:02:10 rackfslot2 tedge-mapper[2219788]: 2024-07-01T11:02:10.528857274Z INFO mqtt_channel::connection: MQTT connecting to broker: host=127.0.0.1:1883, session_name=None
Jul 01 13:02:10 rackfslot2 tedge-mapper[2219788]: 2024-07-01T11:02:10.530204314Z INFO mqtt_channel::connection: MQTT connection established
Jul 01 13:02:10 rackfslot2 tedge-mapper[2219788]: 2024-07-01T11:02:10.552273457Z INFO c8y_api::http_proxy: JWT token requested
Jul 01 13:02:10 rackfslot2 tedge-mapper[2219788]: 2024-07-01T11:02:10.568016047Z INFO c8y_api::http_proxy: JWT token received
Jul 01 13:02:10 rackfslot2 tedge-mapper[2219788]: 2024-07-01T11:02:10.56858441Z INFO mqtt_channel::connection: MQTT connection closed
Jul 01 13:02:37 rackfslot2 tedge-mapper[2219788]: 2024-07-01T11:02:37.61500343Z INFO tedge_downloader_ext::actor: Downloading from url http://127.0.0.1:8000/tedge/file-transfer/osadl-rackfslot2/log_upload/tedge-bridge-monitor-c8y-mapper-10882417 to location /tmp/.tmpvpwa7N/tedge-bridge-monitor-c8y-mapper-10882417
Jul 01 13:02:37 rackfslot2 tedge-mapper[2219788]: 2024-07-01T11:02:37.625846911Z INFO download::download: Downloading file from url="http://127.0.0.1:8000/tedge/file-transfer/osadl-rackfslot2/log_upload/tedge-bridge-monitor-c8y-mapper-10882417", len=0
Jul 01 13:02:37 rackfslot2 tedge-mapper[2219788]: 2024-07-01T11:02:37.646764105Z INFO tedge_uploader_ext::actor: Uploading from /tmp/.tmpvpwa7N/tedge-bridge-monitor-c8y-mapper-10882417 to url: http://127.0.0.1:8001/c8y/event/events/10880045/binaries
Jul 04 08:28:11 rackfslot2 tedge-mapper[2219788]: 2024-07-04T06:28:11.625840188Z ERROR tedge_mqtt_bridge::health: MQTT bridge failed to connect to cloud broker: Mqtt state: Last pingreq isn't acked
Jul 04 08:28:11 rackfslot2 tedge-mapper[2219788]: 2024-07-04T06:28:11.625985112Z INFO tedge_mqtt_bridge: Waiting 25.97075156s until attempting reconnection to cloud broker
Jul 04 08:28:37 rackfslot2 tedge-mapper[2219788]: 2024-07-04T06:28:37.72420315Z INFO tedge_mqtt_bridge::health: MQTT bridge connected to cloud broker
Jul 04 08:28:37 rackfslot2 tedge-mapper[2219788]: 2024-07-04T06:28:37.724326852Z INFO tedge_mqtt_bridge: Bridge cloud connection "cloud" subscribing to [Filter = s/dt, Qos = AtLeastOnce, Filter = s/dat, Qos = AtLeastOnce, Filter = s/ds, Qos = AtLeastOnce, Filter = s/e, Qos = AtLeastOnce, Filter = devicecontrol/notifications, Qos = AtLeastOnce, Filter = error, Qos = AtLeastOnce]
Jul 04 08:37:14 rackfslot2 tedge-mapper[2219788]: 2024-07-04T06:37:14.163169576Z ERROR tedge_mqtt_bridge::health: MQTT bridge failed to connect to cloud broker: Mqtt state: Io error: Custom { kind: ConnectionAborted, error: "connection closed by peer" }
Jul 04 08:37:14 rackfslot2 tedge-mapper[2219788]: 2024-07-04T06:37:14.163277593Z INFO tedge_mqtt_bridge: Waiting 15.633064796s until attempting reconnection to cloud broker
Jul 04 08:37:30 rackfslot2 tedge-mapper[2219788]: 2024-07-04T06:37:30.041670265Z INFO tedge_mqtt_bridge::health: MQTT bridge connected to cloud broker
Jul 04 08:37:30 rackfslot2 tedge-mapper[2219788]: 2024-07-04T06:37:30.041784134Z INFO tedge_mqtt_bridge: Bridge cloud connection "cloud" subscribing to [Filter = s/dt, Qos = AtLeastOnce, Filter = s/dat, Qos = AtLeastOnce, Filter = s/ds, Qos = AtLeastOnce, Filter = s/e, Qos = AtLeastOnce, Filter = devicecontrol/notifications, Qos = AtLeastOnce, Filter = error, Qos = AtLeastOnce]
Jul 04 09:00:01 rackfslot2 tedge-mapper[2219788]: 2024-07-04T07:00:01.684107842Z ERROR tedge_mqtt_bridge::health: MQTT bridge failed to connect to cloud broker: I/O: Broken pipe (os error 32)
Jul 04 09:00:01 rackfslot2 tedge-mapper[2219788]: 2024-07-04T07:00:01.68473139Z INFO tedge_mqtt_bridge: Waiting 44.01264048s until attempting reconnection to cloud broker
Jul 04 09:00:45 rackfslot2 tedge-mapper[2219788]: 2024-07-04T07:00:45.947290995Z INFO tedge_mqtt_bridge::health: MQTT bridge connected to cloud broker
Jul 04 09:00:45 rackfslot2 tedge-mapper[2219788]: 2024-07-04T07:00:45.94742066Z INFO tedge_mqtt_bridge: Bridge cloud connection "cloud" subscribing to [Filter = s/dt, Qos = AtLeastOnce, Filter = s/dat, Qos = AtLeastOnce, Filter = s/ds, Qos = AtLeastOnce, Filter = s/e, Qos = AtLeastOnce, Filter = devicecontrol/notifications, Qos = AtLeastOnce, Filter = error, Qos = AtLeastOnce]
And checking with the tedge connect c8y --test
also seems to confirm that the connection to the cloud is now longer there:
# tedge connect c8y --test
The system config file '/etc/tedge/system.toml' doesn't exist. Using '/bin/systemctl' as the default service manager
Detected mosquitto version >= 2.0.0
Sending packets to check connection. This may take up to 2 seconds.
ERROR: Local MQTT publish has timed out.
Error: failed to test connection to Cumulocity cloud.
Caused by:
Operation timed out. Is mosquitto running?
The issue is now fixed in #2982, but I am detailing the issue here so it's easy to find the root cause if we come across a similar issue in future.
In order to link messages to packet IDs so we can acknowledge the incoming message when we receive an acknowledgement for the forwarded message, we have a channel between the two bridge halves. When publishing a message, we send the Publish
struct to the other bridge half:
And when the other bridge half receives the Publish
event from rumqttc
with the packet ID, we await the receipt of this Publish
struct:
After a disconnection, however, any in-flight (i.e. unacknowledged) messages are re-published by rumqttc
, so we receive another Publish
event and wait on companion_bridge_half.recv()
, but there is no corresponding companion_bridge_half.send()
, so this blocks indefinitely.
The solution to this issue is to detect these duplicate publishes and ignore them. Since the packet ID remains the same for the original and republished message, all that is needed here is to check whether the ID is in forwarded_pkid_to_received_msg
and if so, skip trying to receive the message from the companion bridge half.
There has been a second incident on the osadl-rackfslot2 device, where the mapper has stopped sending measurements and left an operation in the EXECUTING state. The incident seems to be triggered by requesting a config_snapshot
from the device via Cumulocity IoT, where the tedge-mapper-c8y failed to get a JWT which occurred at ~9:38 local time.
Below are the logs collected from the device.
# journalctl -fu tedge-mapper-c8y
Jul 25 09:39:39 rackfslot2 tedge-mapper[1591753]: 2024-07-25T07:39:39.434975965Z INFO mqtt_channel::connection: MQTT connection closed
Jul 25 09:39:39 rackfslot2 tedge-mapper[1591753]: 2024-07-25T07:39:39.637275725Z INFO mqtt_channel::connection: MQTT connecting to broker: host=127.0.0.1:1883, session_name=None
Jul 25 09:39:39 rackfslot2 tedge-mapper[1591753]: 2024-07-25T07:39:39.638372879Z INFO mqtt_channel::connection: MQTT connection established
Jul 25 09:39:39 rackfslot2 tedge-mapper[1591753]: 2024-07-25T07:39:39.659390596Z INFO c8y_api::http_proxy: JWT token requested
Jul 25 09:39:59 rackfslot2 tedge-mapper[1591753]: 2024-07-25T07:39:59.660836141Z INFO c8y_api::http_proxy: JWT token requested
Jul 25 09:40:00 rackfslot2 tedge-mapper[1591753]: 2024-07-25T07:40:00.520462242Z DEBUG tedge_mqtt_bridge: Received notification (cloud) Outgoing(PingReq)
Jul 25 09:40:00 rackfslot2 tedge-mapper[1591753]: 2024-07-25T07:40:00.520578629Z DEBUG tedge_mqtt_bridge: Processed notification (cloud) Outgoing(PingReq)
Jul 25 09:40:00 rackfslot2 tedge-mapper[1591753]: 2024-07-25T07:40:00.532787912Z DEBUG tedge_mqtt_bridge: Received notification (cloud) Incoming(PingResp)
Jul 25 09:40:00 rackfslot2 tedge-mapper[1591753]: 2024-07-25T07:40:00.53286517Z DEBUG tedge_mqtt_bridge: Processed notification (cloud) Incoming(PingResp)
Jul 25 09:40:19 rackfslot2 tedge-mapper[1591753]: 2024-07-25T07:40:19.661910165Z INFO c8y_api::http_proxy: JWT token requested
Jul 25 09:40:39 rackfslot2 tedge-mapper[1591753]: 2024-07-25T07:40:39.663362825Z ERROR c8y_api::http_proxy: Fail to retrieve JWT token after 3 attempts
Jul 25 09:40:39 rackfslot2 tedge-mapper[1591753]: thread 'tokio-runtime-worker' panicked at crates/extensions/c8y_auth_proxy/src/tokens.rs:44:72:
Jul 25 09:40:39 rackfslot2 tedge-mapper[1591753]: called `Result::unwrap()` on an `Err` value: NoJwtReceived
Jul 25 09:40:39 rackfslot2 tedge-mapper[1591753]: 2024-07-25T07:40:39.664393276Z INFO mqtt_channel::connection: MQTT connection closed
Jul 25 09:40:39 rackfslot2 tedge-mapper[1591753]: 2024-07-25T07:40:39.666860673Z WARN upload::upload: Temporary failure: error sending request for url (http://127.0.0.1:8001/c8y/event/events/11358344/binaries): connection closed before message completed. Retrying in 14s
Jul 25 09:40:54 rackfslot2 tedge-mapper[1591753]: 2024-07-25T07:40:54.121150124Z INFO mqtt_channel::connection: MQTT connecting to broker: host=127.0.0.1:1883, session_name=None
Jul 25 09:40:54 rackfslot2 tedge-mapper[1591753]: 2024-07-25T07:40:54.122187205Z INFO mqtt_channel::connection: MQTT connection established
Jul 25 09:40:54 rackfslot2 tedge-mapper[1591753]: 2024-07-25T07:40:54.143851544Z INFO c8y_api::http_proxy: JWT token requested
Jul 25 09:41:00 rackfslot2 tedge-mapper[1591753]: 2024-07-25T07:41:00.520909789Z DEBUG tedge_mqtt_bridge: Received notification (cloud) Outgoing(PingReq)
Jul 25 09:41:00 rackfslot2 tedge-mapper[1591753]: 2024-07-25T07:41:00.521029751Z DEBUG tedge_mqtt_bridge: Processed notification (cloud) Outgoing(PingReq)
Jul 25 09:41:00 rackfslot2 tedge-mapper[1591753]: 2024-07-25T07:41:00.532862816Z DEBUG tedge_mqtt_bridge: Received notification (cloud) Incoming(PingResp)
Jul 25 09:41:00 rackfslot2 tedge-mapper[1591753]: 2024-07-25T07:41:00.532966111Z DEBUG tedge_mqtt_bridge: Processed notification (cloud) Incoming(PingResp)
Jul 25 09:41:14 rackfslot2 tedge-mapper[1591753]: 2024-07-25T07:41:14.144475845Z INFO c8y_api::http_proxy: JWT token requested
Jul 25 09:41:34 rackfslot2 tedge-mapper[1591753]: 2024-07-25T07:41:34.145688763Z INFO c8y_api::http_proxy: JWT token requested
Jul 25 09:41:54 rackfslot2 tedge-mapper[1591753]: 2024-07-25T07:41:54.146814082Z ERROR c8y_api::http_proxy: Fail to retrieve JWT token after 3 attempts
Jul 25 09:41:54 rackfslot2 tedge-mapper[1591753]: 2024-07-25T07:41:54.147141152Z INFO mqtt_channel::connection: MQTT connection closed
Jul 25 09:41:54 rackfslot2 tedge-mapper[1591753]: thread 'tokio-runtime-worker' panicked at crates/extensions/c8y_auth_proxy/src/tokens.rs:44:72:
Jul 25 09:41:54 rackfslot2 tedge-mapper[1591753]: called `Result::unwrap()` on an `Err` value: NoJwtReceived
Jul 25 09:41:54 rackfslot2 tedge-mapper[1591753]: 2024-07-25T07:41:54.34620197Z INFO mqtt_channel::connection: MQTT connecting to broker: host=127.0.0.1:1883, session_name=None
Jul 25 09:41:54 rackfslot2 tedge-mapper[1591753]: 2024-07-25T07:41:54.347374438Z INFO mqtt_channel::connection: MQTT connection established
Jul 25 09:41:54 rackfslot2 tedge-mapper[1591753]: 2024-07-25T07:41:54.369155183Z INFO c8y_api::http_proxy: JWT token requested
Jul 25 09:42:00 rackfslot2 tedge-mapper[1591753]: 2024-07-25T07:42:00.523963967Z DEBUG tedge_mqtt_bridge: Received notification (cloud) Outgoing(PingReq)
Jul 25 09:42:00 rackfslot2 tedge-mapper[1591753]: 2024-07-25T07:42:00.524082873Z DEBUG tedge_mqtt_bridge: Processed notification (cloud) Outgoing(PingReq)
Jul 25 09:42:00 rackfslot2 tedge-mapper[1591753]: 2024-07-25T07:42:00.704925608Z DEBUG tedge_mqtt_bridge: Received notification (cloud) Incoming(PingResp)
Jul 25 09:42:00 rackfslot2 tedge-mapper[1591753]: 2024-07-25T07:42:00.705034255Z DEBUG tedge_mqtt_bridge: Processed notification (cloud) Incoming(PingResp)
Jul 25 09:42:14 rackfslot2 tedge-mapper[1591753]: 2024-07-25T07:42:14.370257125Z INFO c8y_api::http_proxy: JWT token requested
# tedge mqtt sub '#'
INFO: Connected
[te/device/main/service/c8y-firmware-plugin] {"@id":"osadl-rackfslot2:device:main:service:c8y-firmware-plugin","@parent":"device/main//","@type":"service","name":"c8y-firmware-plugin","type":"service"}
[te/device/main/service/c8y-firmware-plugin/status/health] {"pid":156187,"status":"up","time":1721233775.4812958}
[te/device/main/service/mosquitto-c8y-bridge] {"@id":"osadl-rackfslot2:device:main:service:mosquitto-c8y-bridge","@parent":"device/main//","@type":"service","name":"mosquitto-c8y-bridge","type":"service"}
[te/device/main/service/mosquitto-c8y-bridge/status/health] 0
[te/device/main/service/tedge-mapper-c8y] {"@id":"osadl-rackfslot2:device:main:service:tedge-mapper-c8y","@parent":"device/main//","@type":"service","name":"tedge-mapper-c8y","type":"service"}
[te/device/main/service/tedge-mapper-c8y/status/health] {"pid":1591753,"status":"up","time":1721233805.716494}
[te/device/main/service/tedge-agent] {"@parent":"device/main//","@type":"service","type":"service"}
[te/device/main/service/tedge-agent/status/health] {"pid":1591718,"status":"up","time":1721233783.8334885}
[te/device/main/service/tedge-mapper-collectd] {"@parent":"device/main//","@type":"service","type":"service"}
[te/device/main/service/tedge-mapper-collectd/status/health] {"pid":1591745,"status":"up","time":1721233801.9732199}
[te/device/main/service/tedge-mapper-bridge-c8y] {"@id":"osadl-rackfslot2:device:main:service:tedge-mapper-bridge-c8y","@parent":"device/main//","@type":"service","name":"tedge-mapper-bridge-c8y","type":"service"}
[te/device/main/service/tedge-mapper-bridge-c8y/status/health] {"status":"down"}
[te/device/main///cmd/config_snapshot] {"types":["/etc/tedge/tedge.toml","c8y-bridge.conf","tedge-configuration-plugin","tedge-log-plugin","tedge-mosquitto.conf"]}
[te/device/main///cmd/config_snapshot/c8y-mapper-11361151] {"logPath":"/var/log/tedge/agent/workflow-config_snapshot-c8y-mapper-11361151.log","path":"/etc/tedge/tedge.toml","status":"successful","tedgeUrl":"http://127.0.0.1:8000/tedge/file-transfer/osadl-rackfslot2/config_snapshot/:etc:tedge:tedge.toml-c8y-mapper-11361151","type":"/etc/tedge/tedge.toml"}
[te/device/main///cmd/config_update] {"types":["/etc/tedge/tedge.toml","c8y-bridge.conf","tedge-configuration-plugin","tedge-log-plugin","tedge-mosquitto.conf"]}
[te/device/main///cmd/log_upload] {"types":["auth","cron","kern","mosquitto","software-management","system","tedge-benchmark","tedge-bridge-monitor"]}
[te/device/main///cmd/restart] {}
[te/device/main///cmd/software_list] {"types":["apt"]}
[te/device/main///cmd/software_update] {"types":["apt"]}
[te/device/main///twin/c8y_Agent] {"name":"thin-edge.io","url":"https://thin-edge.io","version":"1.1.2~201+g5886e5d"}
bridge monitor logs
{"tst":"2024-07-16T02:10:30.420483+0200","topic":"te/device/main/service/tedge-mapper-bridge-c8y/status/health","qos":0,"retain":0,"payloadlen":17,"payload":"{\"status\":\"down\"}"}
{"tst":"2024-07-16T02:11:01.683226+0200","topic":"te/device/main/service/tedge-mapper-bridge-c8y/status/health","qos":0,"retain":0,"payloadlen":15,"payload":"{\"status\":\"up\"}"}
{"tst":"2024-07-17T16:23:54.884758+0200","topic":"te/device/main/service/tedge-mapper-bridge-c8y/status/health","qos":0,"retain":0,"payloadlen":17,"payload":"{\"status\":\"down\"}"}
{"tst":"2024-07-17T16:23:55.946158+0200","topic":"te/device/main/service/tedge-mapper-bridge-c8y/status/health","qos":0,"retain":1,"payloadlen":17,"payload":"{\"status\":\"down\"}"}
{"tst":"2024-07-17T16:24:19.457445+0200","topic":"te/device/main/service/tedge-mapper-bridge-c8y/status/health","qos":0,"retain":0,"payloadlen":17,"payload":"{\"status\":\"down\"}"}
{"tst":"2024-07-17T16:24:19.502298+0200","topic":"te/device/main/service/tedge-mapper-bridge-c8y/status/health","qos":0,"retain":0,"payloadlen":15,"payload":"{\"status\":\"up\"}"}
{"tst":"2024-07-17T16:24:43.985536+0200","topic":"te/device/main/service/tedge-mapper-bridge-c8y/status/health","qos":0,"retain":0,"payloadlen":17,"payload":"{\"status\":\"down\"}"}
{"tst":"2024-07-17T16:24:45.549973+0200","topic":"te/device/main/service/tedge-mapper-bridge-c8y/status/health","qos":0,"retain":0,"payloadlen":15,"payload":"{\"status\":\"up\"}"}
{"tst":"2024-07-17T18:29:34.465586+0200","topic":"te/device/main/service/tedge-mapper-bridge-c8y/status/health","qos":0,"retain":0,"payloadlen":17,"payload":"{\"status\":\"down\"}"}
{"tst":"2024-07-17T18:29:35.526201+0200","topic":"te/device/main/service/tedge-mapper-bridge-c8y/status/health","qos":0,"retain":1,"payloadlen":17,"payload":"{\"status\":\"down\"}"}
{"tst":"2024-07-17T18:29:52.113442+0200","topic":"te/device/main/service/tedge-mapper-bridge-c8y/status/health","qos":0,"retain":0,"payloadlen":17,"payload":"{\"status\":\"down\"}"}
{"tst":"2024-07-17T18:29:52.113589+0200","topic":"te/device/main/service/tedge-mapper-bridge-c8y/status/health","qos":0,"retain":0,"payloadlen":15,"payload":"{\"status\":\"up\"}"}
{"tst":"2024-07-17T18:30:05.629639+0200","topic":"te/device/main/service/tedge-mapper-bridge-c8y/status/health","qos":0,"retain":0,"payloadlen":17,"payload":"{\"status\":\"down\"}"}
{"tst":"2024-07-17T18:30:05.840028+0200","topic":"te/device/main/service/tedge-mapper-bridge-c8y/status/health","qos":0,"retain":0,"payloadlen":15,"payload":"{\"status\":\"up\"}"}
{"tst":"2024-07-18T10:43:06.028564+0200","topic":"te/device/main/service/tedge-mapper-bridge-c8y/status/health","qos":0,"retain":0,"payloadlen":17,"payload":"{\"status\":\"down\"}"}
{"tst":"2024-07-18T10:43:47.660542+0200","topic":"te/device/main/service/tedge-mapper-bridge-c8y/status/health","qos":0,"retain":0,"payloadlen":15,"payload":"{\"status\":\"up\"}"}
{"tst":"2024-07-25T09:40:09.976420+0200","topic":"te/device/main/service/tedge-mapper-bridge-c8y/status/health","qos":0,"retain":0,"payloadlen":17,"payload":"{\"status\":\"down\"}"}
tedge-mapper-c8y systemd status
$ systemctl status tedge-mapper-c8y
● tedge-mapper-c8y.service - tedge-mapper-c8y converts Thin Edge JSON measurements to Cumulocity JSON format.
Loaded: loaded (/lib/systemd/system/tedge-mapper-c8y.service; enabled; preset: enabled)
Drop-In: /etc/systemd/system/tedge-mapper-c8y.service.d
└─override.conf
Active: active (running) since Wed 2024-07-17 18:30:05 CEST; 1 week 0 days ago
Process: 1591752 ExecStartPre=/usr/bin/tedge init (code=exited, status=0/SUCCESS)
Main PID: 1591753 (tedge-mapper)
Tasks: 7 (limit: 1583)
Memory: 4.3M
CPU: 17min 901ms
CGroup: /system.slice/tedge-mapper-c8y.service
└─1591753 /usr/bin/tedge-mapper c8y
The Cumulocity IoT Core's logs shows the following error log entry (cumulocity-core/c8ycore-sts-4:cumulocity-core
):
2024-07-25 09:38:39.191 SessionAuth: Tenant's 'qaenvironment' user 'device_osadl-rackfslot2', 'f5aa4e4b-4434-4821-9570-1d9fc853aee0' sessions deleted.
I've found an explanation for the last reported event where the built-in bridge was marked as down...
There is a problem with the handling of QoS=0 messages where the package identifier (pkid) is 0. This results in the following problems:
PubAck
or PubRec
MQTT message which does not happen when dealing with QoS=0 messages.The scenario can be reproduced, by executing the following command about 10 times, after 8-9 calls, the command starts to fail and it does not recover until you restart the tedge-mapper-c8y
service (though I didn't wait that long before restarting the service):
tedge connect c8y --test
The following is the system test and proposed "fix" (pending Rust review):
Closing the ticket as the built-in mapper seems to have stabilized and has been running for 1.5 months and is still functional (on the osadl2 device, with tedge 1.3.0
).
Below is the service status showing the runtime:
root@rackfslot2:~# systemctl status tedge-mapper-c8y
● tedge-mapper-c8y.service - tedge-mapper-c8y converts Thin Edge JSON measurements to Cumulocity JSON format.
Loaded: loaded (/lib/systemd/system/tedge-mapper-c8y.service; enabled; preset: enabled)
Drop-In: /etc/systemd/system/tedge-mapper-c8y.service.d
└─override.conf
Active: active (running) since Fri 2024-09-20 15:26:46 CEST; 1 month 14 days ago
Main PID: 110720 (tedge-mapper)
Tasks: 7 (limit: 1583)
Memory: 7.9M
CPU: 1h 38min 37.309s
CGroup: /system.slice/tedge-mapper-c8y.service
└─110720 /usr/bin/tedge-mapper c8y
Describe the bug
The tedge-mapper-c8y process stops sending data to Cumulocity IoT when using the built-in bridge.
The device where the problem was seen includes a special MQTT subscription which looks at the
tedge-mapper-bridge-c8y
service status, and the log shows that the status was toggling betweenup
anddown
, though it is currently showing asup
even though the device is not responding to operations or sending measurements.The
tedge connect c8y --test
mostly fails, but sporadically passes (e.g. it will receive a jwt every now and then), below shows both the failed connection test.Symptoms
c8y/#
topictedge-mapper-c8y
service seemed to resume normal function (e.g. operations were processed and measurements were sent)To Reproduce
It is unclear how to reproduce the bug. This section will be expanded once more information is known.
Expected behavior
The built-in bridge should reliably reconnect to the IoT Cloud, and the status of the bridge should be faithfully represented on the associated service topic.
Screenshots
Environment (please complete the following information):
Debian GNU/Linux 12 (bookworm)
Raspberry Pi 4 Model B Rev 1.5
Linux rackfslot2 6.6.20+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.20-1+rpt1 (2024-03-07) aarch64 GNU/Linux
tedge 1.1.2~129+gdc64912
Additional context
journalctl -fu tedge-mapper-c8y