Jira notification emails are received with the error "Could not locate resource"

Still need help?

The Atlassian Community is here for you.

Ask the community

    

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

When updates are made to a Jira issue, the Jira notifications sent from this issue do not contain any information regarding the update but instead show the error "Could not locate resource":



Environment

Jira Data Center 8.14.0 and above (does not apply to Jira Server).

Cause

Root Cause 1

Jira is configured with a cluster of nodes running on a Windows server, and we are running into this bug JRASERVER-71988 - Getting issue details... STATUS .

Root Cause 2

The folder that includes all the notification email templates (for both Jira batched notifications and non-batched notifications) is empty (or is missing some files):

(warning) Note that:

  • If Jira is configured with 1 single node only (clustering is off), the email template folder is located in <JIRA_HOME>/data/templates
  • If Jira is configured with a cluster of nodes, the email template folder is located in <JIRA_SHARED_HOME>/data/templates

Root Cause 3

Jira is configured with a cluster of nodes, and the path to the shared home folder set in the <JIRA_HOME>/cluster.properties file is pointing to a wrong location for some (or all) the Jira nodes.

Diagnosis

Regardless of the root cause, errors like the ones listed below will be thrown in the Jira application logs:

  • Example of error 1 (complaining about the template file <JIRA_HOME>/data/templates/email/subject/filtersubscription.vm which can't be found):

    2022-03-08 10:00:15,092-0500 Sending mailitem com.atlassian.jira.mail.SubscriptionSingleRecepientMailQueueItem owner: 'jirauser(jirauser)' INFO jirauser    Mail Queue Service [c.a.jira.template.JiraHomeTemplateContentLoaderImpl] File not found: <JIRA_HOME>/data/templates/email/subject/filtersubscription.vm
    2022-03-08 10:00:15,095-0500 Sending mailitem com.atlassian.jira.mail.SubscriptionSingleRecepientMailQueueItem owner: 'jirauser(jirauser)' WARN jirauser    Mail Queue Service [c.a.jira.template.CachingJiraHomeTemplateContentLoaderImpl] Exception:
    com.atlassian.cache.CacheException: java.lang.RuntimeException: Couldn't load template! templateFile: templates/email/subject/filtersubscription.vm
    	at com.atlassian.cache.memory.DelegatingCache.get(DelegatingCache.java:212)
    	at com.atlassian.jira.template.CachingJiraHomeTemplateContentLoaderImpl.getTemplateContent(CachingJiraHomeTemplateContentLoaderImpl.java:56)
    	at com.atlassian.jira.template.DefaultTemplateManager.getTemplateContent(DefaultTemplateManager.java:159)
  • Example of error 2 (complaining about the template file <JIRA_HOME>/data/templates/email/html/issuecreated.vm which can't be found):

    2022-03-08 10:02:00,128-0500 Sending mailitem com.atlassian.jira.mail.IssueMailQueueItem@2f4229ef[issue=com.atlassian.jira.issue.IssueImpl@27fdf1d4[id=1474000,summary=test email,key=ABC-123,created=2022-03-08 10:01:12.951,updated=2022-03-08 10:01:12.951,assignee=jirauser(jirauser),reporter=someuser(someuser)],remoteUser=someuser(someuser),notificationType=Current_Assignee,eventTypeId=1,templateId=1] INFO anonymous    Mail Queue Service [c.a.jira.template.JiraHomeTemplateContentLoaderImpl] File not found: <JIRA_HOME>/data/templates/email/html/issuecreated.vm
    
    2022-03-08 10:02:00,128-0500 Sending mailitem com.atlassian.jira.mail.IssueMailQueueItem@2f4229ef[issue=com.atlassian.jira.issue.IssueImpl@27fdf1d4[id=1474000,summary=test email,key=ABC-123,created=2022-03-08 10:01:12.951,updated=2022-03-08 10:01:12.951,assignee=jirauser(jirauser),reporter=someuser(someuser)],remoteUser=someuser(someuser),notificationType=Current_Assignee,eventTypeId=1,templateId=1] WARN anonymous    Mail Queue Service [c.a.jira.template.CachingJiraHomeTemplateContentLoaderImpl] Exception:
    com.atlassian.cache.CacheException: java.lang.RuntimeException: Couldn't load template! templateFile: templates/email/html/issuecreated.vm
    	at com.atlassian.cache.memory.DelegatingCache.get(DelegatingCache.java:212)
    	at com.atlassian.jira.template.CachingJiraHomeTemplateContentLoaderImpl.getTemplateContent(CachingJiraHomeTemplateContentLoaderImpl.java:56)
    	at com.atlassian.jira.template.DefaultTemplateManager.getTemplateContent(DefaultTemplateManager.java:159)
    	at com.atlassian.jira.mail.MailingListCompiler.evaluateEmails(MailingListCompiler.java:271)

Diagnosis for Root Cause 1

If Jira is configured with a cluster of nodes running on a Windows server, and if Jira is on any version 8.14.x, then you are likely to be running into the bug mentioned in Root Cause 1.

Diagnosis for Root Cause 2

Look for the files which the errors are complaining about (for example <JIRA_HOME>/data/templates/email/html/issuecreated.vm). Please keep in mind that, depending if Jira is using a cluster of nodes or just 1 node, the email templates will be either located in the Jira Shared Home directory (when clustering is ON), or in the Jira Home directory (when clustering is OFF).

If the files found in the errors from the Jira logs is/are missing, or if the entire template folder is empty, then you are likely to be affected by Root Cause 2.

Diagnosis for Root Cause 3

As explained in the documentation Set up a Jira Data Center cluster, when using a cluster of Jira nodes, the path to the shared home needs to be set in the <JIRA_HOME>/cluster.properties file of each Jira node. If the path is incorrectly set for any of the nodes, then you are likely to be affected by Root Cause 3.

Solution

Solution for Root Cause 1

2 options:

  • Upgrade Jira to the fixed version 8.15.0 or any higher version
  • Or follow the steps from the workaround section of the bug  JRASERVER-71988 - Getting issue details... STATUS

Solution for Root Cause 2

Go to ⚙ > System > Email Templates, and click on Revert to default:

This action will basically copy the entire template folder which ships in Jira out-of-the-box from the Jira installation folder into the Jira Shared home folder (if clustering is ON), or the Jira home folder (if clustering is OFF).

(warning) While doing the diagnosis for Root Cause 2, if you found that the templates folder was not empty, but that only some files were missing, then it might be a good idea to backup that template before following the workaround steps. This way, if you had performed any customization in this templates folder, such customization will not be lost.

Solution for Cause 3

Fix the <JIRA_HOME>/cluster.properties file to that the shared home folder points to the correct location.


Last modified on Apr 3, 2023

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.