2016-09-29 3 views
0

Ich versuche, ein Projekt auf unserem Produktionsserver bereitzustellen, wie ich es schon mehrmals getan habe, aber es scheint auf dem Composer zu fehlen: run install Schritt.cap production deploy scheitert bei composer: run install

Ich laufe cap production deploy:check und alles ist großartig. Ich laufe dann cap production deploy --trace, die den folgenden Fehler zurückgibt, wenn es den Komponisten erreicht: run Schritt:

>** 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 

Ich habe versucht, diesen Komponisten Exit-Status aufzublicken: 1 und es scheint nur ein allgemeiner Fehler zu sein.

Ich habe ssh'd auf dem Produktionsserver, und es scheint Cap ist erfolgreich erstellen einen Freigabeordner und ziehen Sie die Dateien aus dem Repo. Der Fehler tritt auf, wenn Abhängigkeiten installiert werden.

Ich habe ein bisschen verloren, wie man das löst. Die meisten anderen Threads, die ich gefunden habe, schienen einige informativere Fehlermeldungen zu haben.

Capistrano log unter:

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

Problem festgestellt: Eine meiner Plugin-Abhängigkeiten in der Datei composer.json verursachte die Installation fehlgeschlagen, weil Composer den Repo nicht finden konnte. Das Ausführen von 'composer install' NACH' composer clearcache' enthüllte das Problem. 'composer clearcache' ist hier wichtig, weil es' comopser install' zwingt, die Plugins aus ihren jeweiligen Repos zu holen. Weil die Plugins aus dem Cache auf dem lokalen Dev geladen wurden, habe ich den Fehler nie lokal gesehen. – user6899758

Antwort

0

Die entsprechende Fehlermeldung lautet:

stdin: ist kein tty

Das bedeutet wahrscheinlich, dass Komponist interaktiven Benutzereingabe erwartet. Ich bin mit Composer nicht vertraut, aber dies scheint zu erklären, warum eine nicht interaktive Capistrano-Bereitstellung fehlschlägt, aber Sie den Befehl über eine interaktive SSH-Sitzung ausführen können.

könnten Sie versuchen, dies zu Ihrer Capistrano Hinzufügen deploy.rb:

set :pty, true 

Dies sagt Capistrano ein Pseudo-Terminal zu verwenden, die genug sein kann, Komponist glücklich zu machen.

+0

Ich habe versucht, "set: pty, true" zur Datei deploy.rb hinzuzufügen, der Fehler besteht jedoch weiterhin. Ich glaube nicht, dass die Interaktion das Problem ist, aber der Composer-Befehl, der ausgeführt wird, ist 'composer install - no-dev --prefer-dist -no-interaction --quiet --optimize-autoloader', der a --no-Interaktionsflag – user6899758

Verwandte Themen