"bash: rsync: command not found" in "bitbucketpipelines/rsync-deploy:0.4.4" since Jan 27
Asked by ilya_pakhomov1010:

Since Jan 27 without changing my [bitbucket-pipelines.yml](https://bitbucket.org/tmatly/tmat-etls/src/master/bitbucket-pipelines.yml) file my pipeline, that transfers code to remote server, **started to fail with the error:**

++bash: rsync: command not found++

**My [bitbucket-pipelines.ym](https://bitbucket.org/tmatly/tmat-etls/src/master/bitbucket-pipelines.yml)l file**

![Screenshot_106.png](https://community.atlassian.com/t5/image/serverpage/image-id/128115iA62E2BB8F2F57E4D/image-size/large?v=v2&px=999 "Screenshot_106.png")

**Logs of my current deployment jobs:**

\`\`\`  
docker container run \  
--volume=/opt/atlassian/pipelines/agent/build:/opt/atlassian/pipelines/agent/build \  
--volume=/opt/atlassian/pipelines/agent/ssh:/opt/atlassian/pipelines/agent/ssh:ro \  
--volume=/usr/local/bin/docker:/usr/local/bin/docker:ro \  
--volume=/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes:/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes \  
--volume=/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/atlassian/rsync-deploy:/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/atlassian/rsync-deploy \  
--workdir=$(pwd) \  
--label=org.bitbucket.pipelines.system=true \  
--env=BITBUCKET_STEP_TRIGGERER_UUID="$BITBUCKET_STEP_TRIGGERER_UUID" \  
--env=BITBUCKET_REPO_FULL_NAME="$BITBUCKET_REPO_FULL_NAME" \  
--env=BITBUCKET_GIT_HTTP_ORIGIN="$BITBUCKET_GIT_HTTP_ORIGIN" \  
--env=BITBUCKET_PROJECT_UUID="$BITBUCKET_PROJECT_UUID" \  
--env=BITBUCKET_REPO_IS_PRIVATE="$BITBUCKET_REPO_IS_PRIVATE" \  
--env=BITBUCKET_WORKSPACE="$BITBUCKET_WORKSPACE" \  
--env=BITBUCKET_DEPLOYMENT_ENVIRONMENT_UUID="$BITBUCKET_DEPLOYMENT_ENVIRONMENT_UUID" \  
--env=BITBUCKET_REPO_OWNER_UUID="$BITBUCKET_REPO_OWNER_UUID" \  
--env=BITBUCKET_BRANCH="$BITBUCKET_BRANCH" \  
--env=BITBUCKET_REPO_UUID="$BITBUCKET_REPO_UUID" \  
--env=BITBUCKET_PROJECT_KEY="$BITBUCKET_PROJECT_KEY" \  
--env=BITBUCKET_DEPLOYMENT_ENVIRONMENT="$BITBUCKET_DEPLOYMENT_ENVIRONMENT" \  
--env=BITBUCKET_REPO_SLUG="$BITBUCKET_REPO_SLUG" \  
--env=CI="$CI" \  
--env=BITBUCKET_REPO_OWNER="$BITBUCKET_REPO_OWNER" \  
--env=BITBUCKET_STEP_RUN_NUMBER="$BITBUCKET_STEP_RUN_NUMBER" \  
--env=BITBUCKET_BUILD_NUMBER="$BITBUCKET_BUILD_NUMBER" \  
--env=BITBUCKET_GIT_SSH_ORIGIN="$BITBUCKET_GIT_SSH_ORIGIN" \  
--env=BITBUCKET_PIPELINE_UUID="$BITBUCKET_PIPELINE_UUID" \  
--env=BITBUCKET_COMMIT="$BITBUCKET_COMMIT" \  
--env=BITBUCKET_CLONE_DIR="$BITBUCKET_CLONE_DIR" \  
--env=PIPELINES_JWT_TOKEN="$PIPELINES_JWT_TOKEN" \  
--env=BITBUCKET_STEP_UUID="$BITBUCKET_STEP_UUID" \  
--env=BITBUCKET_DOCKER_HOST_INTERNAL="$BITBUCKET_DOCKER_HOST_INTERNAL" \  
--env=DOCKER_HOST="tcp://host.docker.internal:2375" \  
--env=BITBUCKET_PIPE_SHARED_STORAGE_DIR="/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes" \  
--env=BITBUCKET_PIPE_STORAGE_DIR="/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/atlassian/rsync-deploy" \  
--env=DEBUG="true" \  
--env=LOCAL_PATH="." \  
--env=REMOTE_PATH="/root/airflow/dags" \  
--env=SERVER="$FTP_HOST" \  
--env=USER="$FTP_USERNAME" \  
--add-host="host.docker.internal:$BITBUCKET_DOCKER_HOST_INTERNAL" \  
bitbucketpipelines/rsync-deploy:0.4.4  
Unable to find image 'bitbucketpipelines/rsync-deploy:0.4.4' locally  
0.4.4: Pulling from bitbucketpipelines/rsync-deploy  
31603596830f: Pulling fs layer  
18b08b0965fd: Pulling fs layer  
d840a4da8ca9: Pulling fs layer  
e69c62e07d86: Pulling fs layer  
02dd46a63977: Pulling fs layer  
02dd46a63977: Waiting  
e69c62e07d86: Waiting  
d840a4da8ca9: Verifying Checksum  
d840a4da8ca9: Download complete  
18b08b0965fd: Verifying Checksum  
18b08b0965fd: Download complete  
31603596830f: Verifying Checksum  
31603596830f: Download complete  
31603596830f: Pull complete  
e69c62e07d86: Verifying Checksum  
e69c62e07d86: Download complete  
02dd46a63977: Verifying Checksum  
02dd46a63977: Download complete  
18b08b0965fd: Pull complete  
d840a4da8ca9: Pull complete  
e69c62e07d86: Pull complete  
02dd46a63977: Pull complete  
Digest: sha256:ac35ec28011c10616f9744d133614c1df97412bfd6bb731fe68a2c912cc6a7e4  
Status: Downloaded newer image for bitbucketpipelines/rsync-deploy:0.4.4  
INFO: Executing the pipe...  
+ setup_ssh_dir  
+ INJECTED_SSH_CONFIG_DIR=/opt/atlassian/pipelines/agent/ssh  
+ IDENTITY_FILE=/opt/atlassian/pipelines/agent/ssh/id_rsa_tmp  
+ KNOWN_HOSTS_FILE=/opt/atlassian/pipelines/agent/ssh/known_hosts  
+ mkdir -p /root/.ssh  
INFO: Enabling debug mode.  
+ touch /root/.ssh/authorized_keys  
+ '[' '' '!=' '' ']'  
+ '[' '!' -f /opt/atlassian/pipelines/agent/ssh/id_rsa_tmp ']'  
DEBUG: Using default ssh key  
+ debug 'Using default ssh key'  
+ [[ true == \t\r\u\e ]]  
+ echo -e '\e[37mDEBUG: Using default ssh key\e[0m'  
+ cp /opt/atlassian/pipelines/agent/ssh/id_rsa_tmp /root/.ssh/pipelines_id  
+ '[' '!' -f /opt/atlassian/pipelines/agent/ssh/known_hosts ']'  
+ cat /opt/atlassian/pipelines/agent/ssh/known_hosts  
+ '[' -f /root/.ssh/config ']'  
+ echo 'IdentityFile ~/.ssh/pipelines_id'  
+ chmod -R go-rwx /root/.ssh/  
+ run_pipe  
INFO: Starting RSYNC deployment to 174.138.10.246:/root/airflow/dags...  
+ info 'Starting RSYNC deployment to 174.138.10.246:/root/airflow/dags...'  
+ echo -e '\e[36mINFO: Starting RSYNC deployment to 174.138.10.246:/root/airflow/dags...\e[0m'  
+ [[ ! -z '' ]]  
+ run rsync -rp --delete-after . root@174.138.10.246:/root/airflow/dags  
++ date +%s  
+ output_file=/var/tmp/pipe-1611953835-16755  
rsync -rp --delete-after . root@174.138.10.246:/root/airflow/dags  
+ echo rsync -rp --delete-after . root@174.138.10.246:/root/airflow/dags  
+ set +e  
+ rsync -rp --delete-after . root@174.138.10.246:/root/airflow/dags  
+ tee /var/tmp/pipe-1611953835-16755  
bash: rsync: command not found  
? Deployment failed.  
rsync: connection unexpectedly closed (0 bytes received so far) [sender]  
rsync error: error in rsync protocol data stream (code 12) at io.c(226) [sender=3.1.3]  
+ status=12  
+ set -e  
+ [[ 12 == \0 ]]  
+ fail 'Deployment failed.'  
+ echo -e '\e[31m? Deployment failed.\e[0m'  
+ exit 1  
\`\`\`


Answers:
author: Oleksandr Kyrdan
body: Hi [@ilya_pakhomov1010](/t5/user/viewprofilepage/user-id/4243408) ,

Thank you for your question!

We've checked pipe's image bitbucketpipelines/rsync-deploy:0.4.4@sha256:ac35ec28011c10616f9744d133614c1df97412bfd6bb731fe68a2c912cc6a7e4 and it's works with rsync inside.

We are investigating the issue with the Bitbucket Pipelines team.

It would be nice if you could provide us with the build ID of the failed pipeline for this case and try to execute your pipeline again to check if the issue present.

Best regards,  
Oleksandr

comments: author: ilya_pakhomov1010
body: Hi [@Oleksandr Kyrdan](/t5/user/viewprofilepage/user-id/2885705) !  
I've tried running the pipeline once again and the issue is still there unfortunately :(  

I don't know where to find build ID exactly, but it's "33" under my repository, here's the full link to it, if it helps:  
<https://bitbucket.org/tmatly/tmat-etls/addon/pipelines/home#!/results/33>


author: ilya_pakhomov1010
body: Hi [@Oleksandr Kyrdan](/t5/user/viewprofilepage/user-id/2885705) !  
Seems like the problem was on my side after messing with "/etc/environment" file on server (system commands were not in "PATH" environment variable)  
Everything is back to normal now when I fixed the "PATH" variable


Tags: bitbucket-pipelines

cloud

rsync