我试图将项目部署到我们的生产服务器,因为我之前已经做了好几次,但是它似乎在作曲家失败了:运行安装步骤。
我跑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 xxx@xxxx.xxx: >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 >xxx@xxxx.xxx: composer exit status: 1
>composer stdout: Nothing written
>composer stderr: stdin: is not a tty
>** Invoke deploy:failed (first_time)
>** Execute deploy:failed
我已经尝试查找此作曲家退出状态:1并且它似乎只是一般错误。
我已经到了生产服务器,似乎上限成功创建了一个发布文件夹,并从repo中拉下了文件。当它安装依赖项时,似乎会发生错误。
我对如何解决这个问题感到有点失落。我发现的大多数其他线程似乎都有一些更具信息性的错误消息。
下面的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 USER@xxxx.xx
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 USER@xxxx.xx
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 USER@xxxx.xx
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 USER@xxxx.xx
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 USER@xxxx.xx
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 USER@xxxx.xx
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 USER@xxxx.xx
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 USER@xxxx.xx
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 USER@xxxx.xx
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 USER@xxxx.xx
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 USER@xxxx.xx
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 USER@xxxx.xx
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 USER@xxxx.xx
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 USER@xxxx.xx
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 USER@xxxx.xx
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 USER@xxxx.xx
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 USER@xxxx.xx
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 USER@xxxx.xx
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 USER@xxxx.xx
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 USER@xxxx.xx
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 USER@xxxx.xx
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 USER@xxxx.xx
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 USER@xxxx.xx
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 USER@xxxx.xx
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 USER@xxxx.xx
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 USER@xxxx.xx
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 USER@xxxx.xx
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 USER@xxxx.xx
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 USER@xxxx.xx
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 :(得分:0)
相关的错误消息是:
stdin:不是tty
这可能意味着作曲家期待交互式用户输入。我对作曲家并不熟悉,但这似乎解释了为什么非交互式Capistrano部署失败但你能够通过交互式SSH会话运行命令。
您可以尝试将此添加到您的Capistrano deploy.rb
:
set :pty, true
这告诉Capistrano使用伪终端,这可能足以让作曲家高兴。