I can't sync a platform to a remote server because rsync somehow tries to remove the /var/aegir directory:

Generated config platform configuration file
/var/aegir/config/server_athenakoumbitnet/apache/platform.d/platform_testDrupal61921.conf could not be synced to remote server athena.koumbit.net. Changes might not be available until this has been done. (error: rsync: delete_file: unlink(var/aegir) failed: Permission denied (13) could not make way for new directory: var/aegir rsync: delete_file: unlink(var/aegir) failed: Permission denied (13) could not make way for new directory: var/aegir *** Skipping any contents from this failed directory *** rsync error: some files could not be transferred (code 23) at main.c(1058) [sender=3.0.3])

Note that /var/aegir is a symlink to /srv/aegir.

Full log:

Task starts processing
Running: /usr/share/drush/drush.php --context_type='platform' --master_url... (Expand)
Drush bootstrap phase : _drush_bootstrap_drush()
Found command: provision-save (commandfile=provision)
Initializing drush commandfile: drush_make
Initializing drush commandfile: drush_make_d_o
Initializing drush commandfile: provision
Load alias @self
Load alias @server_athenakoumbitnet
Load alias @server_master
Loading apache_ssl driver for the http service
Loading apache_ssl driver for the http service
Load alias @platform_testDrupal61921
Template loaded: /srv/aegir/.drush/provision/provision_drushrc_alias.tpl.php
Changed permissions of /var/aegir/.drush/platform_testDrupal61921.alias.drushrc.php to 600
Generated config Drush configuration file
Changed permissions of /var/aegir/.drush/platform_testDrupal61921.alias.drushrc.php to 400
Command dispatch complete
Peak memory usage was 7.02 MB
Running: /usr/share/drush/drush.php @platform_testDrupal61921 provision-verify --backend
Drush bootstrap phase : _drush_bootstrap_drush()
Load alias @platform_testDrupal61921
Found command: provision-verify (commandfile=provision)
Initializing drush commandfile: drush_make
Initializing drush commandfile: drush_make_d_o
Initializing drush commandfile: provision
Load alias @server_athenakoumbitnet
Load alias @server_master
Loading apache_ssl driver for the http service
Loading apache_ssl driver for the http service
Including /var/aegir/.drush/provision/platform/backupmigrate/verify.provision.inc
Including /var/aegir/.drush/provision_boost/verify.provision.inc
Including /var/aegir/.drush/provision/platform/verify.provision.inc
Drush bootstrap phase : _drush_bootstrap_drupal_root()
Initialized Drupal 6.19 root directory at /var/aegir/platforms/test-drupal-6.19-2.1
Drupal sites directory /var/aegir/platforms/test-drupal-6.19-2.1/sites is writable by the provisioning script
Undefined variable: sites provision_drupal.drush.inc:334
This platform is running drupal 6.19
Found 513 modules in base
Found 18 themes in base
loading profile default
Found install profile default
Template loaded: /srv/aegir/.drush/provision/http/apache/platform.tpl.php
Generated config platform configuration file
/var/aegir/config/server_athenakoumbitnet/apache/platform.d/platform_testDrupal61921.conf could not be synced to remote server athena.koumbit.net. Changes might not be available until this has been done. (error: rsync: delete_file: unlink(var/aegir) failed: Permission denied (13) could not make way for new directory: var/aegir rsync: delete_file: unlink(var/aegir) failed: Permission denied (13) could not make way for new directory: var/aegir *** Skipping any contents from this failed directory *** rsync error: some files could not be transferred (code 23) at main.c(1058) [sender=3.0.3])
apache on athena.koumbit.net has been restarted
An error occurred at function : drush_provision_verify
Command dispatch complete
Peak memory usage was 15.18 MB
An error occurred at function : drush_hosting_task
Command dispatch complete
Peak memory usage was 38.37 MB

Comments

anarcat’s picture

This is because of -R (the --relative) mode, which tries to play with the whole hierarchy:

This works:

ceres:~/.ssh$ rsync -azv -n  --relative --omit-dir-times  '/var/aegir/config/server_athenakoumbitnet/apache/platform.d/platform_testDrupal61921.conf' 'aegir@athena.koumbit.net:/'
sending incremental file list
/var/aegir/
/var/aegir/config/
/var/aegir/config/server_athenakoumbitnet/
/var/aegir/config/server_athenakoumbitnet/apache/
/var/aegir/config/server_athenakoumbitnet/apache/platform.d/
/var/aegir/config/server_athenakoumbitnet/apache/platform.d/platform_testDrupal61921.conf

sent 254 bytes  received 36 bytes  580.00 bytes/sec
total size is 4744  speedup is 16.36 (DRY RUN)

This doesn't:

ceres:~/.ssh$ rsync -azv  --relative --omit-dir-times  '/var/aegir/config/server_athenakoumbitnet/apache/platform.d/platform_testDrupal61921.conf' 'aegir@athena.koumbit.net:/'
sending incremental file list
rsync: delete_file: unlink(var/aegir) failed: Permission denied (13)
could not make way for new directory: var/aegir
rsync: delete_file: unlink(var/aegir) failed: Permission denied (13)
could not make way for new directory: var/aegir
*** Skipping any contents from this failed directory ***

sent 236 bytes  received 18 bytes  508.00 bytes/sec
total size is 4744  speedup is 18.68
rsync error: some files could not be transferred (code 23) at main.c(1058) [sender=3.0.3]

I feel it's a bad idea to assume the same directory structure (ie. /var/aegir) on the remote servers anyways, why are we using --relative?

anarcat’s picture

Status: Active » Fixed

Fixed in CVS: we use dirname() and sync to that. This doesn't fix the prefix problem.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit 330721d on debian, dev-koumbit, dev-log_directory, dev-migrate_aliases, dev-multiserver-install, dev-simplerinstaller, prod-koumbit, dev-ssl-ip-allocation-refactor, dev-1205458-move_sites_out_of_platforms, 7.x-3.x, dev-subdir-multiserver, 6.x-2.x-backports, dev-helmo-3.x by anarcat:
    #946422 - do not use relative mode, it breaks symlinks
    
    
  • Commit 6313007 on debian, dev-koumbit, dev-log_directory, dev-migrate_aliases, dev-multiserver-install, dev-simplerinstaller, prod-koumbit, dev-ssl-ip-allocation-refactor, dev-1205458-move_sites_out_of_platforms, 7.x-3.x, dev-subdir-multiserver, 6.x-2.x-backports, dev-helmo-3.x by anarcat:
    do not use relative mode, it breaks symlinks
    
    Fixes: #946422
    
  • Commit b4cca37 on prod-koumbit, dev-ssl-ip-allocation-refactor, dev-1205458-move_sites_out_of_platforms, 7.x-3.x, dev-subdir-multiserver, 6.x-2.x-backports, dev-helmo-3.x by anarcat:
    #946422 - don't destroy symlinks on remote servers, the right way
    
    
  • Commit db4d675 on debian, dev-koumbit, dev-log_directory, dev-migrate_aliases, dev-multiserver-install, dev-simplerinstaller, prod-koumbit, dev-ssl-ip-allocation-refactor, dev-1205458-move_sites_out_of_platforms, 7.x-3.x, dev-subdir-multiserver, 6.x-2.x-backports, dev-helmo-3.x by anarcat:
    #946422 - don't destroy symlinks on remote servers, the right way