TFA : Failing Email Delivery of TFA Verification Code During Login

TFA : Failing Email Delivery of TFA Verification Code During Login

Issue:
      In a non-EWS setup with Graph configuration in the outgoing mail server settings, the sending of TFA verification codes via email fails when attempting to log in.

Screenshot of Error:

Trace of Error in Logs:
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: com.manageengine.servicedesk.mailutils.MailException: No mail server found for given mailserver ::graph and serverId ::null|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at com.adventnet.servicedesk.common.MailUtilities.getOutgoingConnectionMap(MailUtilities.java:3638)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at com.adventnet.servicedesk.common.MailUtilities.getOutgoingConnectionMap(MailUtilities.java:3572)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at com.manageengine.servicedesk.mail.sender.MailSender.getInstance(MailSender.java:125)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at com.adventnet.servicedesk.notification.util.NotificationFactory.sendMail(NotificationFactory.java:1062)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at com.adventnet.servicedesk.notification.util.NotificationFactory.sendMailNotification(NotificationFactory.java:949)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at com.adventnet.servicedesk.notification.util.NotificationFactory.sendMailNotification(NotificationFactory.java:909)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at com.adventnet.servicedesk.notification.util.NotificationFactory.sendMailNotification(NotificationFactory.java:905)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at com.adventnet.servicedesk.notification.util.NotificationFactory.sendMailNotification(NotificationFactory.java:900)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at com.adventnet.servicedesk.notification.util.NotificationFactory.sendMailNotification(NotificationFactory.java:850)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at com.adventnet.servicedesk.notification.util.NotificationFactory.sendMailNotification(NotificationFactory.java:844)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at com.manageengine.adsf.authfactor.impl.SDMailAuthenticator.sentCodeToMail(SDMailAuthenticator.java:179)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at com.manageengine.adsf.authfactor.impl.SDMailAuthenticator.sendSecretCode(SDMailAuthenticator.java:138)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at com.manageengine.ads.fw.authentication.twofactor.ADSTwoFactorAPI.sendSecretCode(ADSTwoFactorAPI.java:430)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at com.manageengine.ads.fw.authentication.twofactor.ADSTwoFactorAction.sendSecretCode(ADSTwoFactorAction.java:88)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at java.lang.reflect.Method.invoke(Method.java:498)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:269)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:170)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:305)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at javax.servlet.http.HttpServlet.service(HttpServlet.java:681)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at javax.servlet.http.HttpServlet.service(HttpServlet.java:764)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at com.manageengine.servicedesk.common.filter.ResetThreadLocal.doFilter(ResetThreadLocal.java:26)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at com.adventnet.servicedesk.filter.EncodingFilter.doFilter(EncodingFilter.java:265)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at com.manageengine.servicedesk.filter.TfaOperationFilter.doFilter(TfaOperationFilter.java:43)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at com.manageengine.mdh.ESMAuthorizationFilter.doFilter(ESMAuthorizationFilter.java:61)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at com.adventnet.iam.security.SecurityFilter.doFilter(SecurityFilter.java:540)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at com.manageengine.servicedesk.filter.SdpSecurityFilter.doFilter(SdpSecurityFilter.java:250)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at com.adventnet.servicedesk.filter.RememberMe.doFilter(RememberMe.java:184)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at com.manageengine.mdh.MDHFilter.doFilter(MDHFilter.java:333)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:659)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:687)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:261)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at com.manageengine.servicedesk.valves.MethodFilterValve.invoke(MethodFilterValve.java:76)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.catalina.valves.StuckThreadDetectionValve.invoke(StuckThreadDetectionValve.java:206)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at com.manageengine.servicedesk.valves.SDPStuckThreadDetectionValve.invoke(SDPStuckThreadDetectionValve.java:112)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:382)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:895)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1722)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at java.lang.Thread.run(Thread.java:750)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: Caused by: java.lang.Exception: Failed to get graph outgoingmap|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at com.adventnet.servicedesk.common.MailUtilities.connectOutgoingGraphMail(MailUtilities.java:3806)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at com.adventnet.servicedesk.common.MailUtilities.getOutgoingConnectionMap(MailUtilities.java:3628)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: ... 78 more|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: Caused by: java.lang.NullPointerException|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at com.manageengine.servicedesk.mailutils.graph.GraphUtil.getOutgoingOkHttpClient(GraphUtil.java:271)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at com.manageengine.servicedesk.mailutils.graph.GraphUtil.getOkHttpClient(GraphUtil.java:233)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: at com.adventnet.servicedesk.common.MailUtilities.connectOutgoingGraphMail(MailUtilities.java:3795)|
[01:17:04:257]|[05-16-2024]|[SYSERR]|[INFO]|[97]: ... 79 more|

Fix:
      Utilize the provided fix JAR file to address the issue.

Note:
  1. This fix is only applicable to non-ESM setups with Graph configuration. If you encounter the issue in any other scenario, please contact support.
  2. Before applying the .fjar file, kindly verify its compatibility in the "Jar Compatibility" section below.
Steps to apply the fix:
1. Download the attached .fjar file.
2. Click here for steps to apply the .fjar file.
3. Restart the application service.
4. If the issue occurs again, recreate the issue, then immediately zip the logs (<server_home>\logs folder. For eg: C:\Program Files\ManageEngine\ServiceDesk\logs folder) and share it with us for analysis. If the size of the log file is huge, you can send it to us using our FTP link https://bonitas2.zohocorp.com/. Select the product as "ServiceDesk Plus" and provide the proper ticket number.
Jar Compatibility:
Build
Compatible Jar
14720
9872138_14720_TFA_Graph_Email_code_Error.fjar



                    New to ADSelfService Plus?

                      • Related Articles

                      • Login frequency

                        This report is used to find the Technician and Requester Login frequency. SELECT AaaUser.FIRST_NAME "Technician", MAX(AaaLogin.NAME) "LoginName", MAX(AaaContactInfo.EMAILID) "Email", MAX(AaaAccSession.USER_HOST) "IP Address", ...
                      • Query to Pull out Login Hours

                        Purpose        To generate the Total Login Hours per Technician.  Query : select ai as "Account ID", tn as "Technician Name ( First Name )", lh as "Login hours", LONGTODATE(llt) as "Last Login Time", ln as "Login Name", domain as "Domain", email as ...
                      • 9205662 - Debug jar : TFA verification mails are not sent

                        Issue: The graph is configured in the outgoing mail server settings, but the TFA verification emails are not being sent. Debug: the provided fjar in this KB will print Additional prints in the serverout. Steps to get the Debug logs: Download the ...
                      • Troubleshoot "Trust this browser" in TFA

                        Issue: TFA details need to be entered every time (after closing and opening browser / after reaching home or office / when IP changes) even if Trust this browser in enabled. Troubleshooting: 1. Check if "ADSTFA_xxxx" cookie is present on browser ...
                      • Login diectly with SAML / Query to enable AD or Local Auth when there is an issue with SAML

                        Issue: When users have AD and/or local authentication enabled along with SAML, the login page is shown when a link from an email is clicked and users need to click "Login with SAML" again. Workaround 1: You can bookmark, <sdp_url>/SamlRequestServlet ...