Fixing Broken 'Projects' Drop-Down due to 'avatarId should not be null!' Error
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
Symptoms
#1 - When clicking on the "Projects" link in JIRA, the drop-down menu does not appear. Instead, the user is redirected to the last project. The only way the user can browse to find all projects is to navigate to the "Administration" link.
#2 - This error might also broke the navigation under Administration > Projects.
An error similar to the following appears in the logs:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
SEVERE: Internal server error
com.atlassian.jira.util.dbc.Assertions$NullArgumentException: avatarId should not be null!
at com.atlassian.jira.util.dbc.Assertions.notNull(Assertions.java:26)
at com.atlassian.jira.avatar.AvatarManagerImpl.getById(AvatarManagerImpl.java:45)
at com.atlassian.jira.project.ProjectImpl.getAvatar(ProjectImpl.java:103)
at com.atlassian.jira.gadgets.system.ProjectGadgetResource.getProjectDataNoPermissionCheck(ProjectGadgetResource.java:392)
at com.atlassian.jira.gadgets.system.ProjectGadgetResource.generate(ProjectGadgetResource.java:292)
at sun.reflect.GeneratedMethodAccessor722.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:175)
at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:67)
at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:163)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:111)
at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:71)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:111)
at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:63)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:654)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:612)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:603)
at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:309)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:425)
at com.atlassian.plugins.rest.module.RestDelegatingServletFilter$JerseyOsgiServletContainer.doFilter(RestDelegatingServletFilter.java:198)
at com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:689)
at com.atlassian.plugins.rest.module.Res
Cause
One or more JIRA projects are missing the "avatar" setting, which is supposed to be required in JIRA projects.
The following SQL script can be run against JIRA's database to check whether there are any projects missing this setting:
1
select * from project where avatar is null;
The root cause of missing avatar may relate to a known JIRA 4.1.* bug: JRA-21564.
Resolution
For Symptom #1
Please follow the below steps to fix the problem:
Go to Administration > Projects
Click Edit link in Operations column for the project
In Edit Project page, select a valid avatar for that project
Check if you can bypass this problem
For Symptom #2
As you can not access the Projects view you will need to fix the null avatar on the project directly on the database.
⚠️ Please make sure you have a backup prior running any change directly on the database. If possible test the procedure in a lower environment first.
First, get an existing avatar id from another project and check the project "Test project No Hours" id by running:
1
SELECT * FROM project;
Stop Jira
Update the avatar with the following query:
1
UPDATE project SET avatar='<avatar_id>' WHERE id='<project_id>';
Start Jira - check if you can access Projects now.
Was this helpful?