It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Bitbucket pipeline scp ignores user in deployment variable or statically entered. Always uses root Edited


I have a build pipeline which copies a tar.gz file at the end by using scp. I have added the SSH key of the user "deploy" to the settings, and the fingerprint of the server was added to the known_hosts.

I then created a deployment with a variable DEPLOY_USER with a value "deploy". This variable is populated correctly. The thing is, this setup works for a couple of times. After a while, I can't seem to pinpoint exactly when, the scp step fails. When this happens, I see the user root being used (which has no ssh access).

This happened on two of my pipelines in seperate projects, with seperate users.

I have added a screenshot to clarify the problem.

Update: I have tried:

  • removing and adding the known_hosts entry
  • removing and adding the ssh keys
  • replacing the variable with the user hard-coded deploy@...

Didn't help.

Any ideas?



1 answer

1 accepted

0 votes
Answer accepted

I've found a workaround.

Recreating the deployment variable isn't enough. I had to completely remove the Deployment (Settings > Deployments), recreate it and add the variables again.

I think the cause may have been a change in the IP-address of the server (scp destination). In both the projects where I had this problem, I changed the known_hosts and one of the deployment variables (DEPLOY_HOST). But I can't reproduce at the time

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Bitbucket

Share your software development horror stories!

Hey Community! I work on the Bitbucket product marketing team. With Halloween approaching, we wanted to discuss a topic tailor-made for October: development horror stories. Whether it was a lurk...

568 views 6 2
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you