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

Renaming a capability breaks task configurations

    XMLWordPrintable

Details

    Description

      Summary

      Renaming capability label will break task that are configured to use the old label name

      Steps to Reproduce

      1. Create a new Executable Command
      2. Set a Command task to use this executable
      3. Rename this Executable capability at Administration >> Build Resources >> Executable
      4. Run the build in Step 2

      Expected Results

      The build will run successfully

      Actual Results

      The build failed with the following exception in the build or remote agent log atlassian-bamboo.log file:

      2015-09-18 15:47:51,325 ERROR [0-BAM::data054.vm.cfm.fr::Agent:pool-3-thread-1] [TaskExecutorImpl] Error occurred while running Task 'Install package(3)' of type com.atlassian.bamboo.plugins.scripttask:task.builder.command.
      com.atlassian.bamboo.task.TaskException: Failed to execute task
      	at com.atlassian.bamboo.plugins.shell.task.AbstractShellBuildTask.execute(AbstractShellBuildTask.java:84)
      	at com.atlassian.bamboo.plugins.shell.task.AbstractShellBuildTask.execute(AbstractShellBuildTask.java:48)
      	at com.atlassian.bamboo.task.TaskExecutorImpl$3.call(TaskExecutorImpl.java:281)
      	at com.atlassian.bamboo.task.TaskExecutorImpl$3.call(TaskExecutorImpl.java:278)
      	at com.atlassian.bamboo.task.TaskExecutorImpl.executeTaskWithPrePostActions(TaskExecutorImpl.java:198)
      	at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:278)
      	at com.atlassian.bamboo.task.TaskExecutorImpl.execute(TaskExecutorImpl.java:105)
      	at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:75)
      	at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:188)
      	at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:112)
      	at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:110)
      	at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:49)
      	at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:31)
      	at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:20)
      	at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:52)
      	at java.lang.Thread.run(Unknown Source)
      Caused by: java.lang.NullPointerException
      	at java.util.regex.Matcher.getTextLength(Unknown Source)
      	at java.util.regex.Matcher.reset(Unknown Source)
      	at java.util.regex.Matcher.<init>(Unknown Source)
      	at java.util.regex.Pattern.matcher(Unknown Source)
      	at com.atlassian.bamboo.util.BambooStringUtils$3.apply(BambooStringUtils.java:516)
      	at com.atlassian.bamboo.util.BambooStringUtils$3.apply(BambooStringUtils.java:509)
      	at com.google.common.collect.Lists$TransformingRandomAccessList.get(Lists.java:451)
      	at java.util.AbstractList$Itr.next(Unknown Source)
      	at java.util.AbstractCollection.toArray(Unknown Source)
      	at java.util.LinkedList.addAll(Unknown Source)
      	at java.util.LinkedList.addAll(Unknown Source)
      	at com.atlassian.bamboo.process.ExternalProcessBuilder.command(ExternalProcessBuilder.java:60)
      	at com.atlassian.bamboo.process.ProcessServiceImpl.createExternalProcess(ProcessServiceImpl.java:167)
      	at com.atlassian.bamboo.process.ProcessServiceImpl.executeExternalProcess(ProcessServiceImpl.java:209)
      	at com.atlassian.bamboo.plugins.shell.task.AbstractShellBuildTask.execute(AbstractShellBuildTask.java:61)
      

      The following error is also thrown when tasks are still trying to use the previous capability name.

      2017-05-23 10:41:21,861 ERROR [16-BAM::Local Shared Agent 1::Agent:pool-31-thread-1] [TaskExecutorImpl] Error occurred while running Task 'build ' of type com.atlassian.bamboo.plugins.maven:task.builder.mvn3.
      java.lang.NullPointerException: Path is not defined for [system.builder.mvn3.Maven]
      

      Problem has also presented as follows in the build log for NAnt tasks:

      error	22-Dec-2016 11:44:28	Error occurred while running Task '(2)' of type com.atlassian.bamboo.plugin.dotnet:nant.
      error	22-Dec-2016 11:44:28	java.lang.NullPointerException: Capability
      error	22-Dec-2016 11:44:28		at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:226)
      error	22-Dec-2016 11:44:28		at com.atlassian.bamboo.plugin.dotnet.nant.NantTaskType.getExecutableFile(NantTaskType.java:152)
      

      Notes

      Task configurations treat that label as a key and fail after rename.

      Workaround

      1. Try to re-save the task configuration with the correct executable selected, if this doesn't work then:
      2. Delete and re-create the task configuration

      or

      1. Search for the Build Plan Task that is using the old name with the following SQL query:
        select b.FULL_KEY from BUILD_DEFINITION bd JOIN BUILD b ON bd.BUILD_ID=b.BUILD_ID WHERE XML_DEFINITION_DATA LIKE '%<old_label>%';
        

        FULL_KEY is <project_key>- <plan_key>-<job_key>

      2. Access the configuration of this plan with the URL http://<bamboo.url>:<port>/<context>/build/admin/edit/editBuildTasks.action?buildKey=<FULL_KEY>
      3. Edit the Task to set it to use the new label
      4. Save the setting
      5. For Development Task, use the following SQL query:
        select dp.NAME,de.NAME from DEPLOYMENT_ENVIRONMENT de JOIN deployment_project dp ON dp.DEPLOYMENT_PROJECT_ID=de.PACKAGE_DEFINITION_ID WHERE de.XML_DEFINITION_DATA LIKE '%<old_label>%';
        

      Attachments

        Issue Links

          Activity

            People

              mgardias Marcin Gardias
              pbruski Przemek Bruski
              Votes:
              11 Vote for this issue
              Watchers:
              23 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: