APAR status
Closed as program error.
Error description
7.6.1.2 added the ability to use OAuth for email listener. The first step in the process with OAuth is to generate an access token from the refresh token but this could fail for a variety of reasons (bad client ID, bad refresh token, etc.). When the request fails, instead of seeing a helpful error message in the logs (unable to generate access token or something along those lines), we get a "java.util.NoSuchElementException". Example stack trace below. 08 Dec 2020 12:29:10:060 [ERROR] [MXServer] [CID-CRON-4947] Encountered error processing e-mails from mail server. java.util.NoSuchElementException at java.util.HashMap$HashIterator.nextNode(HashMap.java:1458) at java.util.HashMap$EntryIterator.next(HashMap.java:1490) at java.util.HashMap$EntryIterator.next(HashMap.java:1488) at psdi .common.emailstner.EmailListnerTask.readMessagesFromMailServer(E mailListnerTask.java:684) at psdi.common.emailstner.EmailListne rTask.performTask(EmailListnerTask.java:265) at psdi.common.ema ilstner.EmailListnerCron.cronAction(EmailListnerCron.java:49) a t psdi.server.CronTaskManager.callCronMethod(CronTaskManager.jav a:2566) at psdi.server.CronTaskManager.access$1100(CronTaskMana ger.java:106) at psdi.server.CronTaskManager$CronThread.run(Cro nTaskManager.java:3476) at java.util.concurrent.Executors$Runna bleAdapter.call(Executors.java:522) at java.util.concurrent.FutureTask.run(FutureTask.java:277) at jav a.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTas k.access$201(ScheduledThreadPoolExecutor.java:191) at java.util .concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run( ScheduledThreadPoolExecutor.java:304) at java.util.concurrent.T hreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1160) at ja va.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecu tor.java:635) at java.lang.Thread.run(Thread.java:822) This is due to the generating of the access token occurring in a function getAccessToken that returns an empty hashmap when the request fails. The readMessagesFromMailServer tries to process the HashMap (utilizing accessTokenHashMap.entrySet().iterator().next();) and because the HashMap is empty, you get the NoSuchElementException. STEPS TO REPRODUCE: Steps to recreate are easy if you have OAuth configured and have a 7.6.1.2 IFIX 03 system at least. You just need to adjust any of the OAuth settings to make it invalid (bad client ID, bad refresh token, etc.) and you'll recreate the error. Setting up OAuth will depend on the email provider so I can't give steps for that. RESULTS: Generic NoSuchElementException which is not very helpful EXPECTED RESULTS: We'd like to see two changes. In the getAccessToken function, it should log that there is a failure generating the access token. Today it seems to only log when an exception is encountered, but the API returning a bad response code would not be an exception and thus it doesn't log anything. Secondly, the getAccessToken function should throw an error when it fails to avoid further processing or in the readMessagesFromMailServer it should verify there is something in the HashMap before iterating to avoid the NoSuchElementException. PRODUCT VERSION: 7.6.1.2
Local fix
Problem summary
**************************************************************** * PROBLEM DESCRIPTION: * * When customer has misconfigured vendor side settings, the * * error message was ambiguous. * ****************************************************************
Problem conclusion
The fix for this APAR is contained in the following maintenance package: release\fix pack for Release 8.x Product
Temporary fix
Comments
APAR Information
APAR number
IJ30653
Reported component name
SYSTEM CONFIG
Reported component ID
5724R46S1
Reported release
761
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt / Xsystem
Submitted date
2021-02-02
Closed date
2023-05-09
Last modified date
2023-05-09
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
Fix information
Fixed component name
SYSTEM CONFIG
Fixed component ID
5724R46S1
Applicable component levels
[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSLKT6","label":"Maximo Asset Management"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"761","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]
Document Information
Modified date:
09 May 2023