Description
Issue Summary
MSBuild task type is failing with NullPointerException when created via specs code in Bamboo, build logs is showing exception > java.lang.NullPointerException: Options
Steps to Reproduce
1) Create a YAML specs repository in Bamboo.
2) Put the following code in the Bitbucket repository and scan the repository in Bamboo so that plan is created.
Default Job: key: JOB1 other: all-other-apps: custom: auto: {} buildHangingConfig.enabled: 'false' tasks: - checkout: force-clean-build: 'false' - any-task: plugin-key: com.atlassian.bamboo.plugin.dotnet:msbuild configuration: solution: YourSolution.sln label: MSBUILD
This code includes only the Job section of the YAML file.
3) Plan will be created in Bamboo with following two task.
- Source code checkout task
- MSBuild Task
4) Run the plan in Bamboo.
Expected Results
The plan should run successfully.
Actual Results
The build plan fails and following exception is seen in the build logs.
simple 22-Dec-2022 07:37:02 Starting task 'MSBuild' of type 'com.atlassian.bamboo.plugin.dotnet:msbuild' error 22-Dec-2022 07:37:02 Error occurred while running Task '(2)' of type com.atlassian.bamboo.plugin.dotnet:msbuild. error 22-Dec-2022 07:37:02 java.lang.NullPointerException: Options error 22-Dec-2022 07:37:02 at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:907) error 22-Dec-2022 07:37:02 at com.atlassian.bamboo.plugin.dotnet.msbuild.MsBuildConfig.build(MsBuildConfig.java:64) error 22-Dec-2022 07:37:02 at com.atlassian.bamboo.plugin.dotnet.msbuild.MsBuildTaskType.execute(MsBuildTaskType.java:67) error 22-Dec-2022 07:37:02 at com.atlassian.bamboo.task.TaskExecutorImpl.lambda$executeTasks$3(TaskExecutorImpl.java:323) error 22-Dec-2022 07:37:02 at com.atlassian.bamboo.task.TaskExecutorImpl.executeTaskWithPrePostActions(TaskExecutorImpl.java:258) error 22-Dec-2022 07:37:02 at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:323) error 22-Dec-2022 07:37:02 at com.atlassian.bamboo.task.TaskExecutorImpl.execute(TaskExecutorImpl.java:118) error 22-Dec-2022 07:37:02 at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:73) error 22-Dec-2022 07:37:02 at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.executeBuildPhase(DefaultBuildAgent.java:205) error 22-Dec-2022 07:37:02 at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:177) error 22-Dec-2022 07:37:02 at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.lambda$waitAndPerformBuild$0(BuildAgentControllerImpl.java:169) error 22-Dec-2022 07:37:02 at com.atlassian.bamboo.variable.CustomVariableContextImpl.withVariableSubstitutor(CustomVariableContextImpl.java:118) error 22-Dec-2022 07:37:02 at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:162) error 22-Dec-2022 07:37:02 at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.lambda$start$0(DefaultBuildAgent.java:122) error 22-Dec-2022 07:37:02 at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:48) error 22-Dec-2022 07:37:02 at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:26) error 22-Dec-2022 07:37:02 at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:17) error 22-Dec-2022 07:37:02 at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:41) error 22-Dec-2022 07:37:02 at java.base/java.lang.Thread.run(Thread.java:829)
Workaround
The workaround is to not use this task via specs, If this task and the plan is created via Bamboo GUI, it works.
Attachments
Issue Links
- mentioned in
-
Page Loading...