ERROR mongoose/mongoose_interface.c : upload_handler : 620 : Writing to IPC fails due to Broken pipe

126 views
Skip to first unread message

Maksym C.

unread,
Mar 13, 2024, 12:10:09 PM3/13/24
to swupdate
Hi all,

I'm just doing a PoC for SWUpdate. Everything works fine, except of one error which is misleading:

ERROR mongoose/mongoose_interface.c : upload_handler : 620 : Writing to IPC fails due to Broken pipe

My sw-description is:

software = {
version = "0.0.1";
description= "A simple software";

bootloader_transaction_marker = false;
bootloader_state_marker = false;
reboot = false;

hardware-compatibility: [ "#RE:.*" ];

scripts: (
{
filename = "display_info.sh";
type = "shellscript";
sha256 = "8256ddd01695ea47d0b98afb735b4663e7c077b61ff604680ec43282e8c36b8e";
}
)
}

and display_info.sh is:

#!/bin/sh

do_preinst()
{
echo "do_preinst"
exit 0
}

do_postinst()
{
echo "do_postinst"
exit 0
}

#echo $0 $1 > /dev/ttyO0

case "$1" in
preinst)
echo "call do_preinst"
do_preinst
;;
postinst)
echo "call do_postinst"
do_postinst
;;
*)
echo "default"
exit 1
;;
esac

The log output is:

[network_thread] : Incoming network request: processing...

Software Update started !

[network_initializer] : Software update started

[swupdate_create_directory] : Directory scripts/ cannot be created due to : File exists

[swupdate_create_directory] : Directory datadst/ cannot be created due to : File exists

[scan_mtd_devices] : MTD is not present on the target

[mtd_init] : MTD is not present in the system

[mtd_init] : cannot open libmtd

[extract_file_to_tmp] : Found file

[extract_file_to_tmp] : filename sw-description

[extract_file_to_tmp] : size 385

[extract_file_to_tmp] : Found file

[extract_file_to_tmp] : filename sw-description.sig

[extract_file_to_tmp] : size 2110

[check_verified_signer] : Verified signature 0 in signer sequence

[swupdate_verify_file] : Verified OK

[parse_cfg] : Parsing config file /tmp/sw-description

[get_common_fields] : Version 0.0.1

[get_common_fields] : Description A simple software

[get_common_fields] : Setting bootloader state marker: false

[get_common_fields] : Setting bootloader transaction marker: false

[parse_hw_compatibility] : Accepted Hw Revision : #RE:.*

[_parse_scripts] : Found Script: display_info.sh

[check_hw_compatibility] : Hardware edge Revision: 0.0.1

[hwid_match] : hwrev 0.0.1 matched by regexp .*

[check_hw_compatibility] : Hardware compatibility verified

[preupdatecmd] : Running Pre-update command

[extract_files] : Found file

[extract_files] : filename display_info.sh

[extract_files] : size 318 required

[extract_padding] : Expecting 68 padding bytes at end-of-file

[network_initializer] : Valid image found: copying to FLASH

Installation in progress

ERROR mongoose/mongoose_interface.c : upload_handler : 620 : Writing to IPC fails due to Broken pipe

[read_lines_notify] : call do_preinst

[read_lines_notify] : do_preinst

[run_system_cmd] : /tmp/scripts/display_info.sh preinst command returned 0

[read_lines_notify] : call do_postinst

[read_lines_notify] : do_postinst

[run_system_cmd] : /tmp/scripts/display_info.sh postinst command returned 0

SWUPDATE successful !

[postupdate] : Running Post-update command

[network_initializer] : Main thread sleep again !

Waiting for requests...


What could be the reason. Thank you very much in advance.

Stefano Babic

unread,
Mar 14, 2024, 12:32:20 PM3/14/24
to Maksym C., swupdate
Hi ???,

On 13.03.24 17:10, Maksym C. wrote:
> Hi all,
>
> I'm just doing a PoC for SWUpdate. Everything works fine, except of one
> error which is misleading:
>
> ERROR mongoose/mongoose_interface.c : upload_handler : 620 : Writing to
> IPC fails due to Broken pipe
>

True - probably this should be moved away from ERROR to WARN.

This sometimes happen when core has already finished the update, but the
Webserver has still some bytes (padding at the end of the file) to send.
SWUpdate has closed the connection because the Update was successful,
and it will just accept a new update. The Webserver gets that the IPC is
closed, and the line above is shown, but it is not considered an error
and SWUpdate will go on without stopping.

The trace could become an ERROR if this happens in the middle of pushing
the SWU, but in that case further ERROR should be logged. So I agree
that it should be downstepped to a lower priority.

Best regards,
Stefano Babic

>
> ERROR mongoose/mongoose_interface.c : upload_handler : 620 : Writing to
> IPC fails due to Broken pipe
>
> [read_lines_notify] : call do_preinst
>
> [read_lines_notify] : do_preinst
>
> [run_system_cmd] : /tmp/scripts/display_info.sh preinst command returned 0
>
> [read_lines_notify] : call do_postinst
>
> [read_lines_notify] : do_postinst
>
> [run_system_cmd] : /tmp/scripts/display_info.sh postinst command returned 0
>
> SWUPDATE successful !
>
> [postupdate] : Running Post-update command
>
> [network_initializer] : Main thread sleep again !
>
> Waiting for requests...
>
>
> What could be the reason. Thank you very much in advance.
>
> --
> You received this message because you are subscribed to the Google
> Groups "swupdate" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to swupdate+u...@googlegroups.com
> <mailto:swupdate+u...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/swupdate/2046e6e1-2712-451b-b3c8-765ccf2bf49dn%40googlegroups.com <https://groups.google.com/d/msgid/swupdate/2046e6e1-2712-451b-b3c8-765ccf2bf49dn%40googlegroups.com?utm_medium=email&utm_source=footer>.

Reply all
Reply to author
Forward
0 new messages