When using the task 'Copy Files Over SSH' I'm running into an issue when I add a dot-file to the list of files to copy. In my case I'm trying to copy a .htaccess file, but it fails with the error: Unhandled: handle is not a Buffer. This is happening both on the hosted agent and a local (Mac) agent. When I don't include any dot-files, everything is fine.
This is the log:
2016-12-04T13:58:01.4328270Z ==============================================================================
2016-12-04T13:58:01.4345720Z Task : Copy Files Over SSH
2016-12-04T13:58:01.4356460Z Description : Copy files or build artifacts to a remote machine over SSH
2016-12-04T13:58:01.4366160Z Version : 0.1.2
2016-12-04T13:58:01.4381000Z Author : Microsoft Corporation
2016-12-04T13:58:01.4392030Z Help : [More Information](https://go.microsoft.com/fwlink/?LinkId=821894)
2016-12-04T13:58:01.4404190Z ==============================================================================
2016-12-04T13:58:01.9834970Z Setting up SSH connection to remote host *******.
2016-12-04T13:58:02.7855400Z Found 22 files to copy to the remote machine.
2016-12-04T13:58:02.7910230Z Copying file /Users/tim/vstsbuildagent/_work/r1/a/Master build/distribution/.htaccess to /var/www/html/********/public_html/.htaccess on remote machine.
2016-12-04T13:58:02.9029540Z ##[error]Unhandled: handle is not a Buffer
@Mardaneus86: I am able to copy files starting with dot from build agent running on windows to my Ubuntu machine. I suspect the issues is related to folder permissions similar to the issue here: https://github.com/spmjs/node-scp2/issues/21.
What OS is your build machine running on? What OS is your remote machine? Can you check if the folder is created on the destination and what permissions it has? Please check the folder permissions on the build machine as well.
Thanks,
Madhuri
OS of build machine: macOS Sierra
OS of remote machine: Linux Debian 8.6
You are absolutely right about the permissions. Didn't check those properly, working now. Thanks for your support!
@Mardaneus86 can you share how exactly you fixed this issue? I'm running into the same issue with the azure pipeline
@Mardaneus86 can you share how exactly you fixed this issue? I'm running into the same issue with the azure pipeline
I changed in my prod machine (ubuntu 18) the folder permissions. Just a chmod -R 777 [folder_name].
Most helpful comment
OS of build machine: macOS Sierra
OS of remote machine: Linux Debian 8.6
You are absolutely right about the permissions. Didn't check those properly, working now. Thanks for your support!