Cannot initialize sha1 checksum context

94 views
Skip to first unread message

Zain

unread,
Dec 9, 2021, 5:48:26 AM12/9/21
to swupdate
There are two erros coming and I cannot figure out why, I am using swu without any signing or encryption 

Cannot initialize sha1 checksum context

No suitable .swu image found

Above are the errors, this same image is working on web and manual update.

Is the swu file for the surricate different or something?

Mirza Kapetanovic

unread,
Sep 7, 2022, 7:18:25 PM9/7/22
to swupdate
Hi. We're having a similar problem. A published update on hawkbit never gets installed and we see the same log entries. The .swu works with the built-in web portal. Looking at the source code it might be a openssl issue but I'm not sure.

Did you ever find a solution for it?

Here are the complete logs:

Sep  7 21:56:00 my-rpi user.debug swupdate: RUN [start_suricatta] : Suricatta awakened.
Sep  7 21:56:00 my-rpi user.debug swupdate: RUN [server_get_device_info] : Getting information for device 'rpi-c3cef9f345e7d933cb3d4ef8ea0a2409'
Sep  7 21:56:00 my-rpi user.debug swupdate: RUN [channel_set_options] : cURL's low download speed timeout is disabled, this is most probably not what you want. Adapted it to 300s instead.
Sep  7 21:56:00 my-rpi user.debug swupdate: RUN [channel_get] : Trying to GET https://my-domain/default/controller/v1/rpi-c3cef9f345e7d933cb3d4ef8ea0a2409
Sep  7 21:56:01 my-rpi user.debug swupdate: RUN [channel_log_effective_url] : Channel's effective URL resolved to https://my-domain/default/controller/v1/rpi-c3cef9f345e7d933cb3d4ef8ea0a2409
Sep  7 21:56:01 my-rpi user.debug swupdate: RUN [channel_log_reply] : Channel operation returned HTTP status code 200.
Sep  7 21:56:01 my-rpi user.debug swupdate: RUN [parse_reply] : Got channel reply: {"config":{"polling":{"sleep":"00:05:00"}},"_links":{"deploymentBase":{"href":"https://my-domain/default/controller/v1/rpi-c3cef9f345e7d933cb3d4ef8ea0a2
Sep  7 21:56:01 my-rpi user.debug swupdate: RUN [server_set_polling_interval_json] : Set polling interval to 300s as announced by server.
Sep  7 21:56:01 my-rpi user.debug swupdate: RUN [server_set_config_data] : ConfigData: https://my-domain/default/controller/v1/rpi-c3cef9f345e7d933cb3d4ef8ea0a2409/configData
Sep  7 21:56:01 my-rpi user.debug swupdate: RUN [server_get_deployment_info] : Update action available at https://my-domain/default/controller/v1/rpi-c3cef9f345e7d933cb3d4ef8ea0a2409/deploymentBase/7?c=417141005
Sep  7 21:56:01 my-rpi user.debug swupdate: RUN [channel_set_options] : cURL's low download speed timeout is disabled, this is most probably not what you want. Adapted it to 300s instead.
Sep  7 21:56:01 my-rpi user.debug swupdate: RUN [channel_get] : Trying to GET https://my-domain/default/controller/v1/rpi-c3cef9f345e7d933cb3d4ef8ea0a2409/deploymentBase/7?c=417141005
Sep  7 21:56:01 my-rpi user.debug swupdate: RUN [channel_log_effective_url] : Channel's effective URL resolved to https://my-domain/default/controller/v1/rpi-c3cef9f345e7d933cb3d4ef8ea0a2409/deploymentBase/7?c=417141005
Sep  7 21:56:01 my-rpi user.debug swupdate: RUN [channel_log_reply] : Channel operation returned HTTP status code 200.
Sep  7 21:56:01 my-rpi user.debug swupdate: RUN [parse_reply] : Got channel reply: {"id":"7","deployment":{"download":"forced","update":"forced","chunks":[{"part":"os","version":"0.0.2","name":"rpi-0.0.2","artifacts":[{"filename":"rpi.swu","hashes":{"sha1":"9193d37dcf7
Sep  7 21:56:01 my-rpi user.debug swupdate: RUN [server_get_deployment_info] : Associated Action ID for Update Action is 7
Sep  7 21:56:01 my-rpi user.info swupdate: RUN [read_state] : Key 'none' not found in Bootloader's environment.
Sep  7 21:56:01 my-rpi user.err swupdate: FAILURE ERROR core/state.c : do_get_state : 84 : Cannot read stored update state.
Sep  7 21:56:01 my-rpi user.debug swupdate: RUN [start_suricatta] : About to process available update.
Sep  7 21:56:01 my-rpi user.debug swupdate: RUN [server_get_device_info] : Getting information for device 'rpi-c3cef9f345e7d933cb3d4ef8ea0a2409'
Sep  7 21:56:01 my-rpi user.debug swupdate: RUN [channel_set_options] : cURL's low download speed timeout is disabled, this is most probably not what you want. Adapted it to 300s instead.
Sep  7 21:56:01 my-rpi user.debug swupdate: RUN [channel_get] : Trying to GET https://my-domain/default/controller/v1/rpi-c3cef9f345e7d933cb3d4ef8ea0a2409
Sep  7 21:56:01 my-rpi user.debug swupdate: RUN [channel_log_effective_url] : Channel's effective URL resolved to https://my-domain/default/controller/v1/rpi-c3cef9f345e7d933cb3d4ef8ea0a2409
Sep  7 21:56:01 my-rpi user.debug swupdate: RUN [channel_log_reply] : Channel operation returned HTTP status code 200.
Sep  7 21:56:01 my-rpi user.debug swupdate: RUN [parse_reply] : Got channel reply: {"config":{"polling":{"sleep":"00:05:00"}},"_links":{"deploymentBase":{"href":"https://my-domain/default/controller/v1/rpi-c3cef9f345e7d933cb3d4ef8ea0a2
Sep  7 21:56:01 my-rpi user.debug swupdate: RUN [server_set_polling_interval_json] : Set polling interval to 300s as announced by server.
Sep  7 21:56:01 my-rpi user.debug swupdate: RUN [server_set_config_data] : ConfigData: https://my-domain/default/controller/v1/rpi-c3cef9f345e7d933cb3d4ef8ea0a2409/configData
Sep  7 21:56:01 my-rpi user.debug swupdate: RUN [server_get_deployment_info] : Update action available at https://my-domain/default/controller/v1/rpi-c3cef9f345e7d933cb3d4ef8ea0a2409/deploymentBase/7?c=417170796
Sep  7 21:56:01 my-rpi user.debug swupdate: RUN [channel_set_options] : cURL's low download speed timeout is disabled, this is most probably not what you want. Adapted it to 300s instead.
Sep  7 21:56:01 my-rpi user.debug swupdate: RUN [channel_get] : Trying to GET https://my-domain/default/controller/v1/rpi-c3cef9f345e7d933cb3d4ef8ea0a2409/deploymentBase/7?c=417170796
Sep  7 21:56:02 my-rpi user.debug swupdate: RUN [channel_log_effective_url] : Channel's effective URL resolved to https://my-domain/default/controller/v1/rpi-c3cef9f345e7d933cb3d4ef8ea0a2409/deploymentBase/7?c=417170796
Sep  7 21:56:02 my-rpi user.debug swupdate: RUN [channel_log_reply] : Channel operation returned HTTP status code 200.
Sep  7 21:56:02 my-rpi user.debug swupdate: RUN [parse_reply] : Got channel reply: {"id":"7","deployment":{"download":"forced","update":"forced","chunks":[{"part":"os","version":"0.0.2","name":"rpi-0.0.2","artifacts":[{"filename":"rpi.swu","hashes":{"sha1":"9193d37dcf7
Sep  7 21:56:02 my-rpi user.debug swupdate: RUN [server_get_deployment_info] : Associated Action ID for Update Action is 7
Sep  7 21:56:02 my-rpi user.info swupdate: RUN [check_action_changed] : Update classified as 'forced' by server.
Sep  7 21:56:02 my-rpi user.debug swupdate: RUN [server_install_update] : Iterating over JSON, key={ "part": "os", "version": "0.0.2", "name": "rpi-0.0.2", "artifacts": [ { "filename": "rpi.swu", "hashes": { "sha1": "9193d37dcf7b27a1b14d2c03869c5e178caafe19", "md5": "0
Sep  7 21:56:02 my-rpi user.debug swupdate: RUN [server_install_update] : Processing Update Chunk 'rpi-0.0.2', version 0.0.2, part os
Sep  7 21:56:02 my-rpi user.debug swupdate: RUN [channel_set_options] : cURL's low download speed timeout is disabled, this is most probably not what you want. Adapted it to 300s instead.
Sep  7 21:56:02 my-rpi user.debug swupdate: RUN [channel_post_method] : POSTed/PATCHed to https://my-domain/default/controller/v1/rpi-c3cef9f345e7d933cb3d4ef8ea0a2409/deploymentBase/7/feedback: { "id": 7, "time": "20220907T215602", "st
Sep  7 21:56:02 my-rpi user.debug swupdate: RUN [channel_log_effective_url] : Channel's effective URL resolved to https://my-domain/default/controller/v1/rpi-c3cef9f345e7d933cb3d4ef8ea0a2409/deploymentBase/7/feedback
Sep  7 21:56:02 my-rpi user.debug swupdate: RUN [channel_log_reply] : Channel operation returned HTTP status code 200.
Sep  7 21:56:02 my-rpi user.debug swupdate: RUN [parse_reply] : Got channel reply:
Sep  7 21:56:02 my-rpi user.debug swupdate: RUN [server_process_update_artifact] : Iterating over JSON, key={ "filename": "rpi.swu", "hashes": { "sha1": "9193d37dcf7b27a1b14d2c03869c5e178caafe19", "md5": "03df1906ca82fb9c2b79362a4a053c2f", "sha256": "bfc9767f1da945f51a
Sep  7 21:56:02 my-rpi user.debug swupdate: RUN [server_process_update_artifact] : Processing 'rpi.swu' from 'http://my-domain:8080/DEFAULT/controller/v1/rpi-c3cef9f345e7d933cb3d4ef8ea0a2409/softwaremodules/2/artifacts/rpi.swu'
Sep  7 21:56:02 my-rpi user.err swupdate: FAILURE ERROR corelib/channel_curl.c : channel_get_file : 1076 : Cannot initialize sha1 checksum context.
Sep  7 21:56:02 my-rpi user.debug swupdate: RUN [process_notification_thread] : Update log to server from thread
Sep  7 21:56:02 my-rpi user.debug swupdate: RUN [channel_set_options] : cURL's low download speed timeout is disabled, this is most probably not what you want. Adapted it to 300s instead.
Sep  7 21:56:02 my-rpi user.debug swupdate: RUN [channel_post_method] : POSTed/PATCHed to https://my-domain/default/controller/v1/rpi-c3cef9f345e7d933cb3d4ef8ea0a2409/deploymentBase/7/feedback: { "id": 7, "time": "20220907T215602", "st
Sep  7 21:56:02 my-rpi user.debug swupdate: RUN [channel_log_effective_url] : Channel's effective URL resolved to https://my-domain/default/controller/v1/rpi-c3cef9f345e7d933cb3d4ef8ea0a2409/deploymentBase/7/feedback
Sep  7 21:56:02 my-rpi user.debug swupdate: RUN [channel_log_reply] : Channel operation returned HTTP status code 200.
Sep  7 21:56:02 my-rpi user.debug swupdate: RUN [parse_reply] : Got channel reply:
Sep  7 21:56:02 my-rpi user.err swupdate: FAILURE ERROR suricatta/server_hawkbit.c : server_hawkbit_error : 187 : No suitable .swu image found
Sep  7 21:56:02 my-rpi user.err swupdate: FAILURE ERROR suricatta/server_hawkbit.c : server_install_update : 1392 : Error processing update chunk named 'rpi-0.0.2', version 0.0.2, part os
Sep  7 21:56:02 my-rpi user.debug swupdate: RUN [channel_set_options] : cURL's low download speed timeout is disabled, this is most probably not what you want. Adapted it to 300s instead.
Sep  7 21:56:02 my-rpi user.debug swupdate: RUN [channel_post_method] : POSTed/PATCHed to https://my-domain/default/controller/v1/rpi-c3cef9f345e7d933cb3d4ef8ea0a2409/deploymentBase/7/feedback: { "id": 7, "time": "20220907T215602", "st
Sep  7 21:56:03 my-rpi user.debug swupdate: RUN [channel_log_effective_url] : Channel's effective URL resolved to https://my-domain/default/controller/v1/rpi-c3cef9f345e7d933cb3d4ef8ea0a2409/deploymentBase/7/feedback
Sep  7 21:56:03 my-rpi user.debug swupdate: RUN [channel_log_reply] : Channel operation returned HTTP status code 200.
Sep  7 21:56:03 my-rpi user.debug swupdate: RUN [parse_reply] : Got channel reply:
Sep  7 21:56:03 my-rpi user.debug swupdate: RUN [suricatta_wait] : Sleeping for 300 seconds.

Mirza Kapetanovic

unread,
Sep 15, 2022, 6:51:26 AM9/15/22
to swupdate
I managed to fix the issue, I was missing CONFIG_HASH_VERIFY=y in my swupdate config file so swupdate got built without the proper hash functions.
I'm using buildroot to create an image with swupdate, a couple of months ago I updated buildroot which propbably also bumped the swupdate version but I kept the old defconfig file for swupdate where the variable wasn't set and it seems something changed in swupdate.
Reply all
Reply to author
Forward
0 new messages