I am facing java.lang.NullPointerException exception while coping artifact through SCP task
Asked by Suvankar Dey:

```
Starting task 'Copy Artifact to NP2 QAPROD' of type 'com.atlassian.bamboo.plugins.bamboo-scp-plugin:scptask'simple	19-Mar-2018 03:33:10	Connecting to dkdl6351.dcsgomni.com on port: 22error	19-Mar-2018 03:33:10	Error occurred while running Task 'Copy Artifact to NP2 QAPROD(3)' of type com.atlassian.bamboo.plugins.bamboo-scp-plugin:scptask.error	19-Mar-2018 03:33:10	java.lang.NullPointerExceptionerror	19-Mar-2018 03:33:10		at com.atlassian.bamboo.plugins.scp.SSHKeyProvider.<init>(SSHKeyProvider.java:26)error	19-Mar-2018 03:33:10		at com.atlassian.bamboo.plugins.scp.ScpTask.execute(ScpTask.java:257)error	19-Mar-2018 03:33:10		at com.atlassian.bamboo.plugins.scp.ScpTask.run(ScpTask.java:120)error	19-Mar-2018 03:33:10		at com.atlassian.bamboo.plugins.scp.ScpTask.execute(ScpTask.java:106)error	19-Mar-2018 03:33:10		at com.atlassian.bamboo.task.TaskExecutorImpl.lambda$executeTasks$1(TaskExecutorImpl.java:281)error	19-Mar-2018 03:33:10		at com.atlassian.bamboo.task.TaskExecutorImpl.executeTaskWithPrePostActions(TaskExecutorImpl.java:224)error	19-Mar-2018 03:33:10		at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:281)error	19-Mar-2018 03:33:10		at com.atlassian.bamboo.task.TaskExecutorImpl.execute(TaskExecutorImpl.java:112)error	19-Mar-2018 03:33:10		at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:71)error	19-Mar-2018 03:33:10		at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.executeBuildPhase(DefaultBuildAgent.java:203)error	19-Mar-2018 03:33:10		at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:175)error	19-Mar-2018 03:33:10		at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.lambda$waitAndPerformBuild$0(BuildAgentControllerImpl.java:122)error	19-Mar-2018 03:33:10		at com.atlassian.bamboo.variable.CustomVariableContextImpl.withVariableSubstitutor(CustomVariableContextImpl.java:185)error	19-Mar-2018 03:33:10		at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:117)error	19-Mar-2018 03:33:10		at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:126)error	19-Mar-2018 03:33:10		at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:48)error	19-Mar-2018 03:33:10		at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:26)error	19-Mar-2018 03:33:10		at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:17)error	19-Mar-2018 03:33:10		at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:41)error	19-Mar-2018 03:33:10		at java.lang.Thread.run(Thread.java:748)simple	19-Mar-2018 03:33:10	Finalising the build...simple	19-Mar-2018 03:33:10	Stopping timer.
```


Answers:
author: Alexey Chystoprudov
body: It looks like <https://jira.atlassian.com/browse/BAM-19712>, which is fixed in next minor release planned for this week


author: Suvankar Dey
body: Thanks everyone . I got the solution, there was some problem with private keys. Now its fine


author: Charlie Misonne
body: Did your plan move to another project recently? Or was it cloned from another one?

I encountered this behavior in the past. The solution was to delete every task related to the artifacts (artifact definition, artifact download, scp task) and recreate them.

See this bug report as well <https://jira.atlassian.com/browse/BAM-15033>

comments: author: Suvankar Dey
body: ![WithoutUncheckOption.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/17366iC614B2E0FDA3DD68/image-size/large?v=v2&px=999 "WithoutUncheckOption.PNG")![WithUncheckOption.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/17367iB4BBE3051500A534/image-size/large?v=v2&px=999 "WithUncheckOption.PNG")No, Plan is not moved to another project and there is no clone. Manually i have created this.   
Problem is that whenever I am selecting "Use SSH custom key" option under Authentication type, its asking to browse and upload keys without any uncheck option.