Hello,

I'm unable to run my custom 'prod' to 'dev' cloning script. It was working before I updated to 7.x-3.x HEAD.

Here's the copy of the script:

[idev@s-eci-idev ~]$ cat bin/prod_to_dev.sh
#!/bin/sh
PLATFORM="`drush @hm sqlq "SELECT c.name FROM node AS n INNER JOIN hosting_context AS c ON (n.nid=c.nid) WHERE n.type='platform' AND n.title LIKE 'easmeintranet_%' AND n.status=1 ORDER BY n.nid DESC LIMIT 1" | xargs`"
echo $PLATFORM
drush @hm hosting-task @sandbox.intranet.s-eci-idev.easme.cec.eu.int delete --force
drush provision-save '@sandbox.intranet.s-eci-idev.easme.cec.eu.int' --context_type='site' --uri='sandbox.intranet.s-eci-idev.easme.cec.eu.int' --platform="$PLATFORM" --server='@server_master' --db_server='@server_master' --profile='easmeintranet' --client_name='admin'
drush @intranet.easme.cec.eu.int provision-clone @sandbox.intranet.s-eci-idev.easme.cec.eu.int $PLATFORM
drush @hm hosting-task $PLATFORM verify --force

Here's the debug of each command:

[idev@s-eci-idev ~]$ PLATFORM="`drush @hm sqlq "SELECT c.name FROM node AS n INNER JOIN hosting_context AS c ON (n.nid=c.nid) WHERE n.type='platform' AND n.title LIKE 'easmeintranet_%' AND n.status=1 ORDER BY n.nid DESC LIMIT 1" | xargs`"

[idev@s-eci-idev ~]$ echo $PLATFORM
platform_easmeintranet_master_234
[idev@s-eci-idev ~]$ drush @hm hosting-task @sandbox.intranet.s-eci-idev.easme.cec.eu.int delete --force
This task is not valid                                                                                                                                                                                                            [error]
[idev@s-eci-idev ~]$ drush provision-save '@sandbox.intranet.s-eci-idev.easme.cec.eu.int' --context_type='site' --uri='sandbox.intranet.s-eci-idev.easme.cec.eu.int' --platform="$PLATFORM" --server='@server_master' --db_server='@server_master' --profile='easmeintranet' --client_name='admin'
Changed permissions of /home/idev/.drush/sandbox.intranet.s-eci-idev.easme.cec.eu.int.alias.drushrc.php to 640                                                                                                                    [success]
Generated config in write(): Drush configuration file (/home/idev/.drush/sandbox.intranet.s-eci-idev.easme.cec.eu.int.alias.drushrc.php)                                                                                          [success]
Changed permissions of /home/idev/.drush/sandbox.intranet.s-eci-idev.easme.cec.eu.int.alias.drushrc.php to 440                                                                                                                    [success]
[idev@s-eci-idev ~]$ drush @intranet.easme.cec.eu.int provision-clone @sandbox.intranet.s-eci-idev.easme.cec.eu.int @$PLATFORM
Site was not found.                                                                                                                                                                                                               [error]
Removed unused clone site package                                                                                                                                                                                                 [success]
[idev@s-eci-idev ~]$ drush @intranet.easme.cec.eu.int provision-clone @sandbox.intranet.s-eci-idev.easme.cec.eu.int @platform_easmeintranet_master_234 -v -d
Starting Drush preflight. [0.01 sec, 2.08 MB]                                                                                                                                                                                     [preflight]
Loading drushrc "/home/idev/.drush/drushrc.php" into "home.drush" scope. [0.01 sec, 2.08 MB]                                                                                                                                      [bootstrap]
Cache HIT cid: 7.0-dev-commandfiles-0-04aa8a55c0831d749d0b0bbd12a55e56 [0.02 sec, 2.15 MB]                                                                                                                                            [debug]
Loaded alias @intranet.easme.cec.eu.int from file /home/idev/.drush/intranet.easme.cec.eu.int.alias.drushrc.php [0.18 sec, 7.13 MB]                                                                                                  [notice]
Cache SET cid: 7.0-dev-alias-path--a85b21fc86f449a1a33cf08d16d03a95 [0.19 sec, 7.13 MB]                                                                                                                                               [debug]
Loading drushrc "/var/aegir/platforms/intranet_v233/sites/all/drush/drushrc.php" into "drupal" scope. [0.19 sec, 7.13 MB]                                                                                                         [bootstrap]
Loading drushrc "/var/aegir/platforms/intranet_v233/sites/all/drush/drushrc.php" into "drupal" scope. [0.2 sec, 8.57 MB]                                                                                                          [bootstrap]
Bootstrap to phase 0. [0.21 sec, 8.58 MB]                                                                                                                                                                                         [bootstrap]
Bootstrap to phase 1. [0.21 sec, 8.58 MB]                                                                                                                                                                                         [bootstrap]
Drush bootstrap phase : bootstrap_drupal_root() [0.21 sec, 8.59 MB]                                                                                                                                                               [bootstrap]
Loading drushrc "/var/aegir/platforms/intranet_v233/sites/all/drush/drushrc.php" into "drupal" scope. [0.21 sec, 8.59 MB]                                                                                                         [bootstrap]
Initialized Drupal 7.36 root directory at /var/aegir/platforms/intranet_v233 [0.23 sec, 8.93 MB]                                                                                                                                     [notice]
Find command files for phase 1 (max=1) [0.23 sec, 6.76 MB]                                                                                                                                                                            [debug]
Cache HIT cid: 7.0-dev-commandfiles-1-704c5c1824e438737d5ae88f1bb3f352 [0.23 sec, 6.77 MB]                                                                                                                                            [debug]
Found command: provision-clone (commandfile=provision) [0.23 sec, 6.76 MB]                                                                                                                                                        [bootstrap]
Bootstrap to phase 1. [0.23 sec, 6.77 MB]                                                                                                                                                                                         [bootstrap]
Loaded alias @server_seciiproeasmececeuint from file /home/idev/.drush/server_seciiproeasmececeuint.alias.drushrc.php [0.31 sec, 9.01 MB]                                                                                            [notice]
Loaded alias @server_master from file /home/idev/.drush/server_master.alias.drushrc.php [0.32 sec, 9.03 MB]                                                                                                                          [notice]
Loading mysql driver for the db service [0.32 sec, 9.14 MB]                                                                                                                                                                          [notice]
Loading apache driver for the http service [0.32 sec, 9.21 MB]                                                                                                                                                                       [notice]
Loading mysql driver for the db service [0.32 sec, 9.23 MB]                                                                                                                                                                          [notice]
Loading apache driver for the http service [0.33 sec, 9.23 MB]                                                                                                                                                                       [notice]
Loaded alias @platform_Intranetv233 from file /home/idev/.drush/platform_Intranetv233.alias.drushrc.php [0.33 sec, 9.24 MB]                                                                                                          [notice]
Including /home/idev/.drush/provision/db/clone.provision.inc [0.33 sec, 9.25 MB]                                                                                                                                                  [bootstrap]
Including /home/idev/.drush/provision/platform/clone.provision.inc [0.33 sec, 9.25 MB]                                                                                                                                            [bootstrap]
Calling hook drush_db_provision_clone_validate [0.33 sec, 9.28 MB]                                                                                                                                                                    [debug]
Returned from hook drush_db_provision_clone_validate [0.34 sec, 9.29 MB]                                                                                                                                                              [debug]
Calling hook drush_provision_drupal_provision_clone_validate [0.34 sec, 9.29 MB]                                                                                                                                                      [debug]
Drush bootstrap phase : bootstrap_drupal_site() [0.34 sec, 9.3 MB]                                                                                                                                                                [bootstrap]
Loading drushrc "/var/aegir/platforms/intranet_v233/sites/intranet.easme.cec.eu.int/drushrc.php" into "site" scope. [0.34 sec, 9.3 MB]                                                                                            [bootstrap]
Initialized Drupal site intranet.easme.cec.eu.int at sites/intranet.easme.cec.eu.int [0.34 sec, 9.31 MB]                                                                                                                             [notice]
Find command files for phase 2 (max=) [0.35 sec, 7.09 MB]                                                                                                                                                                             [debug]
Cache HIT cid: 7.0-dev-install_profile-2c918b45ece497c6f66473d1e3db1e62 [0.35 sec, 7.09 MB]                                                                                                                                           [debug]
Cache HIT cid: 7.0-dev-commandfiles-2-14ea69094027b09e1a14f6db789a4537 [0.35 sec, 7.1 MB]                                                                                                                                             [debug]
Returned from hook drush_provision_drupal_provision_clone_validate [0.37 sec, 8.03 MB]                                                                                                                                                [debug]
Calling hook drush_provision_drupal_pre_provision_clone [0.37 sec, 8.04 MB]                                                                                                                                                           [debug]
Bootstrap to phase 1. [0.46 sec, 11.05 MB]                                                                                                                                                                                        [bootstrap]
Including /home/idev/.drush/provision/db/backup.provision.inc [0.46 sec, 11.06 MB]                                                                                                                                                [bootstrap]
Including /home/idev/.drush/provision/platform/backup.provision.inc [0.46 sec, 11.07 MB]                                                                                                                                          [bootstrap]
Calling hook drush_provision_drupal_provision_backup_validate [0.46 sec, 11.13 MB]                                                                                                                                                    [debug]
Drush bootstrap phase : bootstrap_drupal_configuration() [0.46 sec, 11.13 MB]                                                                                                                                                     [bootstrap]
Find command files for phase 3 (max=) [0.47 sec, 11.1 MB]                                                                                                                                                                             [debug]
Site was not found. [0.47 sec, 11.1 MB]                                                                                                                                                                                           [error]
Returned from hook drush_provision_drupal_provision_backup_validate [0.47 sec, 11.11 MB]                                                                                                                                              [debug]
Command dispatch complete [0.47 sec, 11.07 MB]                                                                                                                                                                                       [notice]
Returned from hook drush_provision_drupal_pre_provision_clone [0.47 sec, 8.1 MB]                                                                                                                                                      [debug]
Removed unused clone site package [0.47 sec, 8.18 MB]                                                                                                                                                                             [success]
Changes made in drush_provision_drupal_pre_provision_clone have been rolled back. [0.47 sec, 8.18 MB]                                                                                                                              [rollback]
Command dispatch complete [0.47 sec, 8.13 MB]                                                                                                                                                                                        [notice]
 Timer  Cum (sec)  Count  Avg (msec)
 page   0.01       1      9.86
[idev@s-eci-idev ~]$ drush @sandbox.intranet.s-eci-idev.easme.cec.eu.int status
 Drupal version         :  7.36
 PHP executable         :  /usr/bin/php
 PHP configuration      :  /etc/php.ini
 PHP OS                 :  Linux
 Drush script           :  /opt/drush/lib/drush7/vendor/drush/drush/drush.php
 Drush version          :  7.0-dev
 Drush temp directory   :  /tmp
 Drush configuration    :  /var/aegir/platforms/platform_easmeintranet_master_234/sites/all/drush/drushrc.php /home/idev/.drush/drushrc.php
 Drush alias files      :  /home/idev/.drush/platform_openfed_master_55.alias.drushrc.php "
                           There are 85 more alias files. Run with --full to see the full list."
 Drupal root            :  /var/aegir/platforms/platform_easmeintranet_master_234

[idev@s-eci-idev ~]$

Comments

helmo’s picture

Not sure what is wrong here, but please checkout the sync task in hosting_tasks_extra it might be a good alternative.

npacker’s picture

Status: Active » Closed (works as designed)

It appears that the site you're attempting to clone isn't known by aegir - the drush alias is missing or the site simply doesn't exist. Note that the error is "site not found" in the delete task.

provision-delete and provision-clone work for me in my scripts with the latest Provision, so marking this as closed.