1

I want to set up hawkBit (running on server) and swupdate (running on multiple clients - Linux OS) to perform OS/Software update in Suricatta mode.

1/ Follow up my post on hawkBit community, I've succeeded to run hawkBit in my server as below:

  • Exported to external link: http://:
  • Enabled MariaDB
  • Enabled Gateway Token Authentication (in hawkBit system configuration)
  • Created a software module
  • Uploaded an artifact
  • Created a distribution set
  • Assigned the software module to the distribution set
  • Create Targets (in Deployment Mangement UI) with Targets ID is "dev01"
  • Created a Rollout
  • Created a Target Filter

2/ I've succeeded to build/execute swupdate as SWupdate guideline

  • Enabled Suricatta daemon mode
  • Run swupdate: /usr/bin/swupdate -v -k /etc/public.pem -u '-t DEFAULT -u http://<domain>:<port> -i dev01'
  • I'm pretty sure this command isn't correct, output log as below:
*   Trying <ip address>...
* TCP_NODELAY set
* Connected to <domain> (<ip address>) port <port> (#0)
> GET /DEFAULT/controller/v1/10 HTTP/1.1
Host: <domain>:<port>
User-Agent: libcurl-agent/1.0
Content-Type: application/json
Accept: application/json
charsets: utf-8

< HTTP/1.1 401 Unauthorized
< Date: Sun, 16 May 2021 02:43:40 GMT
< X-Content-Type-Options: nosniff
< X-XSS-Protection: 1; mode=block
< Cache-Control: no-cache, no-store, max-age=0, must-revalidate
< Pragma: no-cache
< Expires: 0
< X-Frame-Options: DENY
< Content-Length: 0
< 
* Connection #0 to host <domain> left intact
[TRACE] : SWUPDATE running :  [channel_log_effective_url] : Channel's effective URL resolved to http://<domain>:<port>/DEFAULT/controller/v1/dev01
[ERROR] : SWUPDATE failed [0] ERROR corelib/channel_curl.c : channel_get : 1109 : Channel operation returned HTTP error code 401.
[DEBUG] : SWUPDATE running :  [suricatta_wait] : Sleeping for 45 seconds.
  • As per a suggestion from @laverman on Gitter:
You can use Gateway token in the Auth header of the request, e.g. “Authorization : GatewayToken a56cacb7290a8d8a96a2f149ab2f23d1”

but I don't know how the client sends this request (it should be sent by swupdate, right?)

3/ Follow up these instructions from Tutorial @ EclipseCon Europe 2019, it guides me to send the request to provision multiple clients from hawkBit Device Simulator. And the problem is how to apply this to real devices.

Another confusion is: when creating new Software Module, Distribution on hawkBit UI, I can't find the ID of these, but creating by send request as Tutorial, I can see the IDs in the response.

So my questions are:

1/ Are my hawkBit setup steps correct?

2/ How can I configure/run swupdate (on clients) to perform the update: poll for new software, download, update, report status, ...

If my description isn't clear enough, please tell me.

Thanks

Huong
  • 21
  • 4

1 Answers1

0

happy to see that you're trying out Hawkbit for your solution!

I have a few remarks:

  • The suricatta parameter for GatewayToken is -g, and -k for TargetToken respectively.
  • The -g <GATEWAY_TOKEN> needs to be set inside of the quotation marks see SwUpdate Documentation Example: /usr/bin/swupdate -v -u '-t DEFAULT -u http://<domain>:<port> -i dev01 -g 76430e1830c56f2ea656c9bbc88834a3'
  • For the GatewayToken Authentication, you need to provide the generated token in System Config view, it is a generated hashcode that looks similar to this example here
  • You can also authenticate each device/client separately using their own TargetToken. You can find more information in the Hawkbit documentation
Dharman
  • 30,962
  • 25
  • 85
  • 135
Ahmed Sayed
  • 1,429
  • 12
  • 12
  • Hi, After applying -g option, it's successful to update the device, but does have a problem. The update status isn't reflected on the hawkBit UI. Please advise. Here is the relavent log: ` [TRACE] : SWUPDATE running : [execute_shell_script] : Calling shell script /tmp/scripts/update.sh postinst : return with 0 [INFO ] : SWUPDATE successful ! SWUPDATE successful ! [TRACE] : SWUPDATE running : [network_initializer] : Main thread sleep again ! [INFO ] : No SWUPDATE running : Waiting for requests... ` Sorry, I have to post in multiple comments. – Huong May 23 '21 at 10:40
  • ` [TRACE] : SWUPDATE running : [channel_post_method] : Channel put operation returned HTTP status code 200. [TRACE] : SWUPDATE running : [server_create_details] : Detail 0 All Chunks Installed. [TRACE] : SWUPDATE running : [server_create_details] : Final details: "All Chunks Installed." [TRACE] : SWUPDATE running : [server_send_deployment_reply] : Reporting Installation progress for ID 3: none / proceeding / "All Chunks Installed." ` – Huong May 23 '21 at 10:43
  • ` [TRACE] : SWUPDATE running : [channel_post_method] : Channel put operation returned HTTP status code 200. [INFO ] : SWUPDATE running : [server_install_update] : Update successful, executing post-update actions. [DEBUG] : SWUPDATE running : [server_install_update] : Post-update actions successfully executed. [DEBUG] : SWUPDATE running : [suricatta_wait] : Sleeping for 300 seconds. ` – Huong May 23 '21 at 10:43
  • ` [WARN ] : SWUPDATE running : [server_has_pending_action] : An already installed update is pending testing, ignoring available update action. [INFO ] : SWUPDATE running : [server_has_pending_action] : Please restart SWUpdate to report the test results upstream. [DEBUG] : SWUPDATE running : [start_suricatta] : No pending action to process. [DEBUG] : SWUPDATE running : [suricatta_wait] : Sleeping for 300 seconds. ` Re-run swupdate, the updating is re-run automatically and the above progress is repeated. Distribution Set is assigned as "Forced" to Targets in the hawkBit UI. – Huong May 23 '21 at 10:44
  • I have a couple of questions: - How is the agent (swupdate) connected to hawkbit? via DMF/DDI? - What's the state in the UI? do you see any action status messages? or is the action stuck in status Pending? – Ahmed Sayed May 25 '21 at 11:10
  • 1/ swupdate run: `/usr/bin/swupdate -v -k /etc/public.pem -u '-t DEFAULT -u http://: -i dev01 -g '`. As per hawkBit doc, swupdate connects to hawkBit via DDI. 2/ Action stuck in status Pending. 3/ In hawkBit log, there are 2 error: `ERROR 30166 --- [executor-pool-2] o.s.s.s.TaskUtils$LoggingErrorHandler : Unexpected error occurred in scheduled task` and `ERROR 30166 --- [ntContainer#0-1] o.s.a.r.l.SimpleMessageListenerContainer : Failed to check/redeclare auto-delete queue(s).` – Huong May 27 '21 at 13:30
  • could you please rerun the hawkbit server with `logging.level.org.eclipse.hawkbit=DEBUG` environment variable and rerun the update? It would be great if you can upload the logs somewhere so I can take a closer look – Ahmed Sayed May 28 '21 at 09:27
  • Please find the hawkBit and swupdate logs in my drive, and please let me know if you can't access these: https://drive.google.com/drive/folders/1SIWrRoRvaf283Z-B9w8jsEMMWV6VNjV-?usp=sharing – Huong May 28 '21 at 14:56
  • And please confirm the command to run hawkBit is correct: `java -jar ./hawkbit-runtime/hawkbit-update-server/target/hawkbit-update-server-0.3.0-SNAPSHOT.jar --spring.profiles.active=mysql logging.level.org.eclipse.hawkbit=DEBUG | tee hawkbit.log` – Huong May 28 '21 at 15:56
  • Sorry I'm very busy lately, I still didn't get a chance to look at the logs. The command is mostly correct, only missing `--` before `logging.level.org.eclipse.hawkbit=DEBUG`. – Ahmed Sayed Jun 01 '21 at 12:23
  • That's OK, @Ahmed. I see that you're a very kind member. I've uploaded the logs with `--logging.level.org.eclipse.hawkbit=DEBUG` on the same link. Please help to check if you have free time. Thank you! – Huong Jun 01 '21 at 15:48
  • I found that option when running swupdate: `-c, --confirm Confirm update status to server: 1=AGAIN, 2=SUCCESS, 3=FAILED`. It looks like corresponding to the log: `Please restart SWUpdate to report the test results upstream.` – Huong Jun 02 '21 at 13:30
  • After updating done (log "Please restart SWUpdate to report the test results upstream." shown), manually terminate and re-run swupdate with "-c 2", it's successful to send the status to hawkBit. Now on hawkBit UI, I can see the status is "Status In Sync". But if I reboot the device, swupdate will not be run with "-c 2", then the status is not sent to hawkBit, in hawkBit UI, status will be "Status Pending" – Huong Jun 02 '21 at 15:29
  • @Huong, I have a similar situation. How did you manage to send status to hawkbit after reboot automatically. I can send status with "-c 2" manually – Preeti Jan 18 '23 at 21:30