Skip to content

local images not uploaded to Confluence attachments (and thus not rendering) #72

Open
@cthenb

Description

@cthenb

OS: Win11
Version used: latest (3.4.6)
Confluence type: datacenter
Use case: want to upload plantuml files that have already been converted to .png by the plantuml tool to confluence alongside other documentation.

Problem description:

  • local images not uploaded to Confluence attachments (and thus not rendering)
  • Seems that I can't sync changes made to existing page (only creates not-yet-existing pages).
  • Documentation seems to be wrong / there's a bug for the Windows version of sync

point of reference; https://github.com/justmiles/go-markdown2confluence/issues/10

Authentication: access token

Simplified file structure:
D:\markdown2confluence (added to path)

In C:\Users<username><projec directory>:
Documentation \ <Parent page name> \ document.md
Documentation \ <Parent page name> \ <Subparent page name> \ document2.md
drawings \ drawing.puml
images \ drawing.png
plantuml.jar

Content of document.md (converted to above simplification):


DPL - Diagram

Let op: Deze pagina is gemaakt in bitbucket met markdown. Om deze in Confluence te updaten:

markdown2confluence --space 'X' --parent 'DPL - Algemeen' --use-document-title

![Diagram.png](../../images/drawing.png)


I've also tried /images/drawing.png to specify the root of the project, but that won't render the image locally.

Command 1:
PS <project directory>\Documentation\DPL - Algemeen> markdown2confluence sync --space 'X' --parent 'DPL - Algemeen' --use-document-title --debug '.\'
Output: --space is not defined

The above is what's listed on the homepage documentation. Very weird that it won't work if you include 'sync'

Command 2:
`PS \Documentation\DPL - Algemeen> markdown2confluence --space 'DIT' --parent 'DPL - Algemeen' --use-document-title --debug '.' sync

Output: Error opening file open sync: The system cannot find the file specified.

Command 3 (this one works in that it creates the pages, just not the images):
markdown2confluence --space 'DIT' --parent 'DPL - Algemeen' --use-document-title --debug '.\'
Output:
`Searching for parent DPL - Algemeen
time="2024-01-19T10:51:48+01:00" level=debug msg="GET https://redacted.nl/rest/api/content?limit=1&spaceKey=X&title=DPL+-+Algemeen&type=page"
time="2024-01-19T10:51:48+01:00" level=debug msg="Response Status Code: 200"
time="2024-01-19T10:51:48+01:00" level=debug msg="Response Body: '{"results":[{"id":"366711776","type":"page","status":"current","title":"DPL - Algemeen","extensions":{"position":0},"_links":{"webui":"/display/X/DPL+-+Algemeen","eX":"/pages/resumedraft.action?draftId=36671
1776","tinyui":"/x/4JPbFQ","self":"https://redacted.nl/rest/api/content/366711776"},"_expandable":{"container":"/rest/api/space/X","metadata":"","operations":"","children":"/rest/api/content/366711776/child","restrictions":"/rest/api/content/366711776/restriction/
byOperation","history":"/rest/api/content/366711776/history","ancestors":"","body":"","version":"","descendants":"/rest/api/content/366711776/descendant","space":"/rest/api/space/X"}}],"start":0,"limit":1,"size":1,"_links":{"self":"https://redacted.nl/rest/api/content?spaceKey=X&title=DPL+-+Algemeen&type=page\",\"base\":\"https://redacted.nl\",\"context\":\"\"}}'"
DPL - Diagram van redacted Componenten.md
DPL - Diagram van netwerken en omgevingen.md
DPL - Diagram van infrastructuur team redacted.md
---- RENDERED CONTENT START ---------------------------------

DPL - Diagram van redacted Componenten

Let op: Deze pagina is gemaakt in bitbucket met markdown. Om deze in Confluence te updaten:

markdown2confluence --space 'X' --parent 'DPL - Algemeen' --use-document-title

![Diagram.png](../../images/redacted Componenten.png)

