hasResultKeyReadPermission() throws IllegalArgumentException on agent page

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Low
    • 12.1.3
    • Affects Version/s: 12.1.2
    • Component/s: Deployments
    • None
    • 1
    • Severity 2 - Major
    • 1

      Issue Summary

      If the Deploymentstate is not recovered, if we stop the deployment in progress and after restart, it throws the below error, because it can't read the deployment result key:

      ERROR Error executing FreeMarker template
      freemarker.core._TemplateModelException: Java method
        "com.atlassian.bamboo.ww2.BambooActionSupport.hasResultKeyReadPermission(com.atlassian.bamboo.ResultKey)"
        threw an exception
      Failed at: #return action.hasResultKeyReadPermis...
        [in template "freemarker-lib/functions.ftl" at line 12]
        called from "agent/commonAgentFunctions.ftl" macro "onlineAgents" at line 570
      Caused by: java.lang.IllegalArgumentException: Not a deployment key
        at com.atlassian.bamboo.deployments.DeploymentKeys.getEnvironmentIdFromKey(DeploymentKeys.java:28)
        at com.atlassian.bamboo.ww2.BambooActionSupport.hasResultKeyReadPermission(BambooActionSupport.java:357)
      

      Steps to Reproduce

      1. An agent has a DEPLOYMENT in progress
      2. Restart Bamboo
      3. Open /admin/agent/viewAgents.action

      Expected Results

      The deployment key should be returned for the recovered deployment build

      Actual Results

      The below exception is thrown in the atlassian-bamboo.log file:

      ERROR Error executing FreeMarker template
      freemarker.core._TemplateModelException: Java method
        "com.atlassian.bamboo.ww2.BambooActionSupport.hasResultKeyReadPermission(com.atlassian.bamboo.ResultKey)"
        threw an exception
      Failed at: #return action.hasResultKeyReadPermis...
        [in template "freemarker-lib/functions.ftl" at line 12]
        called from "agent/commonAgentFunctions.ftl" macro "onlineAgents" at line 570
      Caused by: java.lang.IllegalArgumentException: Not a deployment key
        at com.atlassian.bamboo.deployments.DeploymentKeys.getEnvironmentIdFromKey(DeploymentKeys.java:28)
        at com.atlassian.bamboo.ww2.BambooActionSupport.hasResultKeyReadPermission(BambooActionSupport.java:357)
      

      Workaround

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

              Assignee:
              Mateusz Szmal
              Reporter:
              Jyothi Charupalli
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: