Deploy with rsync fails consistently

The following gitea pipeline fails to deploy for me:

    image: cbrgm/drone-hugo:latest
    validate: true
    output: /public/
    url: https://<host>
    image: drillster/drone-rsync:latest
    hosts: [ "<host>" ]
    port: 999
    user: khorne
    secrets: [ rsync_key ]
    target: /var/www/<host>/public/
    source: /public
    image: drillster/drone-email:latest
    host: <host>
    username: khorne
    secrets: [ email_password ]
    from: drone@<host>
    recipients: [ khorne@<host> ]
      status: [ changed, failure ]

with the following message:

$ rsync -az -e 'ssh -p 999 -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -o StrictHostKeyChecking=no' /public khorne@<host>:/var/www/<host>/public/ ...
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(226) [sender=3.1.2]

Not really sure where to proceed from here.
drone exec /path/to/.drone.yaml claims no private key but that is added to secrets with drone secrets add --repository --name rsync_key --value @/home/khorne/.ssh/id_rsa …

Manually running that command outside at least the drone environment succeeds with the same key.

I have no idea whats going wrong where and I’d appreciate any help.

Thanks in advance

Are you sure this is related to secrets? The error message sounds like it could also be a networking issue. 0 bytes received sounds like it never established a connection to the host.

Have you researched the specific error any further on sites like stackoverflow?

Hi Brad,

No,maybe this is not due to secrets. The drone-scp plugin with identical paths and the same (remapped) secrets works for me.
I guess this is a suitable alternative for me,it fulfils the same purpose. I was curious whether someone had an idea why the rsync plugin doesn’t do it though.

Thanks for your help regardless

I’m glad you found a workaround (with the scp plugin). You might also have some luck discussing with the author of the rsync plugin at