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

Ansi plugin fails to render formatted console output

XMLWordPrintable

      Ansicolor plugin throws error when formatted string appears in console output. Archived console logs are rendered just fine.

      Expected output:
      [exec]
      Api Tests (300)
      --------------------------------------------
      [exec] Testing api
      [exec] SomeTest: Test (0.28s)

      Rendered output:
      [exec]
      Api Tests (329)
      --------------------------------------------
      [exec] Testing api
      Followed by Stack trace exception:

      java.lang.IndexOutOfBoundsException
      	at hudson.MarkupText.rangeCheck(MarkupText.java:276)
      	at hudson.MarkupText.addMarkup(MarkupText.java:270)
      	at hudson.plugins.ansicolor.ColorConsoleAnnotator$1EmitterImpl.emitHtml(ColorConsoleAnnotator.java:74)
      	at hudson.plugins.ansicolor.AnsiAttributeElement.emitClose(AnsiAttributeElement.java:42)
      	at hudson.plugins.ansicolor.AnsiHtmlOutputStream.closeTagOfType(AnsiHtmlOutputStream.java:150)
      	at hudson.plugins.ansicolor.AnsiHtmlOutputStream.setForegroundColor(AnsiHtmlOutputStream.java:335)
      	at hudson.plugins.ansicolor.AnsiHtmlOutputStream.processDefaultTextColor(AnsiHtmlOutputStream.java:589)
      	at hudson.plugins.ansicolor.AnsiOutputStream.processEscapeCommand(AnsiOutputStream.java:352)
      	at hudson.plugins.ansicolor.AnsiOutputStream.write(AnsiOutputStream.java:138)
      	at hudson.plugins.ansicolor.AnsiHtmlOutputStream.write(AnsiHtmlOutputStream.java:220)
      ....
      

      Whole stack trace in attachment.

       

      Example text that causes issue with disabled plugin:

      ✔ omeTest: Test (11.15s)

            Unassigned Unassigned
            dukecz Michal Kruzik
            Votes:
            13 Vote for this issue
            Watchers:
            21 Start watching this issue

              Created:
              Updated:
              Resolved: