Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Capistrano gzip: stdin: unexpected end of file interruption

I have a problem with Capistrano deployment. Deployment process is being dropped with error of Gzip.

What can it be?

 cap flow deploy 

* executing `flow' 
* executing `deploy' 
* executing `deploy:update' 
** transaction: start 
* executing `deploy:update_code' 
* getting (via checkout) 
revision to /tmp/20111214204507 
executing locally: cp -R . /tmp/20111214204507 
c    ommand finished in 413ms 
compressing /tmp/20111214204507 to /tmp/20111214204507.tar.gz 
executing locally: tar chzf 20111214204507.tar.gz 20111214204507 
command finished in 2419ms 
servers: ["10.11.10.10"] 
Password: ** sftp upload /tmp/20111214204507.tar.gz -> /tmp/20111214204507.tar.gz 
[10.11.10.10] /tmp/20111214204507.tar.gz 
[10.11.10.10] done * sftp upload complete * executing "cd /home/tieto/dvs_production/releases && tar xzf /tmp/20111214204507.tar.gz && rm /tmp/20111214204507.tar.gz" 
servers: ["10.11.10.10"] 
[10.11.10.10] executing command 
[err :: 10.11.10.10] 
[err :: 10.11.10.10] gzip: 
[err :: 10.11.10.10] stdin: unexpected end of file 
[err :: 10.11.10.10] tar: 
[err :: 10.11.10.10] Child returned status 1 
[err :: 10.11.10.10] 
[err :: 10.11.10.10] tar: 
[err :: 10.11.10.10] Error exit delayed from previous errors 
[err :: 10.11.10.10] 
command finished in 62ms 
[deploy:update_code] rolling back * executing "rm -rf /home/flow/production/releases/20111214204507; true" 
servers: ["10.11.10.10"] 
[10.11.10.10] executing command 
command finished in 69ms 
failed: "sh -c 'cd /home/flow/production/releases && tar xzf /tmp/20111214204507.tar.gz && rm /tmp/20111214204507.tar.gz'" on 10.11.10.10
like image 505
thesis Avatar asked Dec 21 '11 13:12

thesis


1 Answers

The answer is herein, if you are or others attempting a local deployment are still having this issue: http://f3internet.com/articles/2010/06/18/deploying-static-sites-with-capistrano/

This line [10.11.10.10] done * sftp upload complete * executing "cd /home/tieto/dvs_production/releases && tar xzf /tmp/20111214204507.tar.gz && rm /tmp/20111214204507.tar.gz" is attempting to unzip and delete the temporary copy at the same time.

The solution is to define local/remote copy directories on the same machine:

set :copy_dir, "/home/#{local_user}/tmp"
set :remote_copy_dir, "/tmp"
like image 67
jordanpg Avatar answered Sep 28 '22 10:09

jordanpg