Fixing Broken 'Projects' Drop-Down due to 'avatarId should not be null!' Error

Still need help?

The Atlassian Community is here for you.

Ask the community

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:

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:

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.


  1. First, get an existing avatar id from another project and check the project "Test project No Hours" id by running:

    SELECT * FROM project;
    
  2. Stop Jira
  3. Update the avatar with the following query:
    UPDATE project SET avatar='<avatar_id>' WHERE id='<project_id>'; 
    
  4. Start Jira - check if you can access Projects now.






























Last modified on Jan 3, 2023

Was this helpful?

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