Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-4069

Bamboo is still reporting false positives with SUCCESS_MESSAGE_LINES = 3000

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • 2.3
    • 2.0.5
    • Builds

          [BAM-4069] Bamboo is still reporting false positives with SUCCESS_MESSAGE_LINES = 3000

          My comment copied from BSP-1916:

          The problem is in the Windows shell. Take this piece of code:

          @echo off
          if "%OS%"=="Windows_NT" color 00
          

          When executed it displays the following behaviour:

          C:\work\BAM-4069>a.bat || echo Exit code not OK
          Exit code not OK
          C:\work\BAM-4069>color 07
          
          C:\work\BAM-4069>echo %ERRORLEVEL%
          0
          
          C:\work\BAM-4069>a.bat
          
          C:\work\BAM-4069>echo %ERRORLEVEL%
          1
          

          Once the code is changed to this:

          @echo off
          if "%OS%"=="Windows_NT" color 00
          goto omega
          :omega
          

          output is different:

          C:\work\BAM-4069>a.bat || echo Exit code not OK
          
          C:\work\BAM-4069>color 07
          
          C:\work\BAM-4069>echo %ERRORLEVEL%
          0
          
          C:\work\BAM-4069>a.bat
          
          C:\work\BAM-4069>echo %ERRORLEVEL%
          1
          

          Windows shell does no longer recognize the non-zero exit code probably as the last command executed was "goto" which was executed successfully. However when you call the script using call command it works as expected.

          C:\work\BAM-4069>call a.bat || echo Exit code not OK
          Exit code not OK
          C:\work\BAM-4069>color 07
          
          C:\work\BAM-4069>echo %ERRORLEVEL%
          0
          
          C:\work\BAM-4069>call a.bat
          
          C:\work\BAM-4069>echo %ERRORLEVEL%
          1
          

          It looks like this is the solution to be implemented in Bamboo.

          Krystian Brazulewicz added a comment - My comment copied from BSP-1916: The problem is in the Windows shell. Take this piece of code: @echo off if "%OS%"=="Windows_NT" color 00 When executed it displays the following behaviour: C:\work\BAM-4069>a.bat || echo Exit code not OK Exit code not OK C:\work\BAM-4069>color 07 C:\work\BAM-4069>echo %ERRORLEVEL% 0 C:\work\BAM-4069>a.bat C:\work\BAM-4069>echo %ERRORLEVEL% 1 Once the code is changed to this: @echo off if "%OS%"=="Windows_NT" color 00 goto omega :omega output is different: C:\work\BAM-4069>a.bat || echo Exit code not OK C:\work\BAM-4069>color 07 C:\work\BAM-4069>echo %ERRORLEVEL% 0 C:\work\BAM-4069>a.bat C:\work\BAM-4069>echo %ERRORLEVEL% 1 Windows shell does no longer recognize the non-zero exit code probably as the last command executed was "goto" which was executed successfully. However when you call the script using call command it works as expected. C:\work\BAM-4069>call a.bat || echo Exit code not OK Exit code not OK C:\work\BAM-4069>color 07 C:\work\BAM-4069>echo %ERRORLEVEL% 0 C:\work\BAM-4069>call a.bat C:\work\BAM-4069>echo %ERRORLEVEL% 1 It looks like this is the solution to be implemented in Bamboo.

          the build log is

          build 18-juin-2009 15:10:45 Buildfile: build.xml
          build 18-juin-2009 15:10:45
          build 18-juin-2009 15:10:45 test:
          build 18-juin-2009 15:10:45 [echo] BUILD SUCCESSFUL
          error 18-juin-2009 15:10:45
          error 18-juin-2009 15:10:45 BUILD FAILED
          error 18-juin-2009 15:10:45 C:\OAMS\Data\Bamboo\xml-data\build-dir\TEST-SIMPLE\build.xml:4: No message
          error 18-juin-2009 15:10:45
          error 18-juin-2009 15:10:45 Total time: 0 seconds
          simple 18-juin-2009 15:10:45 Build process for 'Test - Simple' returned with return code = 0

          the code is

          if (line != null && line.contains(textToSearchFor))
          {
          if (line.startsWith("error")) // do not search error messages
          {
          continue;
          }
          return BuildLogUtils.convertToLogEntry(line);
          }

          Ulrich Kuhnhardt [Atlassian] added a comment - the build log is build 18-juin-2009 15:10:45 Buildfile: build.xml build 18-juin-2009 15:10:45 build 18-juin-2009 15:10:45 test: build 18-juin-2009 15:10:45 [echo] BUILD SUCCESSFUL error 18-juin-2009 15:10:45 error 18-juin-2009 15:10:45 BUILD FAILED error 18-juin-2009 15:10:45 C:\OAMS\Data\Bamboo\xml-data\build-dir\TEST-SIMPLE\build.xml:4: No message error 18-juin-2009 15:10:45 error 18-juin-2009 15:10:45 Total time: 0 seconds simple 18-juin-2009 15:10:45 Build process for 'Test - Simple' returned with return code = 0 the code is if (line != null && line.contains(textToSearchFor)) { if (line.startsWith(" error ")) // do not search error messages { continue; } return BuildLogUtils.convertToLogEntry(line); }

          Scott,

          I'll be dealing with the problem you have reported. Can you please attach to this issue:

          • Bamboo logs (atlassian-bamboo.log), I'm particurarly interested in part starting with:

          2009-06-16 16:52:32,116 INFO [BAM::Local agent::Agent] [AbstractBuilder] Build process for 'SOME-PLAN Main' returned with return code = 0

          • complete build log (if that's possible)
          • dump of the environment variables for the account used to run Bamboo?

          Cheers,
          Krystian

          Krystian Brazulewicz added a comment - Scott, I'll be dealing with the problem you have reported. Can you please attach to this issue: Bamboo logs (atlassian-bamboo.log), I'm particurarly interested in part starting with: 2009-06-16 16:52:32,116 INFO [BAM::Local agent::Agent] [AbstractBuilder] Build process for 'SOME-PLAN Main' returned with return code = 0 complete build log (if that's possible) dump of the environment variables for the account used to run Bamboo? Cheers, Krystian

          MarkC added a comment -

          Scott,

          I've cloned BAM-2835 here.

          The changes for BAM-2835 is in 2.2 and should respect the 3000 lookup. Can you please attach the the log for the build that give you the false positive? We can make this issue private if you need.

          Cheers,

          Mark C

          MarkC added a comment - Scott, I've cloned BAM-2835 here. The changes for BAM-2835 is in 2.2 and should respect the 3000 lookup. Can you please attach the the log for the build that give you the false positive? We can make this issue private if you need. Cheers, Mark C

            kbrazulewicz Krystian Brazulewicz
            9d56656763ef Scott Marshall
            Affected customers:
            0 This affects my team
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 9h
                9h