Skip to content

Conversation

rina23q
Copy link
Member

@rina23q rina23q commented Jun 16, 2024

Proposed changes

This PR is the replacement of the PR #2866.

Now @health is limited to EntityTopicId scheme, the 4-segments identifier.
If user wants to monitor a custom service, they need to provide @health in the registration message payload like below.

{
  "@health": "any/four/segments/topic",
  "@type": "child-device"
}

Then, the status of te/any/four/segments/topic/status/health will be respected.

Todo:

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (general improvements like code refactoring that doesn't explicitly fix a bug or add any new functionality)
  • Documentation Update (if none of the other choices apply)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Paste Link to the issue

#2842

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA (in all commits with git commit -s)
  • I ran cargo fmt as mentioned in CODING_GUIDELINES
  • I used cargo clippy as mentioned in CODING_GUIDELINES
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

@rina23q rina23q had a problem deploying to Test Pull Request June 16, 2024 19:47 — with GitHub Actions Failure
Copy link

codecov bot commented Jun 16, 2024

Codecov Report

Attention: Patch coverage is 82.04473% with 281 lines in your changes missing coverage. Please review.

Project coverage is 78.1%. Comparing base (d1359b0) to head (d55b5a2).
Report is 44 commits behind head on main.

Additional details and impacted files
Files Coverage Δ
crates/core/c8y_api/src/smartrest/inventory.rs 69.3% <100.0%> (+2.7%) ⬆️
...s/core/tedge_api/src/store/pending_entity_store.rs 97.1% <100.0%> (+<0.1%) ⬆️
crates/extensions/c8y_mapper_ext/src/lib.rs 88.8% <ø> (ø)
...ates/extensions/tedge_mqtt_ext/src/test_helpers.rs 78.3% <100.0%> (+0.4%) ⬆️
crates/extensions/c8y_mapper_ext/src/inventory.rs 84.7% <88.8%> (-0.7%) ⬇️
...es/extensions/c8y_mapper_ext/src/operations/mod.rs 92.5% <50.0%> (+<0.1%) ⬆️
.../tedge_config/src/tedge_config_cli/tedge_config.rs 74.3% <64.2%> (-2.6%) ⬇️
...s/c8y_mapper_ext/src/operations/config_snapshot.rs 90.7% <73.9%> (+0.1%) ⬆️
...ons/c8y_mapper_ext/src/operations/config_update.rs 92.9% <50.0%> (+0.1%) ⬆️
crates/core/tedge_api/src/mqtt_topics.rs 87.1% <68.0%> (-1.0%) ⬇️
... and 10 more

... and 27 files with indirect coverage changes

@rina23q rina23q had a problem deploying to Test Pull Request June 17, 2024 15:39 — with GitHub Actions Failure
@rina23q rina23q changed the title Spawn AvailabilityActor feat: support c8y device availability by AvailabilityActor Jun 18, 2024
@rina23q rina23q added theme:c8y Theme: Cumulocity related topics theme:monitoring Theme: Service monitoring and watchdogs labels Jun 18, 2024
@rina23q rina23q temporarily deployed to Test Pull Request June 18, 2024 16:05 — with GitHub Actions Inactive
@rina23q
Copy link
Member Author

rina23q commented Jun 18, 2024

I'll add user guide tomorrow. Since the code and tests are ready for review, I would change the status to open.

@rina23q rina23q marked this pull request as ready for review June 18, 2024 16:13
@rina23q rina23q requested review from jarhodes314, gligorisaev and a team as code owners June 18, 2024 16:13
Copy link
Contributor

@didier-wenzek didier-wenzek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is in a good shape. Some points can still be improved, though.

Copy link
Contributor

github-actions bot commented Jun 19, 2024

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
425 35 3 460 92.39 1h54m49.208978s

Failed Tests

Name Message ⏱️ Duration Suite
Check lock file existence in default folder test -f &#39;/run/lock/tedge-agent... returned an unexpected exit code stdout: stderr: 32.141 s Lock File
Check PID number in lock file cat /run/lock/tedge-agent.lock returned an unexpected exit code stdout: stderr: cat: /run/lock/tedge-agent.lock: No such file or directory 31.991 s Lock File
Check PID number in lock file after restarting the services cat /run/lock/tedge-agent.lock returned an unexpected exit code stdout: stderr: cat: /run/lock/tedge-agent.lock: No such file or directory 32.514 s Lock File
c8y_RequiredAvailability is set by default to an hour ./bootstrap.sh returned an unexpected exit code stdout: ---------------------------------------------------------- Initializing ---------------------------------------------------------- Detected version from positional argument. version= Using local dpkg install method as local .deb files were found in folder: . ---------------------------------------------------------- Installing thin-edge.io ---------------------------------------------------------- Installing thin-edge.io using local files (from path=.) (Reading database ... 9367 files and directories currently installed.) Preparing to unpack .../tedge_1.1.2175+gf76ba28_amd64.deb ... Unpacking tedge (1.1.2175+gf76ba28) over (1.1.2175+gf76ba28) ... Setting up tedge (1.1.2175+gf76ba28) ... No bridges to refresh. (Reading database ... 9367 files and directories currently installed.) Preparing to unpack .../tedge-mapper_1.1.2~175+gf76ba28_amd64.deb ... [ Message content over the limit has been removed. ] ...............+.....+...+....+......+...+..+.......+.....+.+.....+......+.+.....+....+.....+...+...+.........+.+..............+.+...+...........+......+.......+......+.....+.........+.+.....+.......+.....+.........+...+.............+............+...+..+...+.......+..+......+....+...+.....+......+.......+........+.........+.......+...........+....+......+........+......+......+....++++++ ...+......+.......+...+..+++++++++++++++++++++++++++++++++++++++....+....+...+..+............+.+........+.+......+..+++++++++++++++++++++++++++++++++++++++.........+...+..+.......+....................+.+..+...................+......+...+.....+......+.+...+.........+.................................+...+..+....+...........+...............+...+.+...+...+..+......+.........+......+.+......+........+.+...+...+........+......+.+...+..+.......+......+..+..........+...+......+........+......+............+....+.....+......+.......+......+.....+.......+..+...+.........+...+...+.......+.....+..........+.....+......+..........+..+...++++++ ----- Certificate request self-signature ok subject=C=US, ST=Denial, L=Springfield, O=Dis, CN=d9ba278afc80 Certificate request self-signature ok subject=C=US, ST=Denial, L=Springfield, O=Dis, CN=client1 Failed to connect to bus: No such file or directory 33.227 s C8Y Required Availability
Successful log operation Setup failed: tedge connect c8y returned an unexpected exit code stdout: stderr: Error: failed to connect to Cumulocity cloud. Caused by: A value for 'c8y.url' is missing. A value can be set with tedge config set c8y.url &lt;value&gt; Also teardown failed: Variable '${CHILD_SN}' not found. 35.073 s Log Operation Child
Entities send to cloud on restart DeviceNotFound 33.468 s Registration Lifecycle
Support restarting the device Parent suite setup failed: tedge connect c8y returned an unexpected exit code stdout: stderr: Error: failed to connect to Cumulocity cloud. Caused by: A value for 'c8y.url' is missing. A value can be set with tedge config set c8y.url &lt;value&gt; 0.034 s Restart Device Child
Restart operation should be set to failed when an non-existent command is configured Parent suite setup failed: tedge connect c8y returned an unexpected exit code stdout: stderr: Error: failed to connect to Cumulocity cloud. Caused by: A value for 'c8y.url' is missing. A value can be set with tedge config set c8y.url &lt;value&gt; 0.056 s Restart Device Child
Restart operation should be set to failed when command is not allowed by sudo Parent suite setup failed: tedge connect c8y returned an unexpected exit code stdout: stderr: Error: failed to connect to Cumulocity cloud. Caused by: A value for 'c8y.url' is missing. A value can be set with tedge config set c8y.url &lt;value&gt; 0.042 s Restart Device Child
Restart operation should be set to failed when the command does not restart the device Parent suite setup failed: tedge connect c8y returned an unexpected exit code stdout: stderr: Error: failed to connect to Cumulocity cloud. Caused by: A value for 'c8y.url' is missing. A value can be set with tedge config set c8y.url &lt;value&gt; 0.041 s Restart Device Child
Restart operation should be set to failed if the restart command times out Parent suite setup failed: tedge connect c8y returned an unexpected exit code stdout: stderr: Error: failed to connect to Cumulocity cloud. Caused by: A value for 'c8y.url' is missing. A value can be set with tedge config set c8y.url &lt;value&gt; 0.030 s Restart Device Child
Restart operation should be set to failed when the command has been killed by a signal Parent suite setup failed: tedge connect c8y returned an unexpected exit code stdout: stderr: Error: failed to connect to Cumulocity cloud. Caused by: A value for 'c8y.url' is missing. A value can be set with tedge config set c8y.url &lt;value&gt; 0.044 s Restart Device Child
Default restart timeout supports the default 60 second delay of the linux shutdown command Parent suite setup failed: tedge connect c8y returned an unexpected exit code stdout: stderr: Error: failed to connect to Cumulocity cloud. Caused by: A value for 'c8y.url' is missing. A value can be set with tedge config set c8y.url &lt;value&gt; 0.047 s Restart Device Child
Update tedge version from previous using Cumulocity curl -fsSL https://raw.githubu... returned an unexpected exit code stdout: ignore c8y-firmware-plugin and c8y-remote-access-plugin as they are not supported in <= 0.10.0 Thank you for trying thin-edge.io! Installing for architecture amd64 Downloading tedge...OK Installing tedge...OK Downloading tedge_mapper...OK Installing tedge_mapper...FAILED Failed to install thin-edge.io Reason: Failed to install package 'tedge_mapper' Please create a ticket using the following link and include the console output https://github.com/thin-edge/thin-edge.io/issues/new?assignees=&amp;labels=bug&amp;template=bug_report.md [ Message content over the limit has been removed. ] [2m2024-07-08T08:43:05.128556932Z[0m [31mERROR[0m [2mflockfile::unix[0m[2m:[0m Lock file path: /run/lock/tedge-mapper-c8y.lock Error: Couldn't acquire file lock. Caused by: No such file or directory (os error 2) dpkg: error processing package tedge_mapper (--install): installed tedge_mapper package post-installation script subprocess returned error exit status 1 Errors were encountered while processing: tedge_mapper Failed to install thin-edge.io Reason: Failed to install package 'tedge_mapper' Please create a ticket using the following link and include the console output https://github.com/thin-edge/thin-edge.io/issues/new?assignees=&labels=bug&template=bug_report.md ------------------------------------------------------ stderr: [RETRY] FAIL on 1. retry. 33.856 s Tedge Self Update
Refreshes mosquitto bridge configuration curl -fsSL https://raw.githubu... returned an unexpected exit code stdout: Thank you for trying thin-edge.io! Installing for architecture amd64 Downloading tedge...OK Installing tedge...OK Downloading tedge-mapper...OK Installing tedge-mapper...FAILED Failed to install thin-edge.io Reason: Failed to install package 'tedge-mapper' Please create a ticket using the following link and include the console output https://github.com/thin-edge/thin-edge.io/issues/new?assignees=&amp;labels=bug&amp;template=bug_report.md --------------- machine details --------------------- date: Mon Jul 8 08:43:39 UTC 2024 [ Message content over the limit has been removed. ] [2m2024-07-08T08:43:39.645450326Z[0m [31mERROR[0m [2mflockfile::unix[0m[2m:[0m Lock file path: /run/lock/tedge-mapper-c8y.lock Error: Couldn't create file lock. Caused by: No such file or directory (os error 2) dpkg: error processing package tedge-mapper (--install): installed tedge-mapper package post-installation script subprocess returned error exit status 1 Errors were encountered while processing: tedge-mapper Failed to install thin-edge.io Reason: Failed to install package 'tedge-mapper' Please create a ticket using the following link and include the console output https://github.com/thin-edge/thin-edge.io/issues/new?assignees=&labels=bug&template=bug_report.md ------------------------------------------------------ stderr: 34.437 s Tedge Self Update
Successful shell command with output Parent suite setup failed: /setup/bootstrap.sh returned an unexpected exit code stdout: ---------------------------------------------------------- Initializing ---------------------------------------------------------- Detected version from positional argument. version= Using local dpkg install method as local .deb files were found in folder: . ---------------------------------------------------------- Installing thin-edge.io ---------------------------------------------------------- Installing thin-edge.io using local files (from path=.) (Reading database ... 9367 files and directories currently installed.) Preparing to unpack .../tedge_1.1.2175+gf76ba28_amd64.deb ... Unpacking tedge (1.1.2175+gf76ba28) over (1.1.2175+gf76ba28) ... Setting up tedge (1.1.2175+gf76ba28) ... No bridges to refresh. (Reading database ... 9367 files and directories currently installed.) Preparing to unpack .../tedge-mapper_1.1.2~175+gf76ba28_amd64.deb ... [ Message content over the limit has been removed. ] Failed to connect to bus: No such file or directory Failed to connect to bus: No such file or directory Failed to connect to bus: No such file or directory tedge-watchdog.service is a disabled or a static unit not running, not starting it. .+.+++++++++++++++++++++++++++++++++++++++.+..............+...+.+..............+...+...+....+..+.+..+++++++++++++++++++++++++++++++++++++++..........+...+.+.........+...+..+.+...........+................++++++ ..+....+++++++++++++++++++++++++++++++++++++++.+.....+.......+.....+......+...+++++++++++++++++++++++++++++++++++++++...........+...+................+.........+.....+.+...+......+......+......+..............+....+.........+...+.........+...+...........+......+......+.......+......+......+........+.......+.....+..........+...........+.......+........+...+....+...+.....+.............+......+...+.....+...+.......+...+........+......++++++ ----- Certificate request self-signature ok subject=C=US, ST=Denial, L=Springfield, O=Dis, CN=18cb44896442 Certificate request self-signature ok subject=C=US, ST=Denial, L=Springfield, O=Dis, CN=client1 Failed to connect to bus: No such file or directory 0.051 s Shell Operation Built-In Bridge
Check Successful shell command with literal double quotes output Parent suite setup failed: /setup/bootstrap.sh returned an unexpected exit code stdout: ---------------------------------------------------------- Initializing ---------------------------------------------------------- Detected version from positional argument. version= Using local dpkg install method as local .deb files were found in folder: . ---------------------------------------------------------- Installing thin-edge.io ---------------------------------------------------------- Installing thin-edge.io using local files (from path=.) (Reading database ... 9367 files and directories currently installed.) Preparing to unpack .../tedge_1.1.2175+gf76ba28_amd64.deb ... Unpacking tedge (1.1.2175+gf76ba28) over (1.1.2175+gf76ba28) ... Setting up tedge (1.1.2175+gf76ba28) ... No bridges to refresh. (Reading database ... 9367 files and directories currently installed.) Preparing to unpack .../tedge-mapper_1.1.2~175+gf76ba28_amd64.deb ... [ Message content over the limit has been removed. ] Failed to connect to bus: No such file or directory Failed to connect to bus: No such file or directory Failed to connect to bus: No such file or directory tedge-watchdog.service is a disabled or a static unit not running, not starting it. .+.+++++++++++++++++++++++++++++++++++++++.+..............+...+.+..............+...+...+....+..+.+..+++++++++++++++++++++++++++++++++++++++..........+...+.+.........+...+..+.+...........+................++++++ ..+....+++++++++++++++++++++++++++++++++++++++.+.....+.......+.....+......+...+++++++++++++++++++++++++++++++++++++++...........+...+................+.........+.....+.+...+......+......+......+..............+....+.........+...+.........+...+...........+......+......+.......+......+......+........+.......+.....+..........+...........+.......+........+...+....+...+.....+.............+......+...+.....+...+.......+...+........+......++++++ ----- Certificate request self-signature ok subject=C=US, ST=Denial, L=Springfield, O=Dis, CN=18cb44896442 Certificate request self-signature ok subject=C=US, ST=Denial, L=Springfield, O=Dis, CN=client1 Failed to connect to bus: No such file or directory 0.056 s Shell Operation Built-In Bridge
Execute multiline shell command Parent suite setup failed: /setup/bootstrap.sh returned an unexpected exit code stdout: ---------------------------------------------------------- Initializing ---------------------------------------------------------- Detected version from positional argument. version= Using local dpkg install method as local .deb files were found in folder: . ---------------------------------------------------------- Installing thin-edge.io ---------------------------------------------------------- Installing thin-edge.io using local files (from path=.) (Reading database ... 9367 files and directories currently installed.) Preparing to unpack .../tedge_1.1.2175+gf76ba28_amd64.deb ... Unpacking tedge (1.1.2175+gf76ba28) over (1.1.2175+gf76ba28) ... Setting up tedge (1.1.2175+gf76ba28) ... No bridges to refresh. (Reading database ... 9367 files and directories currently installed.) Preparing to unpack .../tedge-mapper_1.1.2~175+gf76ba28_amd64.deb ... [ Message content over the limit has been removed. ] Failed to connect to bus: No such file or directory Failed to connect to bus: No such file or directory Failed to connect to bus: No such file or directory tedge-watchdog.service is a disabled or a static unit not running, not starting it. .+.+++++++++++++++++++++++++++++++++++++++.+..............+...+.+..............+...+...+....+..+.+..+++++++++++++++++++++++++++++++++++++++..........+...+.+.........+...+..+.+...........+................++++++ ..+....+++++++++++++++++++++++++++++++++++++++.+.....+.......+.....+......+...+++++++++++++++++++++++++++++++++++++++...........+...+................+.........+.....+.+...+......+......+......+..............+....+.........+...+.........+...+...........+......+......+.......+......+......+........+.......+.....+..........+...........+.......+........+...+....+...+.....+.............+......+...+.....+...+.......+...+........+......++++++ ----- Certificate request self-signature ok subject=C=US, ST=Denial, L=Springfield, O=Dis, CN=18cb44896442 Certificate request self-signature ok subject=C=US, ST=Denial, L=Springfield, O=Dis, CN=client1 Failed to connect to bus: No such file or directory 0.058 s Shell Operation Built-In Bridge
Failed shell command Parent suite setup failed: /setup/bootstrap.sh returned an unexpected exit code stdout: ---------------------------------------------------------- Initializing ---------------------------------------------------------- Detected version from positional argument. version= Using local dpkg install method as local .deb files were found in folder: . ---------------------------------------------------------- Installing thin-edge.io ---------------------------------------------------------- Installing thin-edge.io using local files (from path=.) (Reading database ... 9367 files and directories currently installed.) Preparing to unpack .../tedge_1.1.2175+gf76ba28_amd64.deb ... Unpacking tedge (1.1.2175+gf76ba28) over (1.1.2175+gf76ba28) ... Setting up tedge (1.1.2175+gf76ba28) ... No bridges to refresh. (Reading database ... 9367 files and directories currently installed.) Preparing to unpack .../tedge-mapper_1.1.2~175+gf76ba28_amd64.deb ... [ Message content over the limit has been removed. ] Failed to connect to bus: No such file or directory Failed to connect to bus: No such file or directory Failed to connect to bus: No such file or directory tedge-watchdog.service is a disabled or a static unit not running, not starting it. .+.+++++++++++++++++++++++++++++++++++++++.+..............+...+.+..............+...+...+....+..+.+..+++++++++++++++++++++++++++++++++++++++..........+...+.+.........+...+..+.+...........+................++++++ ..+....+++++++++++++++++++++++++++++++++++++++.+.....+.......+.....+......+...+++++++++++++++++++++++++++++++++++++++...........+...+................+.........+.....+.+...+......+......+......+..............+....+.........+...+.........+...+...........+......+......+.......+......+......+........+.......+.....+..........+...........+.......+........+...+....+...+.....+.............+......+...+.....+...+.......+...+........+......++++++ ----- Certificate request self-signature ok subject=C=US, ST=Denial, L=Springfield, O=Dis, CN=18cb44896442 Certificate request self-signature ok subject=C=US, ST=Denial, L=Springfield, O=Dis, CN=client1 Failed to connect to bus: No such file or directory 0.056 s Shell Operation Built-In Bridge
Limit number of packages tedge connect c8y returned an unexpected exit code stdout: stderr: Error: failed to connect to Cumulocity cloud. Caused by: A value for 'c8y.url' is missing. A value can be set with tedge config set c8y.url &lt;value&gt; 34.402 s Sm-Plugin
Limit number of packages to 1 tedge connect c8y returned an unexpected exit code stdout: stderr: Error: failed to connect to Cumulocity cloud. Caused by: A value for 'c8y.url' is missing. A value can be set with tedge config set c8y.url &lt;value&gt; 34.401 s Sm-Plugin
Don't limit number of packages tedge connect c8y returned an unexpected exit code stdout: stderr: Error: failed to connect to Cumulocity cloud. Caused by: A value for 'c8y.url' is missing. A value can be set with tedge config set c8y.url &lt;value&gt; 33.961 s Sm-Plugin
sm-plugins should work without sudo installed and running as root tedge connect c8y returned an unexpected exit code stdout: stderr: Error: failed to connect to Cumulocity cloud. Caused by: A value for 'c8y.url' is missing. A value can be set with tedge config set c8y.url &lt;value&gt; 62.566 s Sm-Plugin
sm-plugins download files from Cumulocity tedge connect c8y returned an unexpected exit code stdout: stderr: Error: failed to connect to Cumulocity cloud. Caused by: A value for 'c8y.url' is missing. A value can be set with tedge config set c8y.url &lt;value&gt; 34.156 s Sm-Plugin
Filter packages list using include pattern tedge connect c8y returned an unexpected exit code stdout: stderr: Error: failed to connect to Cumulocity cloud. Caused by: A value for 'c8y.url' is missing. A value can be set with tedge config set c8y.url &lt;value&gt; 34.726 s Sm-Plugin
Filter packages list using exclude pattern tedge connect c8y returned an unexpected exit code stdout: stderr: Error: failed to connect to Cumulocity cloud. Caused by: A value for 'c8y.url' is missing. A value can be set with tedge config set c8y.url &lt;value&gt; 34.732 s Sm-Plugin
Filter packages list using both patterns tedge connect c8y returned an unexpected exit code stdout: stderr: Error: failed to connect to Cumulocity cloud. Caused by: A value for 'c8y.url' is missing. A value can be set with tedge config set c8y.url &lt;value&gt; 36.862 s Sm-Plugin
Operation log uploaded automatically with auto_log_upload setting as always Setup failed: /setup/bootstrap.sh returned an unexpected exit code stdout: ---------------------------------------------------------- Initializing ---------------------------------------------------------- Detected version from positional argument. version= Using local dpkg install method as local .deb files were found in folder: . ---------------------------------------------------------- Installing thin-edge.io ---------------------------------------------------------- Installing thin-edge.io using local files (from path=.) (Reading database ... 9367 files and directories currently installed.) Preparing to unpack .../tedge_1.1.2175+gf76ba28_amd64.deb ... Unpacking tedge (1.1.2175+gf76ba28) over (1.1.2175+gf76ba28) ... Setting up tedge (1.1.2175+gf76ba28) ... No bridges to refresh. (Reading database ... 9367 files and directories currently installed.) Preparing to unpack .../tedge-mapper_1.1.2~175+gf76ba28_amd64.deb ... [ Message content over the limit has been removed. ] tedge-watchdog.service is a disabled or a static unit not running, not starting it. ....+++++++++++++++++++++++++++++++++++++++.+..........+.....+...+....+...........+++++++++++++++++++++++++++++++++++++++.....+..........+...........+....+.........++++++ ...+++++++++++++++++++++++++++++++++++++++..+......+...............+...+........+...+....+..+.+...+.....+....+..+...+...+............+.+++++++++++++++++++++++++++++++++++++++......+...+...+.......+..+...+...+....+......+...+......+......+........+..........+..+..........+.....+...+.......+...+...........+...+...+............+...+....+...+...+..+.......+....................+...+.+.....+.......+..+................+.....+............+.............+............+.....+..........+....................+...+......+...+...+.......+...............+......+......+........+......+.+...+...........+.........+............+...+......+.+.....+.............+...+........++++++ ----- Certificate request self-signature ok subject=C=US, ST=Denial, L=Springfield, O=Dis, CN=e8f3cc896047 Certificate request self-signature ok subject=C=US, ST=Denial, L=Springfield, O=Dis, CN=client1 Failed to connect to bus: No such file or directory 31.020 s Software
Supported software types should be declared during startup Setup failed: tedge connect c8y returned an unexpected exit code stdout: stderr: Error: failed to connect to Cumulocity cloud. Caused by: A value for 'c8y.url' is missing. A value can be set with tedge config set c8y.url &lt;value&gt; Also teardown failed: Variable '${CHILD_SN}' not found. 34.095 s Software-Update-Child
Software list should be populated during startup Setup failed: tedge connect c8y returned an unexpected exit code stdout: stderr: Error: failed to connect to Cumulocity cloud. Caused by: A value for 'c8y.url' is missing. A value can be set with tedge config set c8y.url &lt;value&gt; Also teardown failed: Variable '${CHILD_SN}' not found. 33.570 s Software-Update-Child
Install software via Cumulocity Setup failed: tedge connect c8y returned an unexpected exit code stdout: stderr: Error: failed to connect to Cumulocity cloud. Caused by: A value for 'c8y.url' is missing. A value can be set with tedge config set c8y.url &lt;value&gt; Also teardown failed: Variable '${CHILD_SN}' not found. 34.161 s Software-Update-Child
Install specific version via script (from current branch) chmod a&#43;x /setup/get-thin-edge... returned an unexpected exit code stdout: ignore c8y-firmware-plugin and c8y-remote-access-plugin as they are not supported in <= 0.10.0 Thank you for trying thin-edge.io! Installing for architecture amd64 Downloading tedge...OK Installing tedge...OK Downloading tedge_mapper...OK Installing tedge_mapper...FAILED Failed to install thin-edge.io Reason: Failed to install package 'tedge_mapper' Please create a ticket using the following link and include the console output https://github.com/thin-edge/thin-edge.io/issues/new?assignees=&amp;labels=bug&amp;template=bug_report.md [ Message content over the limit has been removed. ] [2m2024-07-08T08:47:52.104206083Z[0m [31mERROR[0m [2mflockfile::unix[0m[2m:[0m Lock file path: /run/lock/tedge-mapper-c8y.lock Error: Couldn't acquire file lock. Caused by: No such file or directory (os error 2) dpkg: error processing package tedge_mapper (--install): installed tedge_mapper package post-installation script subprocess returned error exit status 1 Errors were encountered while processing: tedge_mapper Failed to install thin-edge.io Reason: Failed to install package 'tedge_mapper' Please create a ticket using the following link and include the console output https://github.com/thin-edge/thin-edge.io/issues/new?assignees=&labels=bug&template=bug_report.md ------------------------------------------------------ stderr: 34.497 s Install Tedge
Publish events to subscribed topic Parent suite setup failed: /setup/bootstrap.sh returned an unexpected exit code stdout: ---------------------------------------------------------- Initializing ---------------------------------------------------------- Detected version from positional argument. version= Using local dpkg install method as local .deb files were found in folder: . ---------------------------------------------------------- Installing thin-edge.io ---------------------------------------------------------- Installing thin-edge.io using local files (from path=.) (Reading database ... 9367 files and directories currently installed.) Preparing to unpack .../tedge_1.1.2175+gf76ba28_amd64.deb ... Unpacking tedge (1.1.2175+gf76ba28) over (1.1.2175+gf76ba28) ... Setting up tedge (1.1.2175+gf76ba28) ... No bridges to refresh. (Reading database ... 9367 files and directories currently installed.) Preparing to unpack .../tedge-mapper_1.1.2~175+gf76ba28_amd64.deb ... [ Message content over the limit has been removed. ] tedge-watchdog.service is a disabled or a static unit not running, not starting it. .........+.....+.............+...+..+...+++++++++++++++++++++++++++++++++++++++.+.......+.........+.....+............+............+.+......+..............+....+......+.....+.+......+..+...+....+..............+.+++++++++++++++++++++++++++++++++++++++................+......+.+...+..+.+.....+...+................+...+..+...+.......+..............+....+...+..+.+.....+.+......+........+.+...+...............+..+......+...+....+...+.....+.............+.....+....+...+...+...........+.+..............+......+...............+.........++++++ .....+...+....+++++++++++++++++++++++++++++++++++++++.......+..+.+.........+...+..+......+.+........+...+....+...+..+.+.....+...+.+....................+.+...+...........+.............+.....+.+..+....+.....+.....................+....+...+++++++++++++++++++++++++++++++++++++++......+..+......+....+..............+.......+..+......................+........+............++++++ ----- Certificate request self-signature ok subject=C=US, ST=Denial, L=Springfield, O=Dis, CN=f7b153eda39f Certificate request self-signature ok subject=C=US, ST=Denial, L=Springfield, O=Dis, CN=client1 Failed to connect to bus: No such file or directory 0.045 s Custom Sub Topics Tedge-Mapper-Aws
Publish measurements to unsubscribed topic Parent suite setup failed: /setup/bootstrap.sh returned an unexpected exit code stdout: ---------------------------------------------------------- Initializing ---------------------------------------------------------- Detected version from positional argument. version= Using local dpkg install method as local .deb files were found in folder: . ---------------------------------------------------------- Installing thin-edge.io ---------------------------------------------------------- Installing thin-edge.io using local files (from path=.) (Reading database ... 9367 files and directories currently installed.) Preparing to unpack .../tedge_1.1.2175+gf76ba28_amd64.deb ... Unpacking tedge (1.1.2175+gf76ba28) over (1.1.2175+gf76ba28) ... Setting up tedge (1.1.2175+gf76ba28) ... No bridges to refresh. (Reading database ... 9367 files and directories currently installed.) Preparing to unpack .../tedge-mapper_1.1.2~175+gf76ba28_amd64.deb ... [ Message content over the limit has been removed. ] tedge-watchdog.service is a disabled or a static unit not running, not starting it. .........+.....+.............+...+..+...+++++++++++++++++++++++++++++++++++++++.+.......+.........+.....+............+............+.+......+..............+....+......+.....+.+......+..+...+....+..............+.+++++++++++++++++++++++++++++++++++++++................+......+.+...+..+.+.....+...+................+...+..+...+.......+..............+....+...+..+.+.....+.+......+........+.+...+...............+..+......+...+....+...+.....+.............+.....+....+...+...+...........+.+..............+......+...............+.........++++++ .....+...+....+++++++++++++++++++++++++++++++++++++++.......+..+.+.........+...+..+......+.+........+...+....+...+..+.+.....+...+.+....................+.+...+...........+.............+.....+.+..+....+.....+.....................+....+...+++++++++++++++++++++++++++++++++++++++......+..+......+....+..............+.......+..+......................+........+............++++++ ----- Certificate request self-signature ok subject=C=US, ST=Denial, L=Springfield, O=Dis, CN=f7b153eda39f Certificate request self-signature ok subject=C=US, ST=Denial, L=Springfield, O=Dis, CN=client1 Failed to connect to bus: No such file or directory 0.077 s Custom Sub Topics Tedge-Mapper-Aws
Check offline bootstrapping Parent suite setup failed: /setup/bootstrap.sh returned an unexpected exit code stdout: ---------------------------------------------------------- Initializing ---------------------------------------------------------- Detected version from positional argument. version= Using local dpkg install method as local .deb files were found in folder: . ---------------------------------------------------------- Installing thin-edge.io ---------------------------------------------------------- Installing thin-edge.io using local files (from path=.) (Reading database ... 9367 files and directories currently installed.) Preparing to unpack .../tedge_1.1.2175+gf76ba28_amd64.deb ... Unpacking tedge (1.1.2175+gf76ba28) over (1.1.2175+gf76ba28) ... Setting up tedge (1.1.2175+gf76ba28) ... No bridges to refresh. (Reading database ... 9367 files and directories currently installed.) Preparing to unpack .../tedge-mapper_1.1.2~175+gf76ba28_amd64.deb ... [ Message content over the limit has been removed. ] Failed to connect to bus: No such file or directory Failed to connect to bus: No such file or directory tedge-watchdog.service is a disabled or a static unit not running, not starting it. ........+++++++++++++++++++++++++++++++++++++++....+.........+......+....+...+.....+.......+++++++++++++++++++++++++++++++++++++++..+......+.......+......+.....+.+......+..+.+.................+.......+..+.........+.......+...+...........+...+...+....+.....+...+.......+...+...+..++++++ ......+...+.......+............+++++++++++++++++++++++++++++++++++++++.+.......+...+............+..+...............+....+......+.....+..........+......+...+..+.........+++++++++++++++++++++++++++++++++++++++..........+.......+...............+.....+..................+...+.+...+.....+...+...+......+.+...+.....+..........+............+..+..........+......+...........+....+..+....+........++++++ ----- Certificate request self-signature ok subject=C=US, ST=Denial, L=Springfield, O=Dis, CN=1e475a017bf0 Certificate request self-signature ok subject=C=US, ST=Denial, L=Springfield, O=Dis, CN=client1 Failed to connect to bus: No such file or directory 0.115 s Tedge Connect Offline

@rina23q rina23q had a problem deploying to Test Pull Request June 19, 2024 14:51 — with GitHub Actions Failure
@rina23q rina23q force-pushed the feature/2862/support-c8y-device-availability-version-2 branch from c68e00a to ac55af8 Compare June 19, 2024 16:41
@rina23q rina23q temporarily deployed to Test Pull Request June 19, 2024 16:41 — with GitHub Actions Inactive
@rina23q rina23q temporarily deployed to Test Pull Request June 19, 2024 17:12 — with GitHub Actions Inactive
rina23q and others added 18 commits July 4, 2024 11:57
Add is_default_service() to EntityTopicId
Add health endpoint /status/health to ChannelFilter

Signed-off-by: Rina Fujino <rina.fujino.23@gmail.com>
…nfig

Signed-off-by: Rina Fujino <rina.fujino.23@gmail.com>
If c8y.availability.enable is set to true, tedge-mapper-c8y publishes
a SmartREST '117' message to set c8y_RequiredAvailability fragment for
both main and child devices.

If c8y.availability.enable is set to true AND c8y.availability.period is
set to value > 0, tedge-mapper-c8y sends an empty inventory update
message periodically.

For the main device, the heartbeat timer starts during initialization.
When the timer fires, the health status of tedge-agent is checked. If
it is up, the heartbeat message will be sent.

For child devices, the heartbeat timer starts when the entity is
registered to the entity store. By default, like the main device case,
the heartbeat message will be sent when tedge-agent for the child device
is up. However, if `at_health` (EntityTopicId) is set to its metadata,
tedge-mapper-c8y looks up the status of the leadService.

Signed-off-by: Rina Fujino <rina.fujino.23@gmail.com>
Signed-off-by: Rina Fujino <rina.fujino.23@gmail.com>
Signed-off-by: Rina Fujino <rina.fujino.23@gmail.com>
Signed-off-by: Reuben Miller <reuben.d.miller@gmail.com>
Signed-off-by: Rina Fujino <rina.fujino.23@gmail.com>
* Move all 117 related struct to c8y_api crate
* `at_health` accepts any valid EntityTopicId
* Heartbeat signal is sent in the half time of the interval from c8y.availability.interval
(e.g. congig = 60m, heartbeat interval = 30m)

Signed-off-by: Rina Fujino <rina.fujino.23@gmail.com>

Signed-off-by: Rina Fujino <rina.fujino.23@gmail.com>
…d Have Fragment Values`

Signed-off-by: Reuben Miller <reuben.d.miller@gmail.com>
Signed-off-by: Reuben Miller <reuben.d.miller@gmail.com>
Signed-off-by: Reuben Miller <reuben.d.miller@gmail.com>
* Improve logging messages and avoid multiple timer creation
* Fix tedge-mapper-c8y shutdown issue when availability feature is disabled

Signed-off-by: Rina Fujino <rina.fujino.23@gmail.com>
…tion disabled

Signed-off-by: Rina Fujino <rina.fujino.23@gmail.com>
Signed-off-by: Didier Wenzek <didier.wenzek@free.fr>
Signed-off-by: Rina Fujino <rina.fujino.23@gmail.com>
@rina23q rina23q force-pushed the feature/2862/support-c8y-device-availability-version-2 branch from 3b6ead8 to d55b5a2 Compare July 4, 2024 12:31
@rina23q rina23q temporarily deployed to Test Pull Request July 4, 2024 12:31 — with GitHub Actions Inactive
@rina23q rina23q added this pull request to the merge queue Jul 4, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Jul 4, 2024
@rina23q rina23q added this pull request to the merge queue Jul 4, 2024
Merged via the queue into thin-edge:main with commit 9f1e2df Jul 4, 2024
@rina23q rina23q deleted the feature/2862/support-c8y-device-availability-version-2 branch July 18, 2024 14:00
@reubenmiller reubenmiller changed the title feat: support c8y device availability by AvailabilityActor feat: support c8y device availability feature Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme:c8y Theme: Cumulocity related topics theme:monitoring Theme: Service monitoring and watchdogs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants