Problem/Motivation

Verifying a platform does not sync up codebase on remote server. Tested against 7.x-3.19.x

Platform is deployed via 'Deploy a Composer project from a Git repository' method

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#8 fix-platform-sync-repopath.patch674 bytesgval
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ac created an issue. See original summary.

ac’s picture

Issue summary: View changes
ac’s picture

Also can not create a new platform

colan’s picture

Added to #3087029: [meta] Aegir 3.19.x release as a regression. Please remove if it didn't work before either.

ac’s picture

Ok found out *why* this isn't working. From a platform-verify:

rsync -e 'ssh ' -akzv --exclude=".git" --exclude=".gitignore" --exclude=".hg" --exclude=".hgignore" --exclude=".hgrags" --exclude=".bzr" --exclude=".bzrignore" --exclude=".bzrtags" --exclude=".svn" --include="sites/all" --exclude="sites/*" --stats --progress --relative --keep-dirlinks --omit-dir-times --delete '/var/aegir/config/server_remote' 'aegir@remote.example.com:/'

Should be:

rsync -e 'ssh ' -akzv --exclude=".git" --exclude=".gitignore" --exclude=".hg" --exclude=".hgignore" --exclude=".hgrags" --exclude=".bzr" --exclude=".bzrignore" --exclude=".bzrtags" --exclude=".svn" --include="sites/all" --exclude="sites/*" --stats --progress --relative --keep-dirlinks --omit-dir-times --delete '/var/aegir/platforms/platform_name' 'aegir@remote.example.com:/'

For some reason it is trying to rsync the platform to the config path, not the platform path. I will try find out where this happens in the code if I get a chance but if someone else knows, please provide a patch/point me to the correct place.

Tested on 7.x-3.192

ac’s picture

So the problem is in Provision/Context/server.php on line 173 there is the following:

if (is_null($path)) {
  $path = $this->config_path;
}

When it is syncing the codebase, $path is NULL and so it is being set to $this->config_path. It doesn't seem to be aware of composer_git_path which is probably what it should be syncing.

ac’s picture

Problem also happens with a manually created codebase, so not composer specific.

gval’s picture

I encountered the same problem with a "composer + git" platform.
I found it was related to hosting_git module (that implements hook_provision_platform_sync_path_alter()), which is enabled on my server. So i made a quick patch (php 7+) to fix that.

colan’s picture

Status: Active » Needs review
ac’s picture

Status: Needs review » Needs work

So this patch solves the issue for git + composer platforms when hosting_git is enabled, however traditional platforms (and possibly other types - couldn't test those) still don't sync with this module enabled.