deployphp / action

GitHub Action for Deployer
MIT License
222 stars 44 forks source link

BUG: `rsync` issue with artifact synchronization (`ubuntu-latest`) #35

Closed lbajsarowicz closed 2 years ago

lbajsarowicz commented 2 years ago

The issue

After building an artifact (tested with 250MB artifact), Github Action fails with the following error:

[Symfony\Component\Process\Exception\ProcessFailedException]                 
  The command "rsync -azP -e 'ssh -A -p *** -o UserKnownHostsFile=/dev/null  
   -o StrictHostKeyChecking=no' 'artifacts/artifact.tar.gz' 'deploy@ssh.XXX.io:/srv/releases/2009076181'" failed.                

  Exit Code: 255(Unknown error)                                                

  Working directory: /__w/XXX-magento2/XXX-magento2            

  Output:                                                                      
  ================                                                             
  sending incremental file list                                                
  artifact.tar.gz                                                              
         32,768   0%    0.00kB/s    0:00:00                                 

  Error Output:                                                                
  ================                                                                               
  client_loop: send disconnect: Broken pipe                                    

  rsync: [sender] write error: Broken pipe (32)                                
  rsync error: unexplained error (code 2[55](https://github.com/XXX/XXX-magento2/runs/5612222340?check_suite_focus=true#step:7:55)) at io.c(823) [sender=3.2.3]

Conditions

lbajsarowicz commented 2 years ago

Solution

The issue is caused by an invalid rsync configuration. In order to mitigate the issue, you need to add an extra option --bwlimit=... to rsync configuration:

Example:

task('artifact:upload', function () {
    upload(get('artifact_path'), '{{release_path}}', ['options' => ['--bwlimit=4096']]);
});

PS: The issue created for the record / as a solution for others.

antonmedv commented 2 years ago

Awesome! Can you add this to deployphp/deployer docs section?

lbajsarowicz commented 2 years ago

@antonmedv Done.