Confluence blog navigation menu is missing
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
The blogs navigation menu in Confluence does not render for some spaces. For example, you might see the navigation menu appear similar to the following:
Environment
7.15.0
Diagnosis
In the atlassian-confluence.log file, we will see the following error:
2022-05-26 09:13:43,035 ERROR [http-nio-8090-exec-10] [plugin.descriptor.web.ConfluenceWebInterfaceManager] getHtml Failed to render web panel: com.atlassian.plugin.web.descriptors.DefaultWebPanelModuleDescriptor$ContextAwareWebPanel@6fb45b6b2022-05-26 09:13:43,035 ERROR [http-nio-8090-exec-10] [plugin.descriptor.web.ConfluenceWebInterfaceManager] getHtml Failed to render web panel: com.atlassian.plugin.web.descriptors.DefaultWebPanelModuleDescriptor$ContextAwareWebPanel@6fb45b6b -- space: 524289 | url: /pages/viewrecentblogposts.action | traceId: 3dc16e210030d7a9 | userName: admin | referer: http://localhost:8090/display/LOU/2022/05/26/blog2 |
action: viewrecentblogpostsjava.lang.NullPointerException at java.base/java.util.Calendar.setTime(Calendar.java:1800)
at com.atlassian.confluence.plugins.ia.impl.DefaultBlogTreeService.getBlogTree(DefaultBlogTreeService.java:75)
at com.atlassian.confluence.plugins.ia.ui.DefaultSoySidebarContextProvider.populateWithContextualNavData(DefaultSoySidebarContextProvider.java:247)
at com.atlassian.confluence.plugins.ia.ui.DefaultSoySidebarContextProvider.getContextMap(DefaultSoySidebarContextProvider.java:121)
at com.atlassian.plugin.web.descriptors.DefaultWebPanelModuleDescriptor$ContextAwareWebPanel.getHtml(DefaultWebPanelModuleDescriptor.java:134)
at com.atlassian.confluence.plugin.descriptor.web.ConfluenceWebInterfaceManager$ExceptionHandlingWebPanel.getHtml(ConfluenceWebInterfaceManager.java:133)
Furthermore, we can run the following diagnostic query against the Confluence database to confirm there are blogs with a null creationdate:
SELECT *
FROM content
WHERE contenttype = 'BLOGPOST'
AND prevver IS null
AND creationdate IS null;
This query was tested against a Postgres database, if you are using a different database then you may need to make a few tweaks.
Cause
This can occur if a blog has a null value in the content table for the creationdate column. As the blogs are loaded in the navigation menu according to the date information, a null value in a blog may cause this to occur.
Solution
Solution 1 - Delete Blogs (
Recommended)The first option here is to manually delete the blogs which have a null creationdate values. This is recommended as it is a safer option. To do so:
First, backup the content of these blogs by running the following query:
SELECT c.*, bc.* FROM content c INNER JOIN bodycontent bc ON bc.contentid = c.contentid WHERE c.contenttype = 'BLOGPOST' AND c.prevver IS null AND c.creationdate IS null;
This query was tested against a Postgres database, if you are using a different database then you may need to make a few tweaks.
- Next, for each contentid returned by the above query, visit the following URL replacing the pageId parameter (999999) with the contentId from the query results.
<confluence-base-URL>/pages/removeblogpost.action?pageId=999999
- Finally, verify the blog navigation appears as expected
Solution 2 - Update Blogs in Database
The second option here is to update the null creationdate values in the Confluence database. This option is a bit more risky and requires Confluence to be shutdown. To do so:
First, please work with your DBA to capture a full Confluence database backup.
- Shutdown Confluence
Backup the content of these blogs by running the following query and dumping the results to a CSV file:
SELECT c.*, bc.* FROM content c INNER JOIN bodycontent bc ON bc.contentid = c.contentid WHERE c.contenttype = 'BLOGPOST' AND c.prevver is null AND c.creationdate is null;
Run the following update query:
UPDATE content SET creationdate = '2022-01-01 00:00:00' WHERE contenttype = 'BLOGPOST' AND prevver IS null AND creationdate IS null;
- This will set a false date for the blog. While it should fix the larger issue of the blog navigation not showing, the date of these blogs are being set to Jan 1 2022.
- Restart Confluence
- Finally, let's verify the blog navigation appears as expected.
As with all recommendations made by Atlassian Support, please follow best practices for Change Management and test and validate these settings in a Test or Development environment prior to deploying any changes to a Production environment. This allows for the validation of these changes while minimizing the risk and impact to end users. If a Test environment isn't available, then perform this test during a maintenance window or after hours.