Wednesday, November 4, 2009

Oracle WCI: Warning: couldn't access subscriber X, continuing;

All of a sudden, our Saved Search Mailer scripts stopped working, after several years without a glitch.

The error I could find in the log files was this one:
Warning: couldn't access subscriber X, continuing
I spent the day trying to figure this out, as I couldn't find any clue using the PTSpy tool, nor in the million other log files... I had to decompile the Java classes of the "externaloperations.jar" library to find out what the process was doing before spitting out that error message.

Here is the code where that error message is shown:
void prepareSubscriberList()
{
int userIds[] = m_ptSearch.RetrieveSubscribedUsers();
if(userIds == null)
throw new RuntimeException("Saved Search object failed to retrieve subscribers");

IPTProfileManager ptPM = (IPTProfileManager)m_ptSession.OpenGlobalObject(58, false);
m_subscribers = new Vector();
for(int i = 0; i < userIds.length; i++)
{
int userId = userIds[i];
try
{
IPTUserInfo ptUI = ptPM.GetUserInfo(userId);
String email = ptUI.GetEmail();
if(email == null)
throw new RuntimeException("no email");

String name = ptUI.GetFullName();
if(name == null)
{
IPTUser ptU = (IPTUser)m_ptSession.GetUsers().Open(userId, false);
name = ptU.GetName();
if(name == null)
name = ptU.GetLoginName();
if(name == null)
name = "User";
}
if(ptUI != null)
m_subscribers.addElement(new Subscriber(userId, name, email));
}
catch(Exception e)
{
Log.println((new StringBuilder()).append("Warning: couldn't access subscriber ").append(userId).append(", continuing.").toString());
}
}
}

So, I guessed there was an issue with the email address received from the Remote API service. I checked the "User Profile Manager" admin tool, under "User Information - Property Map" and found that the "Email Address" property was mapped to the "IMUser" attribute, instead of the usual "Email" attribute. I changed it back to the normal value and everything returned to normal :-) This also "repaired" a lot of Collaboration Server errors, stating that the email address was not passed to the portlet.

I still have no idea why this value was changed...

No comments: