View All Projects return 500 error (com.google.template.soy.tofu.SoyTofuException: In template aui.avatar.avatar: In 'print' tag, expression "$avatarImageUrl" evaluates to undefined.)
Symptoms
When clicking on Projects > View All Projects, you run into 500 error with the following details
Technical details
Log's referral number: 574d389e-84a3-4013-aaa3-2bd7a6200434
Cause
Referer URL: http://localhost:8080/6381/secure/admin/IndexAdmin.jspa
com.google.template.soy.tofu.SoyTofuException: In template aui.avatar.avatar: In 'print' tag, expression "$avatarImageUrl" evaluates to undefined.
com.google.template.soy.tofu.SoyTofuException: In template aui.avatar.avatar: In 'print' tag, expression "$avatarImageUrl" evaluates to undefined.
at com.google.template.soy.tofu.internal.BaseTofu.renderMainHelper(BaseTofu.java:341)
at com.google.template.soy.tofu.internal.BaseTofu.renderMain(BaseTofu.java:300)
at com.google.template.soy.tofu.internal.BaseTofu.access$100(BaseTofu.java:56)
at com.google.template.soy.tofu.internal.BaseTofu$RendererImpl.render(BaseTofu.java:427)
at com.atlassian.soy.impl.DefaultSoyManager.render(DefaultSoyManager.java:117)
at com.atlassian.soy.impl.DefaultSoyTemplateRenderer.render(DefaultSoyTemplateRenderer.java:52)
at com.atlassian.soy.impl.DefaultSoyTemplateRenderer.render(DefaultSoyTemplateRenderer.java:45)
at com.atlassian.soy.impl.DefaultSoyTemplateRenderer.render(DefaultSoyTemplateRenderer.java:38)
at com.atlassian.jira.web.tags.SoyTemplateTag.doEndTag(SoyTemplateTag.java:114)
at org.apache.jsp.secure.views.browser.browseprojects_jsp._jspService(browseprojects_jsp.java:862)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
Cause
Database inconsistencies in the Project table where Avatar of one of the projects is not valid is causing this. However, the cause of the inconsistencies is unknown.
Resolution
- Stop JIRA
Run the following query against your database
select * from project where avatar not in (select id from avatar)
This query checks if there are any projects whose avatar value does not exist in the database
If there are any results returned, run the following query
update project set avatar = 10011 where id = <ID>;
where <ID> is the ID of the project returned from the previour query. For example
update project set avatar = 10011 where id = 10000;
This changes the avatar value in the database to be the default rocket avatar
- Start JIRA
- Perform a re-index if needed
10011 is the default rocket icon for JIRA 6.3.8. It might differ depending on your JIRA version. To find which is the icon, run the following query
select * from avatar;