Open cooniur opened 10 years ago
I'm experiencing a similar issue with jenkins and rsync. This SO question seems related too: http://stackoverflow.com/questions/30743180/why-rsync-fails-with-jenkins
But the answer does not solve my problem.
Yes! finally found the problem.
rsync was not being executed with the expected user (jenkins) but with another (jboss in my case) adding 'whoami' to the script and using ssh verbose:
rsync -e "ssh -v" .......
helped to find the problem.
Environment
EC2 AMI: (ami-8997afe0): https://aws.amazon.com/marketplace/pp/B00IOYDTV6/ref=srh_res_product_title?ie=UTF8&sr=0-5&qid=1411713770511 CentOS: 6.5 rsync: 3.0.6 vagrant-aws: 0.5.0 vagrant: 1.6.5 Jenkins: 1.581
override.ssh.pty = true
i.e. using PTY (CentOS doesn't allow tty by default)Summary
When running Vagrant in Jenkins, rsync 3.0.6 will fail on CentOS 6.5 when using vagrant-aws to spin up an EC2 instance.
Details
vagrant up ec2server --provider=aws
was executed in Jenkins, but returned the error:failed to exec ssh: Permission denied (13)
. Thessh
command is indeed/usr/bin/ssh
. The user istomcat
, having the right permission to executersync
as well asssh
.Below is the output obtained by using
VAGRANT_LOG=debug
Analysis
I manually executed the command in bash in the same server:
and it can be executed successfully, i.e., files can be transferred to remote server.
So what did I miss?
Update
Temporary Workaround
Disable sync_folders by: