Constant notification errors
Asked by william:

Having a problem with confluence notifications. Somehow I have gotten into a state where I am getting constant errors in the atlassian-confluence log. Bear with me as I have to type this in.

ERROR \[NotificationSener:thread-1\]

\[plugin.notifications.dispatcher.NotificationErrorRegistryIMPL\]

addError Error sending notificationto server '\<unknown\>'\[-1\] Error generating message for INDIVIDUAL task for server "System Mail' on medium 'mail' for user 'some long hash I don't feel like typing in'

NullPointterException

The mail server configured by admin was something like foomail and we were getting some notifications. Just for giggles I changed the name to 'System Mail' and no change.

This may, or may not, have something to do with not getting notifications for page delete which is mentioned in [Daily Email Report Does Not Include Deletion of Page or Blog](https://jira.atlassian.com/browse/CONFSERVER-37898) bug report.-


Answers:
author: AnnWorley
body: Hi William,

The error you are reporting is very similar to the one in this knowledge base article: [Email notifications trigger a NoSuchElementException in the logs](https://confluence.atlassian.com/confkb/email-notifications-trigger-a-nosuchelementexception-in-the-logs-747443312.html)
> The error is thrown because the user, which is synchronized from Active Directory (or another external LDAP), is no longer active and has been disabled in LDAP, and by extension in Confluence. However, the user is still subscribed to page or space notifications, and being disabled does not remove those subscriptions. Confluence continues to try to send notifications to that user, and because the user is now disabled, it triggers a NoSuchElement exception.

The article goes on to describe deleting the notifications (subscriptions) from the database. If you are curious as to the user name associated with the errors, query the user_mapping table in Confluence with something like:

```
SELECT user_key, username FROM user_mapping WHERE user_key = 'Long hash from log';
```

Looking forward to hearing how it goes.

Thanks,

Ann

comments: author: william
body: In my case the user is very much alive. Which is a good thing as it is me.


author: AnnWorley
body: I opened a support request on your behalf so we can take a closer look. You should see an email from our portal soon.

After the issue is resolved we can circle back to this thread to let the Community know what the cause/resolution is.


author: Junio Fernandes
body: Hi!

Do you have any news? Because I have similar problem and users are active.
> 2018-08-22 15:20:26,534 ERROR \[NotificationSender:thread-2\] \[plugin.notifications.dispatcher.NotificationErrorRegistryImpl\] addError Error sending notification to server '\<Unknown\>'(-1) for INDIVIDUAL task (resent 0 times): Error sending to individual '2d546a0c63ca99230163fed23ba10001' on server 'System Mail'  
> NotificationException: javax.mail.AuthenticationFailedException: 454 4.7.0 Too many login attempts, please try again later. r13-v6sm2419240wmf.34 - gsmtp
>
> -- url: /json/removeattachment.action \| page: 28311661 \| traceId: 3058582bcd4d35f6 \| userName: junio.fernandes \| referer: http://confluence:8090/pages/viewpageattachments.action?pageId=28311661 \| action: removeattachment


author: william
body: A few of these are caused by NullPointerExceptions buried in various core and plugin code. Setting logging level to DEBUG for NotificationErrorRegistryImp in the log4j config file "may" throw a stack trace that indicates where the issue is. Or not.

For example Sharing a page consistently threw a NullPointerException that we wee able to fix.

We still sometimes see these pop up with no indication where they came from..


author: Dana Jansen
body: How were you able to fix the share page null pointer exception?


author: James Brown
body: What was the workaround or fix for this issue? Is this a legitimate concern or should the log message be suppressed?


author: Rilwan Ahmed
body: Increase the smtp timeout.

<https://confluence.atlassian.com/confkb/email-notifications-from-confluence-are-duplicated-using-microsoft-exchange-server-660966544.html>