StringOutOfBoundException in ProcessGraphMessage while processing the address headers

StringOutOfBoundException in ProcessGraphMessage while processing the address headers

Issue:

While Fetching some mails using graph we experience mail fetching stopping issue while processing the address headers of the mail.

  1. [08:07:18:693]|[09-20-2023]|[com.adventnet.servicedesk.helpdesk.mail.task.MailFetchingTask]|[SEVERE]|[108]: Exception while starting MailFetching Schedule. Exception is : String index out of range: -1|
    [08:07:18:693]|[09-20-2023]|[SYSERR]|[INFO]|[108]: java.lang.StringIndexOutOfBoundsException: String index out of range: -1|
    [08:07:18:693]|[09-20-2023]|[SYSERR]|[INFO]|[108]: 	at java.lang.AbstractStringBuilder.substring(AbstractStringBuilder.java:935)|
    [08:07:18:693]|[09-20-2023]|[SYSERR]|[INFO]|[108]: 	at java.lang.StringBuilder.substring(StringBuilder.java:81)|
    [08:07:18:693]|[09-20-2023]|[SYSERR]|[INFO]|[108]: 	at java.lang.AbstractStringBuilder.substring(AbstractStringBuilder.java:881)|
    [08:07:18:693]|[09-20-2023]|[SYSERR]|[INFO]|[108]: 	at java.lang.StringBuilder.substring(StringBuilder.java:81)|
    [08:07:18:693]|[09-20-2023]|[SYSERR]|[INFO]|[108]: 	at com.manageengine.servicedesk.mail.core.ProcessGraphMessage.parseAddress(ProcessGraphMessage.java:432)|
    [08:07:18:693]|[09-20-2023]|[SYSERR]|[INFO]|[108]: 	at com.manageengine.servicedesk.mail.core.ProcessGraphMessage.loadProperties(ProcessGraphMessage.java:104)|
    [08:07:18:693]|[09-20-2023]|[SYSERR]|[INFO]|[108]: 	at com.manageengine.servicedesk.mail.core.ProcessMessageHandler.loadPropertiesIntoBean(ProcessMessageHandler.java:95)|
    [08:07:18:693]|[09-20-2023]|[SYSERR]|[INFO]|[108]: 	at com.manageengine.servicedesk.mail.core.ProcessMessageHandler.loadProperties(ProcessMessageHandler.java:47)|
    [08:07:18:693]|[09-20-2023]|[SYSERR]|[INFO]|[108]: 	at com.adventnet.servicedesk.mailutils.MailProcessor.processEMail(MailProcessor.java:56)|
    [08:07:18:693]|[09-20-2023]|[SYSERR]|[INFO]|[108]: 	at com.manageengine.servicedesk.mail.core.fetcher.GraphMailFetcher.fetchAndProcessMails(GraphMailFetcher.java:108)|
    [08:07:18:693]|[09-20-2023]|[SYSERR]|[INFO]|[108]: 	at com.manageengine.servicedesk.mail.core.fetcher.MailFetcher.startFetching(MailFetcher.java:306)|
    [08:07:18:693]|[09-20-2023]|[SYSERR]|[INFO]|[108]: 	at com.adventnet.servicedesk.helpdesk.mail.task.MailFetchingTask.executeTask(MailFetchingTask.java:39)|
    [08:07:18:693]|[09-20-2023]|[SYSERR]|[INFO]|[108]: 	at com.adventnet.taskengine.internal.SchedulerBean.executeTask(SchedulerBean.java:641)|
    [08:07:18:693]|[09-20-2023]|[SYSERR]|[INFO]|[108]: 	at sun.reflect.GeneratedMethodAccessor80.invoke(Unknown Source)|
    [08:07:18:693]|[09-20-2023]|[SYSERR]|[INFO]|[108]: 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)|
    [08:07:18:693]|[09-20-2023]|[SYSERR]|[INFO]|[108]: 	at java.lang.reflect.Method.invoke(Method.java:498)|
    [08:07:18:693]|[09-20-2023]|[SYSERR]|[INFO]|[108]: 	at com.adventnet.mfw.bean.BeanProxy.lambda$invoke$0(BeanProxy.java:51)|
    [08:07:18:693]|[09-20-2023]|[SYSERR]|[INFO]|[108]: 	at com.zoho.mickey.api.DefaultCodeBlock.execute(CodeBlock.java:453)|
    [08:07:18:693]|[09-20-2023]|[SYSERR]|[INFO]|[108]: 	at com.adventnet.mfw.bean.BeanProxy.invoke(BeanProxy.java:48)|
    [08:07:18:693]|[09-20-2023]|[SYSERR]|[INFO]|[108]: 	at com.sun.proxy.$Proxy5.executeTask(Unknown Source)|
    [08:07:18:693]|[09-20-2023]|[SYSERR]|[INFO]|[108]: 	at com.adventnet.taskengine.internal.ScheduleExecutor.executeNextTask(ScheduleExecutor.java:334)|
    [08:07:18:693]|[09-20-2023]|[SYSERR]|[INFO]|[108]: 	at com.adventnet.taskengine.internal.ScheduleExecutor.run(ScheduleExecutor.java:225)|
    [08:07:18:693]|[09-20-2023]|[SYSERR]|[INFO]|[108]: 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)|
    [08:07:18:693]|[09-20-2023]|[SYSERR]|[INFO]|[108]: 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)|
    [08:07:18:693]|[09-20-2023]|[SYSERR]|[INFO]|[108]: 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)|
    [08:07:18:693]|[09-20-2023]|[SYSERR]|[INFO]|[108]: 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)|
    [08:07:18:693]|[09-20-2023]|[SYSERR]|[INFO]|[108]: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)|
    [08:07:18:693]|[09-20-2023]|[SYSERR]|[INFO]|[108]: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)|
    [08:07:18:693]|[09-20-2023]|[SYSERR]|[INFO]|[108]: 	at java.lang.Thread.run(Thread.java:750)|
    [08:07:18:693]|[09-20-2023]|[com.manageengine.servicedesk.mail.core.fetcher.MailFetcher]|[INFO]|[108]: threadName from Map::null and currentThreadName::MailFetching_4 are different. So not removing entry from Map|

