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:
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
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...
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