Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-57632

StringIndexOutOfBoundsException on expandAttachmentsLink()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Blocker Blocker
    • None
    • Jenkins ver. 2.138.1
      Confluence Publisher 2.0.3
      Atlassian Confluence 6.14.3

      Uploading attachments is working fine on its own.

      Editing confluence page is working fine on its own.

      When trying to do both of these - editing confluence page fails with an exception:

       

      BUILD SUCCESSFUL in 5s
      1 actionable task: 1 executed
      Build step 'Invoke Gradle script' changed build result to SUCCESS
      Archiving artifacts
      [confluence] Uploading attachments to Confluence page: https://confluence.xxx.com/display/YYY/ZZZ
      [confluence] Found 2 archived artifact(s) to upload to Confluence...
      [confluence] Uploading 2 file(s) to Confluence...
      [confluence]  - Uploading file: X1_(9308).apk (application/octet-stream)
      [confluence]    done: https://confluence.XXX.com/download/attachments/5571366/X1_%289308%29.apk?version=1&modificationDate=1558596764844&api=v2
      [confluence]  - Uploading file: X2_(9308).apk (application/octet-stream)
      [confluence]    done: https://confluence.XXX.com/download/attachments/5571366/X2_%289308%29.apk?version=1&modificationDate=1558596765878&api=v2
      [confluence] Done
      [confluence] EXPERIMENTAL: performing storage format edits on Confluence 4.0
      [confluence] Performing wiki edits: Insert content after token
      ERROR: Build step failed with exception
      java.lang.StringIndexOutOfBoundsException: String index out of range: -1
          at java.lang.String.substring(String.java:1927)
          at com.myyearbook.hudson.plugins.confluence.wiki.generators.MarkupGenerator.expandAttachmentsLink(MarkupGenerator.java:105)
          at com.myyearbook.hudson.plugins.confluence.wiki.generators.MarkupGenerator.expand(MarkupGenerator.java:81)
          at com.myyearbook.hudson.plugins.confluence.wiki.generators.FileGenerator.generateMarkup(FileGenerator.java:69)
          at com.myyearbook.hudson.plugins.confluence.wiki.editors.MarkupEditor.performReplacement(MarkupEditor.java:68)
          at com.myyearbook.hudson.plugins.confluence.ConfluencePublisher.performEdits(ConfluencePublisher.java:552)
          at com.myyearbook.hudson.plugins.confluence.ConfluencePublisher.performWikiReplacements(ConfluencePublisher.java:510)
          at com.myyearbook.hudson.plugins.confluence.ConfluencePublisher.perform(ConfluencePublisher.java:469)
          at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
          at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
          at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
          at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
          at hudson.model.Build$BuildExecution.post2(Build.java:186)
          at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
          at hudson.model.Run.execute(Run.java:1840)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          at hudson.model.ResourceController.execute(ResourceController.java:97)
          at hudson.model.Executor.run(Executor.java:429)
      Build step 'Publish to Confluence' marked build as failure
      Finished: FAILURE
      

            jhansche Joe Hansche
            jodaz1 Jonas Prapuolenis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: