Thursday, May 23, 2013

Immediate alerts not working on a list/document library

There are various issues with the sharepoint alerts.
Problem 1: Not a single site sends the alerts.
Problem 2: A specific site fails to send the alerts
Problem 3: A specific user fails to receive the alerts

Problem 1:Not a single site sends the alerts.
After registering for alerts on a SharePoint list/document library, you get the welcome email "You have successfully created an alert for 'doc lib' ". But you will never get the actual alert mail for the changes on the document/item you marked for an alert.
Reason:
There is a config/environement change that was not reflected into the config database or config cache.
Fix:

  1. Stop the WSS Sharepoint timer service
    start -> admin tools -> services -> Windows Sharepoint Services timer -> stop.
  2. delete the un used Alternate Access Mappings(CA-> Operations -> Alternate Access mappings), un used IP configurations, orphans in the DB.
  3. Clear the config cache.
    - Go to the local sharepoint config files folder:
    C:\Documents and Settings\All Users\Application Data\Microsoft\SharePoint\Config\ConfigDB ID
    - Delete all the XML files and do not delete the "cache.ini" file.
    - Delete all the numbers in the "cache.ini" , type 1 and save it.
  4. Start the WSS Sharepoint timer service
    start -> admin tools -> services -> Windows Sharepoint Services timer -> Start.
  5. Check whether the timer job is successful or not. Also see the Immediate alerts status.
    CA -> Operations -> Timer Job Status
  6. Check whether the 'alerts' is configured in Minutes :
    A -> Operations -> Timer Job definitions.
  7. Some times there will be a problem with the mail provider settings.Check the SMTP Relay settigns to see the IP Address configured properly.
Problem 2:A specific site fails to send the alerts
Reason:

There is a config/environment change in a specific site. In other scenarios, if a site is migrated from different environment or another version. So, you do not get alerts on that specific site.
Fix:
  1. (Do this step if your environement is flexible)
    Create a new web application/new content database and test for the alerts. On success, move this perticular problematic site to the new web application/content database.
  2. Force the "alerts enabled" command on the perticular site.
    C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN> stsadm.exe -o setproperty -pn alerts-enabled -pv "true" -url http://sitename/.
    You will be fine.
Other commands:
Though you can do all these below commands through CA UI, STSADM is preferred.
  1. To verify whether a site has the alerts enabled:
    Stsadm.exe-o getproperty -url http://sitename/ -pn alerts-enabled
    This will return Yes or No.
  2. To disable alerts on a site:
    stsadm.exe -o setproperty -pn alerts-enabled -pv "false" -url http://sitename/
  3. Verify the job-immediate-alerts. Should be every 5 minutes.
    stsadm.exe -o getproperty -url http://sitename/ -pn job-immediate-alerts
  4. If the above command returns any thing other than "Every 5 minutes between 0 and 59", set the time
    stsadm.exe -o setproperty -pn job-immediate-alerts -pv "every 5 minutes between 0 and 59" -url http://sitename/
Problem 3: A specific user fails to receive the alerts
Reason:
There must a problem with the registered email id. Or user might not have at least "read" access on the document library.
Fix:
  1. Check for the user access on the doc library. If not, add the user with at least "read" access.
    It may happen that the user gets the initial mail. Coz, initial mail doesnt look for the permissions before sending the mail.
  2. While configuring, use the "email id" instead of the usual "Domain\Name". If succeeded, then there must be a problem with the email id registered.
  3. To confirm the email not in sync,
    SQL -> Associated Content Database -> Tables -> ImmedSubscriptions -> email field.