---- RENDERED CONTENT END -----------------------------------
time="2024-01-19T10:51:48+01:00" level=debug msg="GET https://redacted.nl/rest/api/content?expand=version%2Cbody.storage&limit=1&spaceKey=X&title=DPL+-+Diagram+van+redacted+Componenten%0D&type=page"
---- RENDERED CONTENT START ---------------------------------

DPL - Diagram van netwerken en omgevingen

Let op: Deze pagina is gemaakt in bitbucket met markdown. Om deze in Confluence te updaten:

markdown2confluence --space 'X' --parent 'DPL - Algemeen' --use-document-title

![Diagram](../../images/Netwerken en omgevingen.png)

---- RENDERED CONTENT END -----------------------------------
---- RENDERED CONTENT START ---------------------------------
time="2024-01-19T10:51:48+01:00" level=debug msg="GET https://redacted.nl/rest/api/content?expand=version%2Cbody.storage&limit=1&spaceKey=X&title=DPL+-+Diagram+van+netwerken+en+omgevingen%0D&type=page"

DPL - Diagram van infrastructuur team redacted

Let op: Deze pagina is gemaakt in bitbucket met markdown. Om deze in Confluence te updaten:

markdown2confluence --space 'X' --parent 'DPL - Algemeen' --use-document-title

![Diagram](../../images/Infrastructuur team redacted.png)

---- RENDERED CONTENT END -----------------------------------
DPL - Diagram van gebruikte configuratie redacted.md
time="2024-01-19T10:51:48+01:00" level=debug msg="GET https://redacted.nl/rest/api/content?expand=version%2Cbody.storage&limit=1&spaceKey=X&title=DPL+-+Diagram+van+infrastructuur+team+redacted%0D&type=page"
---- RENDERED CONTENT START ---------------------------------

DPL - Diagram van gebruikte configuratie redacted

Let op: Deze pagina is gemaakt in bitbucket met markdown. Om deze in Confluence te updaten:

markdown2confluence --space 'X' --parent 'DPL - Algemeen' --use-document-title

![Diagram](../../images/Gebruikte configuratie redacted.png)

---- RENDERED CONTENT END -----------------------------------
time="2024-01-19T10:51:48+01:00" level=debug msg="GET https://redacted.nl/rest/api/content?expand=version%2Cbody.storage&limit=1&spaceKey=X&title=DPL+-+Diagram+van+gebruikte+configuratie+redacted%0D&type=page"
time="2024-01-19T10:51:48+01:00" level=debug msg="Response Status Code: 200"
time="2024-01-19T10:51:48+01:00" level=debug msg="Response Body: '{"results":[],"start":0,"limit":1,"size":0,"_links":{"self":"https://redacted.nl/rest/api/content?spaceKey=X&expand=version%2Cbody.storage&title=DPL+-+Diagram+van+redacted+Componenten%0D&type=page\",\"base\":\"https://redacted.nl\",\"context\":\"\"}}'"
time="2024-01-19T10:51:48+01:00" level=debug msg="POST https://redacted.nl/rest/api/content"
time="2024-01-19T10:51:48+01:00" level=debug msg="Response Status Code: 200"
time="2024-01-19T10:51:48+01:00" level=debug msg="Response Body: '{"results":[],"start":0,"limit":1,"size":0,"_links":{"self":"https://redacted.nl/rest/api/content?spaceKey=X&expand=version%2Cbody.storage&title=DPL+-+Diagram+van+netwerken+en+omgevingen%0D&type=page\",\"base\":\"https://redacted.nl\",\"context\":\"\"}}'"
time="2024-01-19T10:51:48+01:00" level=debug msg="POST https://redacted.nl/rest/api/content"
time="2024-01-19T10:51:48+01:00" level=debug msg="Response Status Code: 200"
time="2024-01-19T10:51:48+01:00" level=debug msg="Response Body: '{"results":[],"start":0,"limit":1,"size":0,"_links":{"self":"https://redacted.nl/rest/api/content?spaceKey=X&expand=version%2Cbody.storage&title=DPL+-+Diagram+van+infrastructuur+team+redacted%0D&type=page\",\"base\":\"https://redacted.nl\",\"context\":\"\"}}'"
time="2024-01-19T10:51:48+01:00" level=debug msg="POST https://redacted.nl/rest/api/content"
time="2024-01-19T10:51:48+01:00" level=debug msg="Response Status Code: 200"
time="2024-01-19T10:51:48+01:00" level=debug msg="Response Body: '{"results":[],"start":0,"limit":1,"size":0,"_links":{"self":"https://redacted.nl/rest/api/content?spaceKey=X&expand=version%2Cbody.storage&title=DPL+-+Diagram+van+gebruikte+configuratie+redacted%0D&type=page\",\"base\":\"https://redacted.nl\",\"context\":\"\"}}'"
time="2024-01-19T10:51:48+01:00" level=debug msg="POST https://redacted.nl/rest/api/content"
time="2024-01-19T10:51:49+01:00" level=debug msg="Response Status Code: 400"
time="2024-01-19T10:51:49+01:00" level=debug msg="Response Body: '{"statusCode":400,"data":{"authorized":false,"valid":true,"allowedInReadOnlyMode":true,"errors":[],"successful":false},"message":"A page with this title already exists: A page already exists with the title DPL - Diagram van infrastructuur team redacted in the space with key X","reason":"Bad Request"}'"
time="2024-01-19T10:51:49+01:00" level=error msg="A page with this title already exists: A page already exists with the title DPL - Diagram van infrastructuur team redacted in the space with key X"
time="2024-01-19T10:51:49+01:00" level=debug msg="Response Status Code: 400"
: L - Algemeen/DPL - Diagram van infrastructuur team redacted
time="2024-01-19T10:51:49+01:00" level=debug msg="Response Status Code: 400"
time="2024-01-19T10:51:49+01:00" level=debug msg="Response Body: '{"statusCode":400,"data":{"authorized":false,"valid":true,"allowedInReadOnlyMode":true,"errors":[],"successful":false},"message":"A page with this title already exists: A page already exists with the title DPL - Diagram van netwerken en omgevingen in the space with key X","reason":"Bad Request"}'"
time="2024-01-19T10:51:49+01:00" level=error msg="A page with this title already exists: A page already exists with the title DPL - Diagram van netwerken en omgevingen in the space with key X"
: L - Algemeen/DPL - Diagram van netwerken en omgevingen
time="2024-01-19T10:51:49+01:00" level=debug msg="Response Body: '{"statusCode":400,"data":{"authorized":false,"valid":true,"allowedInReadOnlyMode":true,"errors":[],"successful":false},"message":"A page with this title already exists: A page already exists with the title DPL - Diagram van redacted Componenten in the space with key X","reason":"Bad Request"}'"
time="2024-01-19T10:51:49+01:00" level=error msg="A page with this title already exists: A page already exists with the title DPL - Diagram van redacted Componenten in the space with key X"
: L - Algemeen/DPL - Diagram van redacted Componenten
time="2024-01-19T10:51:49+01:00" level=debug msg="Response Status Code: 400"
time="2024-01-19T10:51:49+01:00" level=debug msg="Response Body: '{"statusCode":400,"data":{"authorized":false,"valid":true,"allowedInReadOnlyMode":true,"errors":[],"successful":false},"message":"A page with this title already exists: A page already exists with the title DPL - Diagram van gebruikte configuratie redacted in the space with key X","reason":"Bad Request"}'"
time="2024-01-19T10:51:49+01:00" level=error msg="A page with this title already exists: A page already exists with the title DPL - Diagram van gebruikte configuratie redacted in the space with key X"
: L - Algemeen/DPL - Diagram van gebruikte configuratie redacted
Unable to upload markdown file DPL - Diagram van netwerken en omgevingen.md:
Error creating page: A page with this title already exists: A page already exists with the title DPL - Diagram van netwerken en omgevingen in the space with key X

Unable to upload markdown file DPL - Diagram van redacted Componenten.md:
Error creating page: A page with this title already exists: A page already exists with the title DPL - Diagram van redacted Componenten in the space with key X

Unable to upload markdown file DPL - Diagram van gebruikte configuratie redacted.md:
Error creating page: A page with this title already exists: A page already exists with the title DPL - Diagram van gebruikte configuratie redacted in the space with key X`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions