Confluence pages cannot be copied, if it contains a Comala document management workflow
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles 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
Summary
If a Confluence page contains a workflow created using Comala document management workflow, the copy operation of this page might throw an error and the operation will fail.
Environment
Confluence 8.5.7
Diagnosis
During the copy operation, the server will log the following errors in the logs.
2024-03-21 10:37:42,209 ERROR [http-nio2-8090-exec-1274 url: /confluence/500page.jsp; user: xxxxx] [atlassian.confluence.status.SystemErrorInformationLogger] logException Unhandled exception d32c3044-9aac-455d-a8ca-8bf594bf72cb: Cannot create new content property: JsonContentProperty{id='null', key='comalaworkflowparameters', content=CollapsedReference{idProperties={version=CollapsedReference
{idProperties=\{number=1}, referentClass=class com.atlassian.confluence.api.model.content.Version}, status=draft, id=ContentId{id=2918226095}}, referentClass=class com.atlassian.confluence.api.model.content.Content}, version=null}
-- traceId: ad835ad6d9959d94
com.atlassian.confluence.api.service.exceptions.ConflictException: Cannot create new content property: JsonContentProperty{id='null', key='comalaworkflowparameters', content=CollapsedReference{idProperties={version=CollapsedReference{idProperties={number=1}
, referentClass=class com.atlassian.confluence.api.model.content.Version}, status=draft, id=ContentId{id=xxxx}}, referentClass=class com.atlassian.confluence.api.model.content.Content}, version=null}: [SimpleMessage
{key='jsonproperty.duplicate.key', args=\[], translation='null'}
Cause
This is due to a duplication of some rows in the database in the content tables, related to the Comala app.
Solution
- Disable “Comala Document Management WorkflowParameters JCP Updater“ scheduled job (only if CDM version is lower than 7.3.0 or CDC and CDA versions are lower than 2.1.0)
- Running the following SQL query will get you the ids of all the affected pages by this problem (in the PAGEID column, but some might appear more than once):
SELECT *
FROM content AS c
JOIN bodycontent AS b ON c.contentid = b.contentid
WHERE c.contenttype = 'CUSTOM' AND c.title = 'comalaworkflowparameters' and c.pageid in (
SELECT c.pageid
FROM content AS c
JOIN bodycontent AS b ON c.contentid = b.contentid
WHERE c.contenttype = 'CUSTOM' AND c.title = 'comalaworkflowparameters'
GROUP BY c.pageid
HAVING COUNT(*) > 1
)
3. For each of the different page ids retrieved from the SQL before you must execute the following 2 curl commands (or call to that REST endpoint using another method) taking into account they have to replace the following elements:
- USER → user name to login and perform the action
- PASSWORD → user password to login and perform the action
- CONFLUENCE_HOST → the hostname of your Confluence instance
- PAGE_ID → the page id where to perform the action
curl -i -u USER:PASSWORD -X DELETE "http://CONFLUENCE_HOST/rest/api/content/PAGE_ID/property/comalaworkflowparameters"
curl -i -u USER:PASSWORD -X DELETE "http://CONFLUENCE_HOST/rest/api/content/PAGE_ID/property/comalaworkflowsworkflowparameterscurrentmodelversion"