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

consoleText stops updating at 5000 lines until end of build job

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • Windows 7

      I found that the consoleText stops updating once a build command's output reaches 5000 lines. It doesn't update until the end of the build job, and then the rest of the lines are updated in consoleText. The consoleFull continues to update as expected, beyond the 5000 lines, even as the consoleText is not being updated.

      I have a client process which monitors the output of consoleText for changes on a build job. It stops updating at 5000 lines, then when the job completes, the rest of the build output can be found in consoleText. This gives the appearance of a stalled build job.

          [JENKINS-14899] consoleText stops updating at 5000 lines until end of build job

          David Baird created issue -
          David Baird made changes -
          Assignee New: Alan Harder [ mindless ]
          Alan Harder made changes -
          Assignee Original: Alan Harder [ mindless ]

          David Baird added a comment -

          According to http://stackoverflow.com/questions/13388217/jenkins-plain-text-console-output-not-in-real-time: "That is because output is truncated by default around 5k lines, so the full text will always pull the last 5k while the build is in progress, similar to the way the HTML view will only show about 5k lines until you click the "Show Full Output" button.

          Once the build completes, the full output gets dumped to plain text, so the entire output is shown"

          Please add a feature to pull the last 5k, not always show the first 5k.

          David Baird added a comment - According to http://stackoverflow.com/questions/13388217/jenkins-plain-text-console-output-not-in-real-time: "That is because output is truncated by default around 5k lines, so the full text will always pull the last 5k while the build is in progress, similar to the way the HTML view will only show about 5k lines until you click the "Show Full Output" button. Once the build completes, the full output gets dumped to plain text, so the entire output is shown" Please add a feature to pull the last 5k, not always show the first 5k.

          Ben Nied added a comment -

          Is there currently any way around this limit that doesn't require scraping the HTML view?

          Ben Nied added a comment - Is there currently any way around this limit that doesn't require scraping the HTML view?

          Daniel Beck added a comment -

          Daniel Beck added a comment - Source of this issue: https://github.com/stapler/stapler/blob/master/core/src/main/java/org/kohsuke/stapler/framework/io/LargeText.java#L547
          Daniel Beck made changes -
          Assignee New: Daniel Beck [ danielbeck ]
          Daniel Beck made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Daniel Beck made changes -
          Remote Link New: This issue links to "PR 1733 (Web Link)" [ 12935 ]

          David Baird added a comment - - edited

          My current solution in Python is something like...
          {{
          while True:
          try:
          page = readpage(text_url, data='start=%s' % text_offset)
          except:
          sys.stderr.write('\nStopping build')
          readpage(build_url + '/stop')
          raise
          time.sleep(0.1)
          if page['error'] in _HTTP_ERROR_IGNORE_LIST:
          continue
          if page['text']:
          sys.stdout.write(page['text'])
          text_offset = page['header'].get('x-text-size')
          if text_offset and 'true' != page['header'].get('x-more-data'):
          break
          }}

          David Baird added a comment - - edited My current solution in Python is something like... {{ while True: try: page = readpage(text_url, data='start=%s' % text_offset) except: sys.stderr.write('\nStopping build') readpage(build_url + '/stop') raise time.sleep(0.1) if page ['error'] in _HTTP_ERROR_IGNORE_LIST: continue if page ['text'] : sys.stdout.write(page ['text'] ) text_offset = page ['header'] .get('x-text-size') if text_offset and 'true' != page ['header'] .get('x-more-data'): break }}

            danielbeck Daniel Beck
            davidlbaird David Baird
            Votes:
            4 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: