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

HTTP error 504 is seen when trying to view the buildresultsummary page for few build results post upgrading to Bamboo 10.0 or 10.1.0

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Low Low
    • 10.1.1
    • 10.0.0, 10.1.0
    • Builds
    • None

      Issue Summary

      HTTP error 504 is seen when trying to do anyone of the below 2 tasks

      1. Trying to view the buildresultsummary page for few builds of a specific plan
      2. Trying to view the Recent Build section on the Build activity page

      Steps to Reproduce

      1. Upgrade to Bamboo version 10.0.x or 10.1.x
      2. Run a recent build for a plan
      3. Try to view the build results for that run

      Expected Results

      The builds results should be visible

      Actual Results

      1. The page times out with HTTP 504 exception

      2. We can see the below call made when the page is accessed, please make a note of the thread http-nio-8085-exec-418

      2024-12-11 15:16:16,684 INFO [http-nio-8085-exec-418] [AccessLogFilter] 10.132.105.171, 10.154.113.60 P837754 GET https://bamboo_url/chain/result/viewChainResult.action?planKey=ABC-XYZ&buildNumber=10 1350652kb
      

      2) If we look at the catalina.out file we can see the below error

      11-Dec-2024 15:17:17.792 WARNING [Catalina-utility-1] org.apache.catalina.valves.StuckThreadDetectionValve.notifyStuckThreadDetected Thread [http-nio-8085-exec-418] (id=[72708]) has been active for [61,113] milliseconds (since [12/11/24, 3:16 PM]) to serve the same request for [https://bamboo_url/browse/ABC-XYZ-10] and may be stuck (configured threshold for this StuckThreadDetectionValve is [60] seconds). There is/are [11] thread(s) in total that are monitored by this Valve and may be stuck.
      	java.lang.Throwable
      		at java.base@17.0.13/sun.security.provider.NativePRNG$RandomIO.implNextBytes(NativePRNG.java:552)
      		at java.base@17.0.13/sun.security.provider.NativePRNG$Blocking.engineNextBytes(NativePRNG.java:273)
      		at java.base@17.0.13/java.security.SecureRandom.nextBytes(SecureRandom.java:758)
      		at org.apache.commons.lang3.CachedRandomBits.<init>(CachedRandomBits.java:67)
      		at org.apache.commons.lang3.RandomStringUtils.random(RandomStringUtils.java:304)
      		at org.apache.commons.lang3.RandomStringUtils.random(RandomStringUtils.java:263)
      		at org.apache.commons.lang3.RandomStringUtils.next(RandomStringUtils.java:668)
      		at org.apache.commons.lang3.RandomStringUtils.random(RandomStringUtils.java:165)
      		at org.apache.commons.lang3.RandomStringUtils.next(RandomStringUtils.java:628)
      		at org.apache.commons.lang3.RandomStringUtils.random(RandomStringUtils.java:129)
      		at org.apache.commons.lang3.RandomStringUtils.nextAlphanumeric(RandomStringUtils.java:759)
      		at org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric(RandomStringUtils.java:412)
      		at com.atlassian.bamboo.ww2.FreemarkerContext.getRandomString(FreemarkerContext.java:355)
      		at jdk.internal.reflect.GeneratedMethodAccessor2820.invoke(Unknown Source)
      

       
      3) If we look at the thread dumps we can see this thread is blocked at NativePRNG.java:552

      "http-nio-8085-exec-418" daemon prio=5 tid=0x0000000000011c04 nid=0 waiting for monitor entry 
         java.lang.Thread.State: BLOCKED (on object monitor)
      	at java.base@17.0.13/sun.security.provider.NativePRNG$RandomIO.implNextBytes(NativePRNG.java:552)
      	- waiting to lock <0x00000000586eabf6> (a java.lang.Object)
      	 owned by http-nio-8085-exec-419 id=0x0000000000011c23
      	at java.base@17.0.13/sun.security.provider.NativePRNG$Blocking.engineNextBytes(NativePRNG.java:273)
      	at java.base@17.0.13/java.security.SecureRandom.nextBytes(SecureRandom.java:758)
      	at org.apache.commons.lang3.CachedRandomBits.<init>(CachedRandomBits.java:67)
      	at org.apache.commons.lang3.RandomStringUtils.random(RandomStringUtils.java:304)
      	at org.apache.commons.lang3.RandomStringUtils.random(RandomStringUtils.java:263)
      	at org.apache.commons.lang3.RandomStringUtils.next(RandomStringUtils.java:668)
      	at org.apache.commons.lang3.RandomStringUtils.random(RandomStringUtils.java:165)
      	at org.apache.commons.lang3.RandomStringUtils.next(RandomStringUtils.java:628)
      	at org.apache.commons.lang3.RandomStringUtils.random(RandomStringUtils.java:129)
      	at org.apache.commons.lang3.RandomStringUtils.nextAlphanumeric(RandomStringUtils.java:759)
      	at org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric(RandomStringUtils.java:412)
      	at com.atlassian.bamboo.ww2.FreemarkerContext.getRandomString(FreemarkerContext.java:355)

      4) This issue seems to be because of the following bug in the Apache Commons Lang library: LANG-1748 RandomStringUtils.random() drains the systems entropy pool and blocks which affects versions 3.15 and 3.16 of Apache Common Lang3

      5) Bamboo 10.1 are using the affected version currently. 9.6.x LTS is unaffected as it's using version 3.14 hence you didn't see the error in Bamboo 9.6.8 version.

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available.

          Form Name

            [BAM-25968] HTTP error 504 is seen when trying to view the buildresultsummary page for few build results post upgrading to Bamboo 10.0 or 10.1.0

            There are no comments yet on this issue.

              Unassigned Unassigned
              4f38d6bf51c0 Shashank Kumar
              Affected customers:
              0 This affects my team
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: