fortrabbit / craft-copy

Deployment tools for Craft on fortrabbit
https://www.fortrabbit.com
MIT License
73 stars 8 forks source link

copy fails to install on fortrabbit server #26

Closed andreimoment closed 4 years ago

andreimoment commented 6 years ago

Here are the errors I am getting

copy plugin cannot be installed on remote

Any way you could help resolve this?

Thank you!

Select a remote [***]:
  [origin    ] ***
  [production] ***@deploy.us1.frbit.com:appname.git
 > production

 ░
 ░ [NOTE] Uncommitted changes:
 ░         M composer.json
 ░         M composer.lock
 ░
 ░

 Enter a commit message, or leave it empty to abort the commit:
 > added fortrabbit copy plugin

git push (added fortrabbit copy plugin)
---------------------------------------

Commit received, starting build of branch master

–––––––––––––––––––––––  ∙ƒ  –––––––––––––––––––––––

B U I L D

Checksum:
  d5a819ce2f84836b8ea24969d81b88eb225ae892

Deployment file:
  not found

Pre-script:
  not found
  0ms

Composer:
  - - -
  Loading composer repositories with package information
  Installing dependencies (including require-dev) from lock file
  Package operations: 5 installs, 1 update, 0 removals
    - Updating symfony/process (v3.3.6 => v4.1.7): Downloading (100%)
    - Installing ostark/yii2-artisan-bridge (1.2.0): Downloading (100%)
    - Installing symfony/event-dispatcher (v4.1.7): Downloading (100%)
    - Installing cpliakas/git-wrapper (v2.0.1): Downloading (100%)
    - Installing albertofem/rsync-lib (1.0.0): Downloading (100%)
    - Installing fortrabbit/craft-copy (1.0.0-beta5): Downloading (100%)
  symfony/event-dispatcher suggests installing symfony/dependency-injection
  symfony/event-dispatcher suggests installing symfony/http-kernel
  Generating optimized autoload files
  > php craft migrate/all

  Yii Migration Tool (based on Yii v2.0.15.1)

  Migrated up successfully.

  - - -
  3s 206ms

Post-script:
  not found
  0ms

R E L E A S E

Packaging:
  2s 217ms

Revision:
  1541724681648920220.d5a819ce2f84836b8ea24969d81b88eb225ae892

Size:
  30 MB

Uploading:
  920ms

Build & release done in 6s 358ms, now queued for final distribution.

–––––––––––––––––––––––  ∙ƒ  –––––––––––––––––––––––

To deploy.us1.frbit.com:appname.git
   d47d61b..d5a819c  master -> master

 [OK] Code deployed successfully.

         –––––––––––––––––––––––  ∙ƒ

         fortrabbit\Copy\exceptions\RemoteException

         in /Users/andrei/Desktop/work/sites/appnames/vendor/fortrabbit/craft-copy/src/services/Ssh.php: 69

▓
▓  Stack trace:
▓
▓  #0 /vendor/fortrabbit/craft-copy/src/commands/SetupAction.php(160): fortrabbit\Copy\services\Ssh->exec('ssh
▓  sportschola...')
▓  #1 /vendor/fortrabbit/craft-copy/src/commands/SetupAction.php(83):
▓  fortrabbit\Copy\commands\SetupAction->setupRemote()
▓  #2 [internal function]: fortrabbit\Copy\commands\SetupAction->run()
▓  #3 /vendor/yiisoft/yii2/base/Action.php(94): call_user_func_array(Array, Array)
▓  #4 /vendor/yiisoft/yii2/base/Controller.php(157): yii\base\Action->runWithParams(Array)
▓  #5 /vendor/yiisoft/yii2/console/Controller.php(148): yii\base\Controller->runAction('setup', Array)
▓  #6 /vendor/yiisoft/yii2/base/Module.php(528): yii\console\Controller->runAction('setup', Array)
▓  #7 /vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('copy/setup', Array)
▓  #8 /vendor/yiisoft/yii2/console/Application.php(147): yii\console\Application->runAction('copy/setup', Array)
▓  #9 /vendor/yiisoft/yii2/base/Application.php(386):
▓  yii\console\Application->handleRequest(Object(craft\console\Request))
▓  #10 /craft(22): yii\base\Application->run()
▓  #11 {main}
▓

user:appnames andrei$ ./craft copy

Environment check
-----------------

+-----------------+--------------+--------------------------------------+----+
| Key             | Local        | Remote (App:appname)        |    |
+-----------------+--------------+--------------------------------------+----+
| ENVIRONMENT     | dev          | production                           | 👌  |
+-----------------+--------------+--------------------------------------+----+
| SECURITY_KEY    | q57O3******* | q57O3*******                         | 👌  |
+-----------------+--------------+--------------------------------------+----+
| DB_TABLE_PREFIX |              |                                      | 👌  |
| DB_SERVER       | localhost    | appname.mysql.us1.frbit.com | 👌  |
+-----------------+--------------+--------------------------------------+----+
user:appnames andrei$ ./craft copy/info

Environment check
-----------------

+-----------------+--------------+--------------------------------------+----+
| Key             | Local        | Remote (App:appname)        |    |
+-----------------+--------------+--------------------------------------+----+
| ENVIRONMENT     | dev          | production                           | 👌  |
+-----------------+--------------+--------------------------------------+----+
| SECURITY_KEY    | q57O3******* | q57O3*******                         | 👌  |
+-----------------+--------------+--------------------------------------+----+
| DB_TABLE_PREFIX |              |                                      | 👌  |
| DB_SERVER       | localhost    | appname.mysql.us1.frbit.com | 👌  |
+-----------------+--------------+--------------------------------------+----+
user:appnames andrei$ ./craft/copy/db/up
-bash: ./craft/copy/db/up: Not a directory
user:appnames andrei$ ./craft copy/db/up

Export local DB - import on remote: appname
----------------------------------------------------

 Are you sure? (yes/no) [yes]:
 >

Uploading dump to remote ./storage/craft-copy-transfer.sql
▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░  50 %
time:  2 secs/4 secs

 [ERROR] Plugin is not installed on remote.

         fortrabbit\Copy\exceptions\PluginNotInstalledException

         in /Users/andrei/Desktop/work/sites/appnames/vendor/fortrabbit/craft-copy/src/services/Ssh.php: 66

▓
▓  Stack trace:
▓
▓  #0 /vendor/fortrabbit/craft-copy/src/commands/DbUpAction.php(65): fortrabbit\Copy\services\Ssh->exec('ssh
▓  sportschola...')
▓  #1 [internal function]: fortrabbit\Copy\commands\DbUpAction->run()
▓  #2 /vendor/yiisoft/yii2/base/Action.php(94): call_user_func_array(Array, Array)
▓  #3 /vendor/yiisoft/yii2/base/Controller.php(157): yii\base\Action->runWithParams(Array)
▓  #4 /vendor/yiisoft/yii2/console/Controller.php(148): yii\base\Controller->runAction('db/up', Array)
▓  #5 /vendor/yiisoft/yii2/base/Module.php(528): yii\console\Controller->runAction('db/up', Array)
▓  #6 /vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('copy/db/up', Array)
▓  #7 /vendor/yiisoft/yii2/console/Application.php(147): yii\console\Application->runAction('copy/db/up', Array)
▓  #8 /vendor/yiisoft/yii2/base/Application.php(386):
▓  yii\console\Application->handleRequest(Object(craft\console\Request))
▓  #9 /craft(22): yii\base\Application->run()
▓  #10 {main}
▓

user:appnames andrei$
andreimoment commented 5 years ago

Hi My intention if I remember correctly was to copy the database between local and remote. Sometimes down, sometimes up.

You say the plugin should not be installed on remote — but any plugin gets installed on remote when I git push, correct? On Thu, Jan 17, 2019 at 5:18 AM Oliver Stark notifications@github.com wrote:

Closed #26 https://github.com/fortrabbit/craft-copy/issues/26.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/fortrabbit/craft-copy/issues/26#event-2080215985, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAYLqlM00oNKKe5nMfHdugHZso-WbLIks5vEHgWgaJpZM4YVxKB .

ostark commented 5 years ago

"installed" means two things:

1) the plugin code exist in your vendor folder 2) the plugin is enabled

if it is installed locally and your push your composer.lock, with the next composer install it gets installed via composer. Copy also tries to "enable" itself by running php craft install/plugin copy.

If the setup process is not completed for some reason, you can run the command on your own via ssh, or simply enable the plugin in the Craft admin on the remote App.