Message ID | e0af6caa-970a-4bd0-9f02-6be2bd69f28bn@googlegroups.com |
---|---|
State | Changes Requested |
Headers | show |
Series | Garbage in "details" element of feedback POST request | expand |
Hi Abdul Karim, On 25.02.21 12:26, abdul karim wrote: > Hi, > I was experiencing 403 forbidden in response to a feedback POST request. > There is alimit in Hawkbit. > Oct 20 12:43:39 imx6ullevk-mel swupdate.sh[740]: * Connection #0 to host > 134.86.61.4 left intact > Oct 20 12:43:39 imx6ullevk-mel swupdate.sh[726]: [TRACE] : SWUPDATE > running : [channel_log_effective_url] : Channel's effective URL > resolved to > http://134.86.61.4:8090/default/controller/v1/imx6ullevk-mel/deploymentBase/1/feedback > Oct 20 12:43:39 imx6ullevk-mel swupdate.sh[726]: [ERROR] : SWUPDATE > failed [0] ERROR corelib/channel_curl.c : channel_post_method : 757 : > Channel operation returned HTTP error code 403. > Oct 20 12:43:39 imx6ullevk-mel swupdate.sh[726]: [ERROR] : SWUPDATE > failed [0] ERROR suricatta/server_hawkbit.c : > process_notification_thread : 979 : Error while sending log to server. > Oct 20 12:43:39 imx6ullevk-mel swupdate.sh[726]: # exit status: 0 > > > This is because the detail element of the query is corrupted. I do not think so. https://gitter.im/eclipse/hawkbit?at=5e5fa04a90a8295824044cb4 See Dominic's answer to increase the limit if you want to collect all details. > Oct 20 12:43:39 imx6ullevk-mel swupdate.sh[726]: [TRACE] : SWUPDATE > running : [channel_set_options] : Posted: { "id": 1, "time": > "20201020T124339", "status": { "result": { "progress": { "cnt" : 1, "of" > : 0 }, "finished": "none" }, "execution": "proceeding", "details" : [ > "[process_notification_thread] : Update log to server from > thread","[lua_dump_table] : (2) [table ] encrypted = > true","[channel_set_options] : cURL s low download speed timeout is > disabled, this is most probably not what you want. Adapted it to 300s > instead. ","[lua_dump_table] : (2) [table ] ivt = ","[lua_dump_table] : > (2) [table ] install_if_different = false","[lua_dump_table] : (2) > [table ] size = 0.0","[channel_set_options] : Posted: { id : 1, time > : 20201020T124323 , status : { result : { progress : { cnt : 0, > of : 0 }, finished : none }, execution : proceeding , details : > [ Software Update started ! , [extract_file_to_tmp] : Found file: > filename sw-description size 1637 , [extract_file_to_tmp] : Found > file: filename sw-description.sig size 256 , [swupdate_verify_file] : > Verify signed image: Read 1637 bytes , [swupdate_verify_file] : Verified > OK , [get_common_fields] : Version 1.4.0 , [parser] : Getting script , > [parser] : Found Lua Software: require ( swupdate_handlers > ) , [parse_hw_compatibility] : Accepted Hw Revision : v1.0 , > [lua_parser_fn] : Prepared to run rootfs_hook , [LUAstackDump] : (1) > [bool ] true , [lua_dump_table] : (2) [table ] mtdname = , > [lua_dump_table] : (2) [table ] checksum = 0.0 , [lua_dump_table] : (2) > [table ] name = compound_image , [lua_dump_table] : (2) [table ] script > = false , [lua_dump_table] : (2) [table ] path = , [lua_dump_table] : > (2) [table ] data = , [lua_dump_table] : (2) [table ] type = > rootfs_type , [lua_dump_table] : (2) [table ] compressed = zlib , > [lua_dump_table] : (2) [table ] offset = 0.0 , [lua_dump_table] : (2) > [table ] version = 12.1.3 , [lua_dump_table] : (2) [table ] > installed_directly = true , [lua_dump_table] : (2) [table ] volume = , > [lua_dump_table] : (2) [table ] encrypted = true , [lua_dump_table] : > (2) [table ] ivt = > > > When i looked into it, i found that All the logs (all log levels) are > being stacked into "notifymsgs" list here > https://github.com/sbabic/swupdate/blob/1a6dfbb5a0be978ac1a159758e278ab4d44167e2/core/network_thread.c#L98 > and gets copied to the msg here > https://github.com/sbabic/swupdate/blob/1a6dfbb5a0be978ac1a159758e278ab4d44167e2/core/network_thread.c#L391 > > which is eventually copied to details element > https://github.com/sbabic/swupdate/blob/1a6dfbb5a0be978ac1a159758e278ab4d44167e2/suricatta/server_hawkbit.c#L965 > > I have tried to fix it using the following patch > diff --git a/core/network_thread.c b/core/network_thread.c > index 0fd6227..d7da452 100644 > --- a/core/network_thread.c > +++ b/core/network_thread.c > @@ -66,6 +66,8 @@ static void clean_msg(char *msg, char drop) > > static void network_notifier(RECOVERY_STATUS status, int error, int > level, const char *msg) > { > + if (level == TRACELEVEL || level == DEBUGLEVEL ) > + return; And why is this a fix ? It just drops messages... Best regards, Stefano Babic
Hi, Thanks for your kind reply. I am running hawkbit using docker, and trying to set maxstatusectriesperstatus using the following command line variable *docker -l "debug" run -d -e HAWKBIT_SERVER_SECURITY_DOS_MAXSTATUSENTRIESPERACTION=-1 -p 8090:8080 hawkbit/hawkbit-update-server:0.3.0M6* But I am still getting "403 Forbidden" in response to feedback. Am I missing something? Best regards Abdul Karim 4:37 <https://mentorsiemens.slack.com/archives/DH4TXQQUE/p1614339470005700> On Thu, Feb 25, 2021 at 4:38 PM Stefano Babic <sbabic@denx.de> wrote: > Hi Abdul Karim, > > On 25.02.21 12:26, abdul karim wrote: > > Hi, > > I was experiencing 403 forbidden in response to a feedback POST request. > > > > There is alimit in Hawkbit. > > > Oct 20 12:43:39 imx6ullevk-mel swupdate.sh[740]: * Connection #0 to host > > 134.86.61.4 left intact > > Oct 20 12:43:39 imx6ullevk-mel swupdate.sh[726]: [TRACE] : SWUPDATE > > running : [channel_log_effective_url] : Channel's effective URL > > resolved to > > > http://134.86.61.4:8090/default/controller/v1/imx6ullevk-mel/deploymentBase/1/feedback > > Oct 20 12:43:39 imx6ullevk-mel swupdate.sh[726]: [ERROR] : SWUPDATE > > failed [0] ERROR corelib/channel_curl.c : channel_post_method : 757 : > > Channel operation returned HTTP error code 403. > > Oct 20 12:43:39 imx6ullevk-mel swupdate.sh[726]: [ERROR] : SWUPDATE > > failed [0] ERROR suricatta/server_hawkbit.c : > > process_notification_thread : 979 : Error while sending log to server. > > Oct 20 12:43:39 imx6ullevk-mel swupdate.sh[726]: # exit status: 0 > > > > > > This is because the detail element of the query is corrupted. > > I do not think so. > > https://gitter.im/eclipse/hawkbit?at=5e5fa04a90a8295824044cb4 > > See Dominic's answer to increase the limit if you want to collect all > details. > > > Oct 20 12:43:39 imx6ullevk-mel swupdate.sh[726]: [TRACE] : SWUPDATE > > running : [channel_set_options] : Posted: { "id": 1, "time": > > "20201020T124339", "status": { "result": { "progress": { "cnt" : 1, "of" > > : 0 }, "finished": "none" }, "execution": "proceeding", "details" : [ > > "[process_notification_thread] : Update log to server from > > thread","[lua_dump_table] : (2) [table ] encrypted = > > true","[channel_set_options] : cURL s low download speed timeout is > > disabled, this is most probably not what you want. Adapted it to 300s > > instead. ","[lua_dump_table] : (2) [table ] ivt = ","[lua_dump_table] : > > (2) [table ] install_if_different = false","[lua_dump_table] : (2) > > [table ] size = 0.0","[channel_set_options] : Posted: { id : 1, time > > : 20201020T124323 , status : { result : { progress : { cnt : 0, > > of : 0 }, finished : none }, execution : proceeding , details : > > [ Software Update started ! , [extract_file_to_tmp] : Found file: > > filename sw-description size 1637 , [extract_file_to_tmp] : Found > > file: filename sw-description.sig size 256 , [swupdate_verify_file] : > > Verify signed image: Read 1637 bytes , [swupdate_verify_file] : Verified > > OK , [get_common_fields] : Version 1.4.0 , [parser] : Getting script , > > [parser] : Found Lua Software: require ( swupdate_handlers > > ) , [parse_hw_compatibility] : Accepted Hw Revision : v1.0 , > > [lua_parser_fn] : Prepared to run rootfs_hook , [LUAstackDump] : (1) > > [bool ] true , [lua_dump_table] : (2) [table ] mtdname = , > > [lua_dump_table] : (2) [table ] checksum = 0.0 , [lua_dump_table] : (2) > > [table ] name = compound_image , [lua_dump_table] : (2) [table ] script > > = false , [lua_dump_table] : (2) [table ] path = , [lua_dump_table] : > > (2) [table ] data = , [lua_dump_table] : (2) [table ] type = > > rootfs_type , [lua_dump_table] : (2) [table ] compressed = zlib , > > [lua_dump_table] : (2) [table ] offset = 0.0 , [lua_dump_table] : (2) > > [table ] version = 12.1.3 , [lua_dump_table] : (2) [table ] > > installed_directly = true , [lua_dump_table] : (2) [table ] volume = , > > [lua_dump_table] : (2) [table ] encrypted = true , [lua_dump_table] : > > (2) [table ] ivt = > > > > > > When i looked into it, i found that All the logs (all log levels) are > > being stacked into "notifymsgs" list here > > > https://github.com/sbabic/swupdate/blob/1a6dfbb5a0be978ac1a159758e278ab4d44167e2/core/network_thread.c#L98 > > and gets copied to the msg here > > > https://github.com/sbabic/swupdate/blob/1a6dfbb5a0be978ac1a159758e278ab4d44167e2/core/network_thread.c#L391 > > > > which is eventually copied to details element > > > https://github.com/sbabic/swupdate/blob/1a6dfbb5a0be978ac1a159758e278ab4d44167e2/suricatta/server_hawkbit.c#L965 > > > > I have tried to fix it using the following patch > > diff --git a/core/network_thread.c b/core/network_thread.c > > index 0fd6227..d7da452 100644 > > --- a/core/network_thread.c > > +++ b/core/network_thread.c > > @@ -66,6 +66,8 @@ static void clean_msg(char *msg, char drop) > > > > static void network_notifier(RECOVERY_STATUS status, int error, int > > level, const char *msg) > > { > > + if (level == TRACELEVEL || level == DEBUGLEVEL ) > > + return; > > And why is this a fix ? It just drops messages... > > Best regards, > Stefano Babic > > -- > ===================================================================== > DENX Software Engineering GmbH, Managing Director: Wolfgang Denk > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany > Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic@denx.de > ===================================================================== >
Hi Abdul Karim, On 26.02.21 12:51, abdul karim wrote: > Hi, > Thanks for your kind reply. > I am running hawkbit using docker, and trying to set > maxstatusectriesperstatus using the following command line variable > *docker -l "debug" run -d -e > HAWKBIT_SERVER_SECURITY_DOS_MAXSTATUSENTRIESPERACTION=-1 -p 8090:8080 > hawkbit/hawkbit-update-server:0.3.0M6* > But I am still getting "403 Forbidden" in response to feedback. > Am I missing something? I do not think this is the correct way, you have to write a JSON file with your application.properties and then pass it to Hawkbit as "-e "SPRING_APPLICATION_JSON={ <JSON Properties> }" Ask to Hawkbit, https://gitter.im/eclipse/hawkbit Best regards, Stefano Babic > > Best regards > Abdul Karim > 4:37 <https://mentorsiemens.slack.com/archives/DH4TXQQUE/p1614339470005700> > > On Thu, Feb 25, 2021 at 4:38 PM Stefano Babic <sbabic@denx.de > <mailto:sbabic@denx.de>> wrote: > > Hi Abdul Karim, > > On 25.02.21 12:26, abdul karim wrote: > > Hi, > > I was experiencing 403 forbidden in response to a feedback POST > request. > > > > There is alimit in Hawkbit. > > > Oct 20 12:43:39 imx6ullevk-mel swupdate.sh[740]: * Connection #0 > to host > > 134.86.61.4 left intact > > Oct 20 12:43:39 imx6ullevk-mel swupdate.sh[726]: [TRACE] : SWUPDATE > > running : [channel_log_effective_url] : Channel's effective URL > > resolved to > > > http://134.86.61.4:8090/default/controller/v1/imx6ullevk-mel/deploymentBase/1/feedback > <http://134.86.61.4:8090/default/controller/v1/imx6ullevk-mel/deploymentBase/1/feedback> > > Oct 20 12:43:39 imx6ullevk-mel swupdate.sh[726]: [ERROR] : SWUPDATE > > failed [0] ERROR corelib/channel_curl.c : channel_post_method : 757 : > > Channel operation returned HTTP error code 403. > > Oct 20 12:43:39 imx6ullevk-mel swupdate.sh[726]: [ERROR] : SWUPDATE > > failed [0] ERROR suricatta/server_hawkbit.c : > > process_notification_thread : 979 : Error while sending log to > server. > > Oct 20 12:43:39 imx6ullevk-mel swupdate.sh[726]: # exit status: 0 > > > > > > This is because the detail element of the query is corrupted. > > I do not think so. > > https://gitter.im/eclipse/hawkbit?at=5e5fa04a90a8295824044cb4 > <https://gitter.im/eclipse/hawkbit?at=5e5fa04a90a8295824044cb4> > > See Dominic's answer to increase the limit if you want to collect all > details. > > > Oct 20 12:43:39 imx6ullevk-mel swupdate.sh[726]: [TRACE] : SWUPDATE > > running : [channel_set_options] : Posted: { "id": 1, "time": > > "20201020T124339", "status": { "result": { "progress": { "cnt" : > 1, "of" > > : 0 }, "finished": "none" }, "execution": "proceeding", "details" : [ > > "[process_notification_thread] : Update log to server from > > thread","[lua_dump_table] : (2) [table ] encrypted = > > true","[channel_set_options] : cURL s low download speed timeout is > > disabled, this is most probably not what you want. Adapted it to 300s > > instead. ","[lua_dump_table] : (2) [table ] ivt = > ","[lua_dump_table] : > > (2) [table ] install_if_different = false","[lua_dump_table] : (2) > > [table ] size = 0.0","[channel_set_options] : Posted: { id : 1, > time > > : 20201020T124323 , status : { result : { progress : { cnt > : 0, > > of : 0 }, finished : none }, execution : proceeding , > details : > > [ Software Update started ! , [extract_file_to_tmp] : Found file: > > filename sw-description size 1637 , [extract_file_to_tmp] : Found > > file: filename sw-description.sig size 256 , > [swupdate_verify_file] : > > Verify signed image: Read 1637 bytes , [swupdate_verify_file] : > Verified > > OK , [get_common_fields] : Version 1.4.0 , [parser] : Getting > script , > > [parser] : Found Lua Software: require ( swupdate_handlers > > ) , [parse_hw_compatibility] : Accepted Hw Revision : v1.0 , > > [lua_parser_fn] : Prepared to run rootfs_hook , [LUAstackDump] : (1) > > [bool ] true , [lua_dump_table] : (2) [table ] mtdname = , > > [lua_dump_table] : (2) [table ] checksum = 0.0 , [lua_dump_table] > : (2) > > [table ] name = compound_image , [lua_dump_table] : (2) [table ] > script > > = false , [lua_dump_table] : (2) [table ] path = , > [lua_dump_table] : > > (2) [table ] data = , [lua_dump_table] : (2) [table ] type = > > rootfs_type , [lua_dump_table] : (2) [table ] compressed = zlib , > > [lua_dump_table] : (2) [table ] offset = 0.0 , [lua_dump_table] : (2) > > [table ] version = 12.1.3 , [lua_dump_table] : (2) [table ] > > installed_directly = true , [lua_dump_table] : (2) [table ] > volume = , > > [lua_dump_table] : (2) [table ] encrypted = true , [lua_dump_table] : > > (2) [table ] ivt = > > > > > > When i looked into it, i found that All the logs (all log levels) are > > being stacked into "notifymsgs" list here > > > https://github.com/sbabic/swupdate/blob/1a6dfbb5a0be978ac1a159758e278ab4d44167e2/core/network_thread.c#L98 > <https://github.com/sbabic/swupdate/blob/1a6dfbb5a0be978ac1a159758e278ab4d44167e2/core/network_thread.c#L98> > > and gets copied to the msg here > > > https://github.com/sbabic/swupdate/blob/1a6dfbb5a0be978ac1a159758e278ab4d44167e2/core/network_thread.c#L391 > <https://github.com/sbabic/swupdate/blob/1a6dfbb5a0be978ac1a159758e278ab4d44167e2/core/network_thread.c#L391> > > > > which is eventually copied to details element > > > https://github.com/sbabic/swupdate/blob/1a6dfbb5a0be978ac1a159758e278ab4d44167e2/suricatta/server_hawkbit.c#L965 > <https://github.com/sbabic/swupdate/blob/1a6dfbb5a0be978ac1a159758e278ab4d44167e2/suricatta/server_hawkbit.c#L965> > > > > I have tried to fix it using the following patch > > diff --git a/core/network_thread.c b/core/network_thread.c > > index 0fd6227..d7da452 100644 > > --- a/core/network_thread.c > > +++ b/core/network_thread.c > > @@ -66,6 +66,8 @@ static void clean_msg(char *msg, char drop) > > > > static void network_notifier(RECOVERY_STATUS status, int error, int > > level, const char *msg) > > { > > + if (level == TRACELEVEL || level == DEBUGLEVEL ) > > + return; > > And why is this a fix ? It just drops messages... > > Best regards, > Stefano Babic > > -- > ===================================================================== > DENX Software Engineering GmbH, Managing Director: Wolfgang Denk > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany > Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: > sbabic@denx.de <mailto:sbabic@denx.de> > ===================================================================== >
diff --git a/core/network_thread.c b/core/network_thread.c index 0fd6227..d7da452 100644 --- a/core/network_thread.c +++ b/core/network_thread.c @@ -66,6 +66,8 @@ static void clean_msg(char *msg, char drop) static void network_notifier(RECOVERY_STATUS status, int error, int level, const char *msg) { + if (level == TRACELEVEL || level == DEBUGLEVEL ) + return; int len = msg ? strlen(msg) : 0; struct msg_elem *newmsg = (struct msg_elem *)calloc(1,