eclipse-hawkbit / hawkbit

Eclipse hawkBit™
https://projects.eclipse.org/projects/iot.hawkbit
Eclipse Public License 2.0
468 stars 189 forks source link

AssignDS Error #2026

Open FabioPetry18 opened 4 days ago

FabioPetry18 commented 4 days ago

I'm trying to use the /rest/v1/targets/{controllerID}/assignedDS endpoint, but it doesn't respect the scheduled update time, or it returns skip or updates immediately, am I doing something wrong?

body:

[ { "id": "2", "confirmationRequired": false, "type": "soft", "maintenanceWindow": { "schedule": "0 50 18 13 11 ? 2024", "duration": "23:59:00", "timezone": "+03:00" } } ]

avgustinmm commented 4 days ago

Hi @FabioPetry18 , what do you mean by "skip or update immediately"? AFAIK, the maintenance window is just an instruction to the controller when to perform the software update. However, hawkBit will return the update on every poll.

Edu4rdo00 commented 3 days ago

maintenanceWindow Always Returning as "unavailable" in Hawkbit + SWUpdate**

I'm experiencing issues when configuring the maintenanceWindow between Hawkbit 0.6.1 and SWUpdate 2023.05. No matter how I configure the maintenance window, it consistently returns as "unavailable" in the SWUpdate logs.

Here is an example of the request I'm using to set the maintenance window:

curl -v --location 'http://127.0.0.1/rest/v1/targets/SO-0027-362541571a04/assignedDS' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
--data '[
    {
        "id": "2",
        "confirmationRequired": false,
        "type": "soft",
        "maintenanceWindow": {
            "schedule": "0 30 10 14 11 ? 2024",
            "duration": "23:59:00",
            "timezone": "-03:00"
        }
    }
]'

Despite configuring the cron correctly and verifying the synchronization of clocks between Hawkbit and the devices, the logs from SWUpdate consistently show:

[TRACE] : SWUPDATE running : [parse_reply] : Got channel reply: {"id":"1","deployment":{"download":"attempt","update":"skip","maintenanceWindow":"unavailable","chunks":[...]}}

The Hawkbit server is correctly providing updates during each poll, but the SWUpdate client always receives the maintenanceWindow status as "unavailable," which results in updates being skipped.

Actions Taken So Far

Questions

  1. Is there any specific configuration required on SWUpdate to ensure it respects the maintenance window (maintenanceWindow)?
  2. Have there been any fixes related to this issue in SWUpdate versions released after 2023.05?
  3. Hawkbit is providing updates on each polling, but I would like to ensure that devices only apply updates during the specified maintenance window. Is there a way to configure Hawkbit to enforce that updates are only sent during that maintenance window?
  4. Could this issue be related to the cron expression or the interpretation of the cron format by SWUpdate? If yes, is there a recommended format that should be used?

Environment:

Any help or insight into resolving this issue would be greatly appreciated.