SoyTofuException encountered attempting to reindex after upgrading Jira
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
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
A SoyTofuException is encountered when attempting to re-index after upgrading Jira from an earlier version:
Another symptom that might be observed is the inability to create a support zip from the page ⚙ > System > Troubleshooting and support zip. When trying to create a support zip, nothing is shown in the Create support zip tab.
Environment
Jira Server/Data Center on any version from 8.5.0.
Diagnosis
When attempting to complete a Background re-index or a Full re-index from UI, you encounter a SoyTofuException similar to the example below:
Technical details
Log's referral number: #-#-#-#
Cause
Referer URL: https://jira.baseurl.com/secure/admin/IndexAdmin.jspa
com.google.template.soy.tofu.SoyTofuException: When evaluating "'IndexReIndex!reindex.jspa?atl_token=' + $atlToken + '&indexingStrategy=' + $indexingStrategy": Attempted to coerce undefined value into a string.
com.google.template.soy.tofu.SoyTofuException: When evaluating "'IndexReIndex!reindex.jspa?atl_token=' + $atlToken + '&indexingStrategy=' + $indexingStrategy": Attempted to coerce undefined value into a string.
at JIRA.Templates.Admin.Index.buttonContainer(confirm-reindex.soy:65) [?:?]
at JIRA.Templates.Admin.Index.confirmReindex(Unknown Source) [?:?]
at com.google.template.soy.tofu.internal.BaseTofu.renderMainHelper(BaseTofu.java:369) [?:?]
at com.google.template.soy.tofu.internal.BaseTofu.renderMain(BaseTofu.java:322) [?:?]
at com.google.template.soy.tofu.internal.BaseTofu.access$100(BaseTofu.java:66) [?:?]
at com.google.template.soy.tofu.internal.BaseTofu$RendererImpl.render(BaseTofu.java:476) [?:?]
at com.atlassian.soy.impl.DefaultSoyManager.render(DefaultSoyManager.java:154) [?:?]
Cause
Cause 1
Custom Javascript introduced via the announcement banner can result in this type of failure.
Cause 2
Running third-party apps that have not been updated to a version that is compatible with the version of Jira that is installed can result in this type of failure.
Cause 3
CDN is enabled in Jira. "batch.js" and CSS content are being retrieved from CDN server, which is impacting the accessibility of the indexing page.
Sample browser console log:
batch.js?locale=en-US:54 [WRM] [handler] Downloading resources ['js!https://xxxxx.cloudfront.net/s/d41d8cd…esources:license-banner-resource,-_super/batch.js']
[WRM] [handler] Downloading resources ['js!https://xxx.cloudfront.net/s/d41d8cd…a.webresources:header-dimensions,-_super/batch.js']
GET https://xxx.xxx.com/secure/admin/IndexConfirmReIndex!default.jspa?inline=true&decorator=dialog&_=1723620088935 500 (Internal Server Error)
Cause 4
The error is caused by an outdated browser version. One browser that is known to cause this error is Firefox on version 77.0.2. To check if this root cause is relevant, either try to upgrade the current browser or switch to a different browser and check if the error goes away.
Solution
Solution for Root Cause 1
- Choose Administration ( ) >System.
- Select User Interface > Announcement banner in the System panel below.
- Save the current text from the Announcement field to a text file.
- Temporarily remove all text from the Announcement field.
- Test to see if you can reproduce the re-index failure.
Solution for Root Cause 2
- Visit Administration ( ) > Manage Apps and choose Manage Apps under ATLASSIAN MARKETPLACE.
- Update all third-party apps to a version that is compatible with the version of Jira you have installed.
Solution for Root Cause 3
The problem is caused by having CDN enabled. Please try temporarily disabling or removing the CDN settings, rebooting the Jira node, and accessing the indexing page again.
Solution for Root Cause 4
Either upgrade the current browser to the latest version, or switch to a different browser.
Reaching out to Atlassian Support
If none of the solution listed above helps, we recommend reaching out to Atlassian Support for further assistance.
To help the Atlassian Support team investigate this issue faster, please follow the steps below and attach to the support ticket the support zip (if you are able to create a support zip):
- Navigate to Administration ( ) System > Logging and profiling
- Scroll down to the "Configure logging level for another package." line and click "Configure"
- Add these packages at the DEBUG level:
- com.atlassian.jira.index
- com.atlassian.jira.issue.index
Note: The DEBUG logs can be disabled after the data has been collected.
- Collect a support zip.
- Let's grab a HAR file while reproducing the error on the browser.
- Also, save the browser console logs to make sure we capture the Javascript errors.
- Open a case with Atlassian Support.