Bamboo SCP task fails with "java.lang.NullPointerException" error when uploading a shared artifact

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible



When using the Bamboo SCP task to upload a shared artifact from Bamboo directly to a remote server, the task fails a "java.lang.NullPointerException" error that is shown on the build log.


Bamboo Server or Data Center


  1. Add a SCP task to your plan and select a shared artifact as your file to be transferred
  2. Run your plan
  3. In your build logs you can find the below error and stack trace:

    simple	08-Jul-2021 14:04:02	Starting task 'Publish Release Notes' of type 'com.atlassian.********.plugins.********-scp-plugin:scptask'
    error	08-Jul-2021 14:04:02	Error occurred while running Task 'Publish Release Notes(10)' of type com.atlassian.********.plugins.********-scp-plugin:scptask.
    error	08-Jul-2021 14:04:02	java.lang.NullPointerException
    error	08-Jul-2021 14:04:02		at<init>(
    error	08-Jul-2021 14:04:02		at com.atlassian.********.plugins.scp.ScpTask$CopyPathSpecs.<init>(
    error	08-Jul-2021 14:04:02		at com.atlassian.********.plugins.scp.ScpTask.getPathSpecToCopy(
    error	08-Jul-2021 14:04:02		at com.atlassian.********
    error	08-Jul-2021 14:04:02		at com.atlassian.********.plugins.scp.ScpTask.execute(
    error	08-Jul-2021 14:04:02		at com.atlassian.********.task.TaskExecutorImpl.lambda$executeTasks$2(
    error	08-Jul-2021 14:04:02		at com.atlassian.********.task.TaskExecutorImpl.executeTaskWithPrePostActions(
    error	08-Jul-2021 14:04:02		at com.atlassian.********.task.TaskExecutorImpl.executeTasks(
    error	08-Jul-2021 14:04:02		at com.atlassian.********.task.TaskExecutorImpl.execute(
    error	08-Jul-2021 14:04:02		at com.atlassian.********
    error	08-Jul-2021 14:04:02		at com.atlassian.********
    error	08-Jul-2021 14:04:02		at com.atlassian.********
    error	08-Jul-2021 14:04:02		at com.atlassian.********$waitAndPerformBuild$0(
    error	08-Jul-2021 14:04:02		at com.atlassian.********.variable.CustomVariableContextImpl.withVariableSubstitutor(
    error	08-Jul-2021 14:04:02		at com.atlassian.********
    error	08-Jul-2021 14:04:02		at com.atlassian.********$
    error	08-Jul-2021 14:04:02		at com.atlassian.********.utils.BambooRunnables$
    error	08-Jul-2021 14:04:02		at com.atlassian.********.security.ImpersonationHelper.runWith(
    error	08-Jul-2021 14:04:02		at com.atlassian.********.security.ImpersonationHelper.runWithSystemAuthority(
    error	08-Jul-2021 14:04:02		at com.atlassian.********.security.ImpersonationHelper$
    error	08-Jul-2021 14:04:02		at


The artifact_definition table, used to store the definition of all your artifacts, has several columns for storing artifact name, pattern, location and so forth. When column src_directory on that table is NULL the SCP Task fails and throws the above errors when trying to fetch the artifact definition data. The reason why that column is NULL not yet known. To confirm if that's the case on your instance you can run the below query (please make sure to replace the build key with your own one:

select *
  from artifact_definition ad
  join build b
    on ad.producer_job_id = b.build_id
 where b.full_key = 'PROJ-PLAN-JOB'
   and ad.src_directory is null;


  1. Access your Bamboo instance URL https://<your-bamboo-URL>/build/admin/edit/defaultBuildArtifact.action?buildKey=PROJ-PLAN-JOB page and re-save the artifact definition for the artifact the shared artifact that you are using on your SCP task.
  2. Run your affected plan and confirm that the error is gone.

Last modified on Jul 19, 2021

Was this helpful?

Provide feedback about this article
Powered by Confluence and Scroll Viewport.