Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Why is Pipeline deployment rsync-deploy with SSH_ARGS failing

Mike Moore June 3, 2024

I am using pipe: atlassian/rsync-deploy:0.12.0. The script is changing the group and permissions. Per the documentation and if I am understanding correctly I can pass these arguments to prevent this, but it if failing. How can I prevent the permissions from changing or make these commands work?
SSH_ARGS: '--perms --chmod=D2775,F0664 --owner --group'

ssh: unrecognized option: -
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(231) [sender=3.2.7]

Thank you

1 answer

1 vote
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 4, 2024

Hello @Mike Moore ,

and welcome to the Community!

When you have multiple arguments to provide to the rsync comment, it's recommended that you pass those arguments as an ARRAY in the pipe's definition.

Also, it looks like you are using the SSH_ARGS variable, which is strict to the underlying SSH connection, while those flags you have provided are actually RSYNC args that should be put in the EXTRA_ARGS variable instead.

That being said, for your use case, the --perms and --chmod flags would be necessary to set the destination file permissions to the ones you want. Providing those arguments as an array would look like below : 

script:
  - pipe: atlassian/rsync-deploy:0.12.0
    variables:
      USER: 'ec2-user'
      SERVER: '127.0.0.1'
      REMOTE_PATH: '/var/www/build/'
      LOCAL_PATH: 'build'
      DEBUG: 'true'
      EXTRA_ARGS:
        - "--perms" # double quotes here are necessary
        - "--chmod=D2775,F0664"

 Could you try with that syntax and let us know how it goes?

For more examples, you can also refer to that pipe's official documentation below (the instructions are contained in the README file) :

Thank you, @Mike Moore !

Patrik S

Mike Moore June 5, 2024

Thank for your help, I have not worked with yml much and did not catch they should be setup as array. After I adjusted the command it did not error out. It was still not preserving or updating the permissions on the ec2. I ended up adding a bash script that would update there permissions and calling it after the pipe is ran.

Like # people like this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events