Fix:

If respective address fields are not given we will mark that address fields as empty string("") which is considered as "Not Provided".

Issue ID: SD-113146

Steps to apply the fix

1. Download the attached 14304_9168105.fjar file.
2. Click here on steps to apply the fjar file.
3. Restart the application service.
4. Check whether the issue is resolved.
5. If the issue occurs again, immediately zip the logs (<server_home>\logs folder. For eg: C:\Program Files\ManageEngine\ServiceDesk\logs folder) and share it with us for analysis.


Build
Compatible Jar
14304
113146_14304.fjar
14501,14502,14503
 113146_14501_14503.fjar



                    New to ADSelfService Plus?

                      • Related Articles

                      • StringOutOfBoundException in ProcessGraphMessage while processing the address headers

                        Issue: While Fetching some mails using graph we experience mail fetching stopping issue while processing the address headers of the mail. [08:07:18:693]|[09-20-2023]|[com.adventnet.servicedesk.helpdesk.mail.task.MailFetchingTask]|[SEVERE]|[108]: ...
                      • Fix: Failed to parse To/Cc address while fetching mails using Graph

                        Issue: If the To / Cc address contains the email address in the format "Test, SDP" <test@sdp.com> (containing "," character in the email address itself), then parsing of such addresses using Microsoft Graph fails in SDP. If such address is a support ...
                      • Missing Whitespace Character

                        Issue: When the mails are fetched using EWS, the mail processing skips the whitespace (blank space) character in certain scenarios. (Example case: Two different words get merged into a single word). Resolution: The fix for the issue has been attached ...
                      • Mail fetching Stopped when processing a mail with Invalid From Address

                        Trace : [13:18:44:385]|[04-17-2023]|[com.manageengine.servicedesk.mail.core.ProcessMailMessage]|[INFO]|[185]: com.adventnet.servicedesk.mailutils : setFromAddress()| ...
                      • Update IP Address in Request additional field

                        Requirement: As per the application design, the IP address of the machine from which the request was created will be noted in the History tab.   Update this "IP Address" in a request additional field. Steps to configure: Goto Admin > Developer Space ...