thin-edge / thin-edge.io

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

Software list upload fails for a new device #540

Closed abelikt closed 2 years ago

abelikt commented 2 years ago

Describe the bug

When installing 0.4.1 on a fresh device the software list is not uploaded anymore to Cumulocity.

To Reproduce

sudo dpkg -i tedge_0.4.1_armhf.deb tedge_agent_0.4.1_armhf.deb tedge_apt_plugin_0.4.1_armhf.deb tedge_mapper_0.4.1_armhf.deb
sudo tedge cert create --device-id ...
sudo tedge config set c8y.url ....eu-latest.cumulocity.com
sudo tedge cert upload c8y --user ...
sudo tedge connect c8y
sudo tedge disconnect c8y
sudo tedge connect c8y

Expected behavior

A software list appears in Cumulocity.

Screenshots

![image]([https://user-images.githubusercontent.com/75477722/139433973-d15b7efd-d5e2-4336-a0c3-b0c85e70f5ed.png)|https://user-images.githubusercontent.com/75477722/139433973-d15b7efd-d5e2-4336-a0c3-b0c85e70f5ed.png)]

Environment (please complete the following information):

Rpi 3b+ Linux devraspberrypi 5.10.63-v7+ #1459 SMP Wed Oct 6 16:41:10 BST 2021 armv7l GNU/Linux thin-edge 0.4.1

Additional context Workaround: Manual restart of the software mapper while being connected: sudo systemctl restart tedge-mapper-sm-c8y

Timeboxed to 1

rina23q commented 2 years ago

@PradeepKiruvale confirmed that it was fixed with 0.4.2. Close here.

rina23q commented 2 years ago

This issue is observed again with 0.4.3 on Raspberry Pi OS 5.10.63-v7l+. Therefore, I'd like to reopen it.

We start first sm-agent, then sm-mapper in tedge connect c8y.

Starting tedge-agent service.
Persisting tedge-agent on reboot.
tedge-agent service successfully started and enabled!
Starting tedge-mapper-sm-c8y service.
Persisting tedge-mapper-sm-c8y on reboot.

However, as long as I observe from subscribing mqtt message, it looks first mapper is up, then agent.

[tedge/commands/req/software/list] {"id":"EM3Jqp_sNsDC3jdzVhw4A"}     # from sm-mapper
[tedge/capabilities/software/list]     # from agent
[tedge/capabilities/software/update]     # from agent

Workaround

The workaround is to restart sm-mapper, or publish a software list request message.

sudo tedge mqtt pub tedge/commands/req/software/list '{"id": "1234"}'
rina23q commented 2 years ago

PR is opened. #653