2016-09-29 3 views
0

Я пытаюсь развернуть проект на нашем производственном сервере, как я уже делал несколько раз раньше, но, похоже, на компиляторе происходит провал: запустите шаг установки.создание крышки не работает на композиторе: запустите install

Я бегу cap production deploy:check и все отлично. Я затем запустить cap production deploy --trace, который возвращает следующую ошибку, когда он достигает композитор: бежать шаг:

>** Invoke deploy:updated (first_time) 
>** Invoke composer:install (first_time) 
>** Execute composer:install 
>** Invoke composer:run (first_time) 
>** Execute composer:run 
>00:13 composer:run 
>  01 composer install --no-dev --prefer-dist --no-interaction --quiet --optimize-autoloader 
>  01 stdin: is not a tty 
>cap aborted! 
>SSHKit::Runner::ExecuteError: Exception while executing as [email protected]: >composer exit status: 1 
>composer stdout: Nothing written 
>composer stderr: stdin: is not a tty 
>/Library/Ruby/Gems/2.0.0/gems/sshkit->1.11.1/lib/sshkit/runners/parallel.rb:15:in `rescue in block (2 levels) in >execute' 
>/Library/Ruby/Gems/2.0.0/gems/sshkit->1.11.1/lib/sshkit/runners/parallel.rb:11:in `block (2 levels) in execute' 
>SSHKit::Command::Failed: composer exit status: 1 
>composer stdout: Nothing written 
>composer stderr: stdin: is not a tty 
>/Library/Ruby/Gems/2.0.0/gems/sshkit-1.11.1/lib/sshkit/command.rb:100:in >`exit_status=' 
>/Library/Ruby/Gems/2.0.0/gems/sshkit->1.11.1/lib/sshkit/backends/netssh.rb:148:in `execute_command' 
>/Library/Ruby/Gems/2.0.0/gems/sshkit->1.11.1/lib/sshkit/backends/abstract.rb:141:in `block in >create_command_and_execute' 
>/Library/Ruby/Gems/2.0.0/gems/sshkit->1.11.1/lib/sshkit/backends/abstract.rb:141:in `tap' 
>/Library/Ruby/Gems/2.0.0/gems/sshkit->1.11.1/lib/sshkit/backends/abstract.rb:141:in `create_command_and_execute' 
>/Library/Ruby/Gems/2.0.0/gems/sshkit->1.11.1/lib/sshkit/backends/abstract.rb:74:in `execute' 
>/Library/Ruby/Gems/2.0.0/gems/capistrano-composer->0.0.6/lib/capistrano/tasks/composer.rake:27:in `block (4 levels) in <top >(required)>' 
>/Library/Ruby/Gems/2.0.0/gems/sshkit->1.11.1/lib/sshkit/backends/abstract.rb:85:in `within' 
>/Library/Ruby/Gems/2.0.0/gems/capistrano-composer->0.0.6/lib/capistrano/tasks/composer.rake:26:in `block (3 levels) in <top >(required)>' 
>/Library/Ruby/Gems/2.0.0/gems/sshkit->1.11.1/lib/sshkit/backends/abstract.rb:29:in `instance_exec' 
>/Library/Ruby/Gems/2.0.0/gems/sshkit->1.11.1/lib/sshkit/backends/abstract.rb:29:in `run' 
>/Library/Ruby/Gems/2.0.0/gems/sshkit->1.11.1/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute' 
>Tasks: TOP => composer:run 
>The deploy has failed with an error: Exception while executing as >[email protected]: composer exit status: 1 
>composer stdout: Nothing written 
>composer stderr: stdin: is not a tty 
>** Invoke deploy:failed (first_time) 
>** Execute deploy:failed 

Я попытался глядя вверх этот статус выхода композитора: 1, и это, кажется, просто общая ошибка.

У меня есть ssh'd для производственного сервера, и кажется, что cap успешно создает папку выпуска и вытаскивает файлы из репо. Ошибка возникает при установке зависимостей.

Я немного потерял способ решить эту проблему. Большинство других потоков, которые я нашел, похоже, содержат более информативные сообщения об ошибках.

Capistrano журнала ниже:

INFO --------------------------------------------------------------------------- 
INFO START 2016-09-30 09:25:00 -0230 cap production deploy 
INFO --------------------------------------------------------------------------- 
INFO [f3a390e9] Running /usr/bin/env mkdir -p /home/USER/capistrano_tmp as [email protected] 
DEBUG [f3a390e9] Command: (export WP_ENV="staging" ; /usr/bin/env mkdir -p /home/USER/capistrano_tmp) 
INFO [f3a390e9] Finished in 2.175 seconds with exit status 0 (successful). 
DEBUG Uploading /home/USER/capistrano_tmp/git-ssh-banl-production-MK.sh 0.0% 
INFO Uploading /home/USER/capistrano_tmp/git-ssh-banl-production-MK.sh 100.0% 
INFO [523fe25b] Running /usr/bin/env chmod 700 /home/USER/capistrano_tmp/git-ssh-banl-production-MK.sh as [email protected] 
DEBUG [523fe25b] Command: (export WP_ENV="staging" ; /usr/bin/env chmod 700 /home/USER/capistrano_tmp/git-ssh-banl-production-MK.sh) 
INFO [523fe25b] Finished in 0.125 seconds with exit status 0 (successful). 
INFO [257d5c05] Running /usr/bin/env git ls-remote --heads $GIT_REPO as [email protected] 
DEBUG [257d5c05] Command: (export WP_ENV="staging" GIT_ASKPASS="/bin/echo" GIT_SSH="/home/USER/capistrano_tmp/git-ssh-banl-production-MK.sh" ; /usr/bin/env git ls-remote --heads $GIT_REPO) 
DEBUG [257d5c05] a9bd8b177eb5287fa6b968c2a92207c1c25e8bf4 refs/heads/master 
INFO [257d5c05] Finished in 6.650 seconds with exit status 0 (successful). 
INFO [63f0ffa5] Running /usr/bin/env mkdir -p /home/USER/public_html/shared /home/USER/public_html/releases as [email protected] 
DEBUG [63f0ffa5] Command: (export WP_ENV="staging" ; /usr/bin/env mkdir -p /home/USER/public_html/shared /home/USER/public_html/releases) 
INFO [63f0ffa5] Finished in 0.124 seconds with exit status 0 (successful). 
INFO [f7a9eb45] Running /usr/bin/env mkdir -p /home/USER/public_html/shared/web/app/uploads as [email protected] 
DEBUG [f7a9eb45] Command: (export WP_ENV="staging" ; /usr/bin/env mkdir -p /home/USER/public_html/shared/web/app/uploads) 
INFO [f7a9eb45] Finished in 0.123 seconds with exit status 0 (successful). 
INFO [ce8a26f9] Running /usr/bin/env mkdir -p /home/USER/public_html/shared as [email protected] 
DEBUG [ce8a26f9] Command: (export WP_ENV="staging" ; /usr/bin/env mkdir -p /home/USER/public_html/shared) 
INFO [ce8a26f9] Finished in 0.123 seconds with exit status 0 (successful). 
DEBUG [0f2919f9] Running [ -f /home/USER/public_html/shared/.env ] as [email protected] 
DEBUG [0f2919f9] Command: [ -f /home/USER/public_html/shared/.env ] 
DEBUG [0f2919f9] Finished in 0.123 seconds with exit status 0 (successful). 
DEBUG [0a95dd46] Running [ -f /home/USER/public_html/current/REVISION ] as [email protected] 
DEBUG [0a95dd46] Command: [ -f /home/USER/public_html/current/REVISION ] 
DEBUG [0a95dd46] Finished in 0.123 seconds with exit status 1 (failed). 
DEBUG [ca7de6e3] Running [ -f /home/USER/public_html/repo/HEAD ] as [email protected] 
DEBUG [ca7de6e3] Command: [ -f /home/USER/public_html/repo/HEAD ] 
DEBUG [ca7de6e3] Finished in 0.122 seconds with exit status 0 (successful). 
INFO The repository mirror is at /home/USER/public_html/repo 
DEBUG [5efe620a] Running if test ! -d /home/USER/public_html/repo; then echo "Directory does not exist '/home/USER/public_html/repo'" 1>&2; false; fi as [email protected] 
DEBUG [5efe620a] Command: if test ! -d /home/USER/public_html/repo; then echo "Directory does not exist '/home/USER/public_html/repo'" 1>&2; false; fi 
DEBUG [5efe620a] Finished in 0.123 seconds with exit status 0 (successful). 
INFO [b0a1ad08] Running /usr/bin/env git remote update --prune as [email protected] 
DEBUG [b0a1ad08] Command: cd /home/USER/public_html/repo && (export WP_ENV="staging" GIT_ASKPASS="/bin/echo" GIT_SSH="/home/USER/capistrano_tmp/git-ssh-banl-production-MK.sh" ; /usr/bin/env git remote update --prune) 
DEBUG [b0a1ad08] Fetching origin 
INFO [b0a1ad08] Finished in 5.040 seconds with exit status 0 (successful). 
DEBUG [6d7e14fa] Running if test ! -d /home/USER/public_html/repo; then echo "Directory does not exist '/home/USER/public_html/repo'" 1>&2; false; fi as [email protected] 
DEBUG [6d7e14fa] Command: if test ! -d /home/USER/public_html/repo; then echo "Directory does not exist '/home/USER/public_html/repo'" 1>&2; false; fi 
DEBUG [6d7e14fa] Finished in 0.123 seconds with exit status 0 (successful). 
INFO [0c8f006e] Running /usr/bin/env mkdir -p /home/USER/public_html/releases/20160930115512 as [email protected] 
DEBUG [0c8f006e] Command: cd /home/USER/public_html/repo && (export WP_ENV="staging" GIT_ASKPASS="/bin/echo" GIT_SSH="/home/USER/capistrano_tmp/git-ssh-banl-production-MK.sh" ; /usr/bin/env mkdir -p /home/USER/public_html/releases/20160930115512) 
INFO [0c8f006e] Finished in 0.125 seconds with exit status 0 (successful). 
INFO [a31715de] Running /usr/bin/env git archive master | tar -x -f - -C /home/USER/public_html/releases/20160930115512 as [email protected] 
DEBUG [a31715de] Command: cd /home/USER/public_html/repo && (export WP_ENV="staging" GIT_ASKPASS="/bin/echo" GIT_SSH="/home/USER/capistrano_tmp/git-ssh-banl-production-MK.sh" ; /usr/bin/env git archive master | tar -x -f - -C /home/USER/public_html/releases/20160930115512) 
INFO [a31715de] Finished in 0.158 seconds with exit status 0 (successful). 
DEBUG [e57ef477] Running if test ! -d /home/USER/public_html/repo; then echo "Directory does not exist '/home/USER/public_html/repo'" 1>&2; false; fi as [email protected] 
DEBUG [e57ef477] Command: if test ! -d /home/USER/public_html/repo; then echo "Directory does not exist '/home/USER/public_html/repo'" 1>&2; false; fi 
DEBUG [e57ef477] Finished in 0.124 seconds with exit status 0 (successful). 
DEBUG [cea943e0] Running /usr/bin/env git rev-list --max-count=1 master as [email protected] 
DEBUG [cea943e0] Command: cd /home/USER/public_html/repo && (export WP_ENV="staging" GIT_ASKPASS="/bin/echo" GIT_SSH="/home/USER/capistrano_tmp/git-ssh-banl-production-MK.sh" ; /usr/bin/env git rev-list --max-count=1 master) 
DEBUG [cea943e0] a9bd8b177eb5287fa6b968c2a92207c1c25e8bf4 
DEBUG [cea943e0] Finished in 0.126 seconds with exit status 0 (successful). 
DEBUG [1759b360] Running if test ! -d /home/USER/public_html/releases/20160930115512; then echo "Directory does not exist '/home/USER/public_html/releases/20160930115512'" 1>&2; false; fi as [email protected] 
DEBUG [1759b360] Command: if test ! -d /home/USER/public_html/releases/20160930115512; then echo "Directory does not exist '/home/USER/public_html/releases/20160930115512'" 1>&2; false; fi 
DEBUG [1759b360] Finished in 0.122 seconds with exit status 0 (successful). 
INFO [ae64693c] Running /usr/bin/env echo "a9bd8b177eb5287fa6b968c2a92207c1c25e8bf4" >> REVISION as [email protected] 
DEBUG [ae64693c] Command: cd /home/USER/public_html/releases/20160930115512 && (export WP_ENV="staging" ; /usr/bin/env echo "a9bd8b177eb5287fa6b968c2a92207c1c25e8bf4" >> REVISION) 
INFO [ae64693c] Finished in 0.132 seconds with exit status 0 (successful). 
INFO [e9cce54e] Running /usr/bin/env mkdir -p /home/USER/public_html/releases/20160930115512 as [email protected] 
DEBUG [e9cce54e] Command: (export WP_ENV="staging" ; /usr/bin/env mkdir -p /home/USER/public_html/releases/20160930115512) 
INFO [e9cce54e] Finished in 0.123 seconds with exit status 0 (successful). 
DEBUG [db1a3471] Running [ -L /home/USER/public_html/releases/20160930115512/.env ] as [email protected] 
DEBUG [db1a3471] Command: [ -L /home/USER/public_html/releases/20160930115512/.env ] 
DEBUG [db1a3471] Finished in 0.123 seconds with exit status 1 (failed). 
DEBUG [848e8fe8] Running [ -f /home/USER/public_html/releases/20160930115512/.env ] as [email protected] 
DEBUG [848e8fe8] Command: [ -f /home/USER/public_html/releases/20160930115512/.env ] 
DEBUG [848e8fe8] Finished in 0.121 seconds with exit status 1 (failed). 
INFO [7d1f7edd] Running /usr/bin/env ln -s /home/USER/public_html/shared/.env /home/USER/public_html/releases/20160930115512/.env as [email protected] 
DEBUG [7d1f7edd] Command: (export WP_ENV="staging" ; /usr/bin/env ln -s /home/USER/public_html/shared/.env /home/USER/public_html/releases/20160930115512/.env) 
INFO [7d1f7edd] Finished in 0.122 seconds with exit status 0 (successful). 
INFO [10b70c5d] Running /usr/bin/env mkdir -p /home/USER/public_html/releases/20160930115512/web/app as [email protected] 
DEBUG [10b70c5d] Command: (export WP_ENV="staging" ; /usr/bin/env mkdir -p /home/USER/public_html/releases/20160930115512/web/app) 
INFO [10b70c5d] Finished in 0.123 seconds with exit status 0 (successful). 
DEBUG [880e8bc2] Running [ -L /home/USER/public_html/releases/20160930115512/web/app/uploads ] as [email protected] 
DEBUG [880e8bc2] Command: [ -L /home/USER/public_html/releases/20160930115512/web/app/uploads ] 
DEBUG [880e8bc2] Finished in 0.123 seconds with exit status 1 (failed). 
DEBUG [349e1b98] Running [ -d /home/USER/public_html/releases/20160930115512/web/app/uploads ] as [email protected] 
DEBUG [349e1b98] Command: [ -d /home/USER/public_html/releases/20160930115512/web/app/uploads ] 
DEBUG [349e1b98] Finished in 0.121 seconds with exit status 0 (successful). 
INFO [8045d8e0] Running /usr/bin/env rm -rf /home/USER/public_html/releases/20160930115512/web/app/uploads as [email protected] 
DEBUG [8045d8e0] Command: (export WP_ENV="staging" ; /usr/bin/env rm -rf /home/USER/public_html/releases/20160930115512/web/app/uploads) 
INFO [8045d8e0] Finished in 0.125 seconds with exit status 0 (successful). 
INFO [07a69ec8] Running /usr/bin/env ln -s /home/USER/public_html/shared/web/app/uploads /home/USER/public_html/releases/20160930115512/web/app/uploads as [email protected] 
DEBUG [07a69ec8] Command: (export WP_ENV="staging" ; /usr/bin/env ln -s /home/USER/public_html/shared/web/app/uploads /home/USER/public_html/releases/20160930115512/web/app/uploads) 
INFO [07a69ec8] Finished in 0.124 seconds with exit status 0 (successful). 
DEBUG [ca95f29d] Running if test ! -d /home/USER/public_html/releases/20160930115512; then echo "Directory does not exist '/home/USER/public_html/releases/20160930115512'" 1>&2; false; fi as [email protected] 
DEBUG [ca95f29d] Command: if test ! -d /home/USER/public_html/releases/20160930115512; then echo "Directory does not exist '/home/USER/public_html/releases/20160930115512'" 1>&2; false; fi 
DEBUG [ca95f29d] Finished in 0.122 seconds with exit status 0 (successful). 
INFO [ee024dad] Running /usr/bin/env composer install --no-dev --prefer-dist --no-interaction --quiet --optimize-autoloader as [email protected] 
DEBUG [ee024dad] Command: cd /home/USER/public_html/releases/20160930115512 && (export WP_ENV="staging" ; /usr/bin/env composer install --no-dev --prefer-dist --no-interaction --quiet --optimize-autoloader) 
+0

Выяснение проблемы: Одна из моих зависимостей плагина в файле composer.json вызывала ошибку установки, потому что композитор не смог найти репо. Запуск 'composer install' ПОСЛЕ' composer clearcache' выявил проблему. 'composer clearcache' важен здесь, потому что он заставляет' comopser install' захватывать плагины из своих соответствующих репозиториев. Поскольку плагины были загружены из кеша на локальном dev, поэтому я никогда не видел ошибку локально. – user6899758

ответ

0

Соответствующее сообщение об ошибке:

STDIN: не TTY

Это, вероятно, означает, что композитор ожидает интерактивный пользовательский ввод. Я не знаком с композитором, но, похоже, это объясняет, почему неинтерактивное развертывание Capistrano выходит из строя, но вы можете запустить команду через интерактивный сеанс SSH.

Вы можете попробовать добавить это к вашему Capistrano deploy.rb:

set :pty, true 

Это говорит Capistrano использовать псевдо-терминал, который может быть достаточно, чтобы сделать композитор счастливым.

+0

Я попытался добавить 'set: pty, true' в файл deploy.rb, но ошибка по-прежнему сохраняется. Я не думаю, что взаимодействие является проблемой, но команда композитора, которая запускается, - это 'comper install --no-dev --prefer-dist --no -action --quiet --optimize-autoloader', которая имеет --no-флажок взаимодействия. – user6899758