When publishing ascidoc Documentation via the docker-image confluence-publisher in my GitLab CI/CD Pipeline i got the error:
A page with this title already exists: A page already exists with the same TITLE in this space
It successfully created the pages but later when a new release was created i got this error, no other page was in this space so the only page with this title i wanted to create (except the one the publisher should edit)
If i delete everything but the ancestor and rename the ancestor the pipeline ran through.
(I answer this here myself because i found the problem after searching through github issues but its hard to google this problem fast even tho the problem is easily solved)
My problem was, that i used a :
in the PAGE_TITLE_PREFIX
env-variable.
GitHub User @dierk42 hinted:
I had similar problems. The reason in my case where colons (':') in a genareted title. Confluence's search engine Lucene interprets word followed by a colon as a search field to search in -- which in most cases gives no result. So the script wants to create a new page. And this is rejected by Confluence. (https://github.com/docToolchain/docToolchain/issues/339#issuecomment-522551548)
So when a :
(and probably other characters) are used in the title of the pages it wont find the page and thinks this page does not exist.
The fix is to either change the prefix of the page in my case, or in general sanitize the titles in the ascii-doc itself.