Investigate the errors generated in logs while sending Notices.
Description
When we are working on Modsender logging improvement Jira, we noticed below error which keeps on generating for every notices. It seems that this error is not breaking any functionality as we are getting the notices.
15:47:41 [067948/notify;195269/message-delivery] [diku] [] [mod_sender] ERROR RestRouting You must set the Content-Length header to be the total size of the message body BEFORE sending any data if you are not using HTTP chunked encoding. java.lang.IllegalStateException: You must set the Content-Length header to be the total size of the message body BEFORE sending any data if you are not using HTTP chunked encoding.
Please find the logs
from the Snapshot environment.
Note : The error logs are taken before logging improvement changes merged into Master branch.
The Content-Length header IllegalStateException is caused by a bug in RMB. RMB-966 fixes it. An RMB release with the fix is not available yet.
Vignesh Kalyanasundaram April 25, 2023 at 1:07 PM
Hi We saw a Null Pointer Exception in Mod-Notify logs. While looking into that https://folio-org.atlassian.net/browse/MODNOTIFY-124, we found that we are getting null value when we tried to convert the HTTP Response body to String and this behavior is only for Mod-Sender. I think HTTP Response body to String is null because of the error mentioned in this Jira . The same code is working fine for API call of Mod template Engine. As of now, NPE is handled in Mod Notify. This is just an FYI.
When we are working on Modsender logging improvement Jira, we noticed below error which keeps on generating for every notices. It seems that this error is not breaking any functionality as we are getting the notices.
15:47:41 [067948/notify;195269/message-delivery] [diku] [] [mod_sender] ERROR RestRouting You must set the Content-Length header to be the total size of the message body BEFORE sending any data if you are not using HTTP chunked encoding.
java.lang.IllegalStateException: You must set the Content-Length header to be the total size of the message body BEFORE sending any data if you are not using HTTP chunked encoding.
Please find the logs
from the Snapshot environment.
Note : The error logs are taken before logging improvement changes merged into Master branch.
The unit tests produce the error 4 times, example from https://jenkins-aws.indexdata.com/job/folio-org/job/mod-sender/job/master/43/execution/node/54/log/ :