Don't log full stack trace when build logs are not found during initial viewChainLog and viewBuildLogs

XMLWordPrintable

      Bamboo currently logs full stack traces if a build log is not found when accessing Chain results for viewChainLog and viewBuildLogs actions.

      During the initial steps of a Plan run, the logs files are not available. If a user tries to follow the logs right after starting a build, error messages similar to the one below are shown in the Bamboo logs until the Agent begins to transmit build logs to Bamboo.

      2024-07-11 00:04:50,422 ERROR [https-jsse-nio-45962-exec-29 url: /browse/BAM-BOO-13/log, /chain/result/viewChainLog.action; user: bamboo] [ViewChainLogs] Failed to load build logs for build BAM-BOO-13
      java.nio.file.NoSuchFileException: /var/atlassian/application-data/bamboo/shared/builds/plan-1114113-JOB1/download-data/build_logs/plan-1114113-JOB1-13.log
      	at sun.nio.fs.UnixException.translateToIOException(UnixException.java:92) ~[?:?]
      	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106) ~[?:?]
      	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111) ~[?:?]
      	at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:218) ~[?:?]
      	at java.nio.file.Files.newByteChannel(Files.java:380) ~[?:?]
      	at java.nio.file.Files.newByteChannel(Files.java:432) ~[?:?]
      	at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:422) ~[?:?]
      	at java.nio.file.Files.newInputStream(Files.java:160) ~[?:?]
      	at org.apache.commons.io.FileUtils.lineIterator(FileUtils.java:2154) ~[commons-io-2.15.1.jar:2.15.1]

      Please suppress the stack trace and print only the Java Exception message (e.getMessage()) when the file is not found. Print the stack trace when DEBUG is enabled.

              Assignee:
              Eduardo Alvarenga (Inactive)
              Reporter:
              Eduardo Alvarenga (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: