Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

publishToConfluence - Images not found #1291

Closed
faltfe opened this issue Nov 13, 2023 · 3 comments · Fixed by #1294
Closed

publishToConfluence - Images not found #1291

faltfe opened this issue Nov 13, 2023 · 3 comments · Fixed by #1294

Comments

@faltfe
Copy link
Contributor

faltfe commented Nov 13, 2023

When running ./dtcw.bat publishToConfluence images are not found but the page is created or updated.

To Reproduce
Steps to reproduce the behavior:

  1. Download default template (I selected DE withhelp)
  2. Configure the confluence task
  3. Run ./dtcw.bat publishToConfluence with Bearer Token
  4. See error

Expected behavior
I would expect that all pages with there attachments (images) will be uploaded to confluence.

Screenshots
If applicable, add screenshots to help explain your problem.

Configuration

dtcw 0.52 - ##DTCW_GIT_HASH##
docToolchain 3.1.1
OS/arch: pwsh windows x64
Available docToolchain environments: local docker
Environments with docToolchain [3.1.1]: docker
Using environment: docker
confluence.with {
    input = [
            [ file: "build/html5/arc42/arc42.html", ancestorName: 'arc42-Test' ],
    ]

    api = 'https://xyz.com/confluence/rest/api/'

    // if true API V1 only will be used. Default is true.
    // useV1Api = true

    // the key of the confluence space to write to
    spaceKey = 'XYZ'

    // variable to determine how many layers of sub pages should be created
    subpagesForSections = 1

    pagePrefix = ''

    pageSuffix = ''

    pageVersionComment = ''

    bearerToken = System.properties.confluenceApiKey

    //optional API-token to be added in case the credentials are needed for user and password exchange.
    //apikey = "[API-token]"

    extraPageContent = ''
    enableAttachments = false
    pageLimit = 20
}

Error message:

docToolchain> docDir: /project
Start using bearer auth
publish build/html5/arc42/arc42.html
Retrieved pageId for given ancestorName 'arc42-Test' is 2278643048
Template
    attachment src: https://arc42.org
.
pages retrieved
> created page 2279268763
1. Einführung und Ziele
Could not find embedded image at a known location
Embedded Image Hash efea5aa18eabc32c14a228d1313f43c7
Creating image at /project/build/html5/arc42//confluence/images/
    image: /project/build/html5/arc42/confluence/images/efea5aa18eabc32c14a228d1313f43c7.png
    attachment src: #_aufgabenstellung
    attachment src: https://docs.arc42.org/section-1/
    attachment src: #_qualitätsziele
    attachment src: #_stakeholder
allPages already retrieved
pages retrieved
> created page 2279268764

> Task :publishToConfluence FAILED

FAILURE: Build failed with an exception.

* Where:
Script '/home/dtcuser/docToolchain/scripts/publishToConfluence.gradle' line: 47

* What went wrong:
Execution failed for task ':publishToConfluence'.
> groovyx.net.http.HttpResponseException: status code: 404

Additional context
The image build/html5/arc42/confluence/images/efea5aa18eabc32c14a228d1313f43c7.png was generated and can be found in this folder.

@PacoVK
Copy link
Collaborator

PacoVK commented Nov 13, 2023

Hey @faltfe thanks for reporting! Indeed i can reproduce it, there is a bug if you are not running on Confluence Cloud. The URL somehow gets constructed wrong. Sorry for that, i will see that there is a fix soon-ish. If you are running against Cloud you could omit the Confluence context part in the setting and only pass the domain, then everything works as expected...

@faltfe
Copy link
Contributor Author

faltfe commented Nov 14, 2023

Hi @PacoVK, thanks for your quick response. I'm happy to hear that you can reproduce it.
Unfortunately, I'm not working with Confluence Cloud, so I will wait for a fix.

@PacoVK
Copy link
Collaborator

PacoVK commented Nov 14, 2023

We will create a release soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants