0
votes

I have had a set of Bamboo plans running for quite awhile but this morning Bamboo has decided to start throwing an exception when running them. The instance of Bamboo is on Linux but the plans themselves are ran from a remote agent running Windows. Specifically these are plans set to build .net framework mvc applications.

The plans fail at different tasks but both with the same error. The error below fails while trying to restore nuget packages but another plan fails while attempting to run a copy command. Running the nuget restore outside of Bamboo runs correctly.

I have tried cloning the plan and also reinstalled the remote agent but neither fixed the issue.

Error occurred while running Task 'Nuget(8)' of type com.atlassian.bamboo.plugins.scripttask:task.builder.command.
error   12-Aug-2020 09:40:17    com.atlassian.bamboo.task.TaskException: Failed to execute task
error   12-Aug-2020 09:40:17        at com.atlassian.bamboo.plugins.shell.task.AbstractShellBuildTask.execute(AbstractShellBuildTask.java:65)
error   12-Aug-2020 09:40:17        at com.atlassian.bamboo.plugins.shell.task.AbstractShellBuildTask.execute(AbstractShellBuildTask.java:39)
error   12-Aug-2020 09:40:17        at com.atlassian.bamboo.task.TaskExecutorImpl.lambda$executeTasks$3(TaskExecutorImpl.java:288)
error   12-Aug-2020 09:40:17        at com.atlassian.bamboo.task.TaskExecutorImpl.executeTaskWithPrePostActions(TaskExecutorImpl.java:221)
error   12-Aug-2020 09:40:17        at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:288)
error   12-Aug-2020 09:40:17        at com.atlassian.bamboo.task.TaskExecutorImpl.execute(TaskExecutorImpl.java:110)
error   12-Aug-2020 09:40:17        at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:71)
error   12-Aug-2020 09:40:17        at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.executeBuildPhase(DefaultBuildAgent.java:203)
error   12-Aug-2020 09:40:17        at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:175)
error   12-Aug-2020 09:40:17        at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.lambda$waitAndPerformBuild$0(BuildAgentControllerImpl.java:122)
error   12-Aug-2020 09:40:17        at com.atlassian.bamboo.variable.CustomVariableContextImpl.withVariableSubstitutor(CustomVariableContextImpl.java:185)
error   12-Aug-2020 09:40:17        at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:117)
error   12-Aug-2020 09:40:17        at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:126)
error   12-Aug-2020 09:40:17        at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:48)
error   12-Aug-2020 09:40:17        at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:26)
error   12-Aug-2020 09:40:17        at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:17)
error   12-Aug-2020 09:40:17        at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:41)
error   12-Aug-2020 09:40:17        at java.lang.Thread.run(Thread.java:748)
error   12-Aug-2020 09:40:17    Caused by: java.lang.NullPointerException
error   12-Aug-2020 09:40:17        at com.atlassian.bamboo.process.ExternalProcessBuilder.lambda$env$0(ExternalProcessBuilder.java:78)
error   12-Aug-2020 09:40:17        at com.google.common.base.Predicates$CompositionPredicate.apply(Predicates.java:552)
error   12-Aug-2020 09:40:17        at com.google.common.collect.Iterators$7.computeNext(Iterators.java:652)
error   12-Aug-2020 09:40:17        at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)
error   12-Aug-2020 09:40:17        at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)
error   12-Aug-2020 09:40:17        at com.google.common.collect.Iterators.size(Iterators.java:191)
error   12-Aug-2020 09:40:17        at com.google.common.collect.Collections2$FilteredCollection.size(Collections2.java:211)
error   12-Aug-2020 09:40:17        at java.util.AbstractMap.size(AbstractMap.java:85)
error   12-Aug-2020 09:40:17        at java.util.HashMap.putMapEntries(HashMap.java:501)
error   12-Aug-2020 09:40:17        at java.util.HashMap.putAll(HashMap.java:785)
error   12-Aug-2020 09:40:17        at com.atlassian.bamboo.process.ExternalProcessBuilder.env(ExternalProcessBuilder.java:78)
error   12-Aug-2020 09:40:17        at com.atlassian.bamboo.process.ProcessServiceImpl.createExternalProcess(ProcessServiceImpl.java:144)
error   12-Aug-2020 09:40:17        at com.atlassian.bamboo.process.ProcessServiceImpl.executeExternalProcess(ProcessServiceImpl.java:195)
error   12-Aug-2020 09:40:17        at com.atlassian.bamboo.process.ProcessServiceImpl.executeExternalProcess(ProcessServiceImpl.java:210)
error   12-Aug-2020 09:40:17        at com.atlassian.bamboo.plugins.shell.task.AbstractShellBuildTask.execute(AbstractShellBuildTask.java:48)
error   12-Aug-2020 09:40:17        ... 17 more
1

1 Answers

0
votes

I talked with Atlassian support and they helped me work through the issue. I had setup the remote agent as a windows service which was causing the problems. I removed the service and started the remote agent via the BambooAgent.bat script. Mine was located at %InstallDirectory%/bin/BambooAgent.bat