Unable to create a page using Confluence's Blueprint due to No PageTemplate found for ContentTemplateRef

Platform Notice: Cloud and Data Center - This article applies equally to both cloud 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

Problem

When a user tries to create a page using a specific Confluence blueprint, the following error is thrown:

1 No PageTemplate found for ContentTemplateRef: 8945665:com.atlassian.confluence.plugins.confluence-software-blueprints:requirements-page

Upon checking the blueprint in General Configuration >> Global Templates and Blueprints, it is seen that the affected blueprint was edited previously and the user cannot reset it to default, being thrown to the following error message:

1 2 3 4 5 6 7 8 9 10 11 12 13 Cause java.lang.NullPointerException at com.atlassian.confluence.pages.templates.DefaultPageTemplateManager.findPreviousVersions(DefaultPageTemplateManager.java:89) Stack Trace:[hide] java.lang.NullPointerException at com.atlassian.confluence.pages.templates.DefaultPageTemplateManager.findPreviousVersions(DefaultPageTemplateManager.java:89) at com.atlassian.confluence.pages.templates.DefaultPageTemplateManager.removePreviousVersions(DefaultPageTemplateManager.java:77) at com.atlassian.confluence.pages.templates.DefaultPageTemplateManager.removePageTemplate(DefaultPageTemplateManager.java:67) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498)

Diagnosis

The AO_54C900_C_TEMPLATE_REF table holds all the versions a blueprint has in Confluence, in case it has ever been modified. The pagetemplates table, on the other hand, shows all the current modified versions.

When you press the "Reset to default" button, it is expected not to display any data in the pagetemplates table, because all current modified versions rolled back to the default version.

The first step to identify if you are being affected by this issue is to run the following queries:

1 2 3 4 5 6 7 8 9 SELECT "ID", "NAME", "PLUGIN_MODULE_KEY", "TEMPLATE_ID" FROM "AO_54C900_C_TEMPLATE_REF" WHERE "PLUGIN_MODULE_KEY" = 'com.atlassian.confluence.plugins.confluence-software-blueprints:requirements-page'; -- Grab the TEMPLATE_ID value to use it in the next query:

⚠️ Please note that in the "PLUGIN_MODULE_KEY" it was searched for the blueprint which is throwing this error.

1 2 3 4 SELECT templateid, templatename FROM pagetemplates WHERE templateid = <TEMPLATE_ID>;

If you have a record in the AO_54C900_C_TEMPLATE_REF table with a value other than 0 and if no records are shown in the second query, then you're being affected by the issue described in this Knowledge Base article.

Cause

It may happen that the AO_54C900_C_TEMPLATE_REF table will hold a corrupted record in it. This is identified when a row of the AO_54C900_C_TEMPLATE_REF table has the TEMPLATE_ID = 8945665 instead of 0, even after resetting the blueprint to its default. Please note that no records are being held on the pagetemplates table in the meantime as well.

The TEMPLATE_ID in the AO_54C900_C_TEMPLATE_REF table being different than 0 is the ID of a previous version of the affected blueprint, which was not altered to 0 when it was reset to default, as it should have been.

Solution

Workaround

Update the TEMPLATE_ID of the specific row of the AO_54C900_C_TEMPLATE_REF table to 0:

1 2 3 UPDATE "AO_54C900_C_TEMPLATE_REF" SET "TEMPLATE_ID" = 0 WHERE "ID" = <ID OF THE AFFECTED TEMPLATE>;

Always back up your data before making any database modifications. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.