(初心者向け)vpsを契約して、Capistrano3でRailsアプリをデプロイするまで その2 ローカル設定編 - Qiitaを参考にさせていただき、アプリケーションのデプロイまで完了しました。
アプリを作る過程で何回かcapistaranoで自動デプロイできていたのですが、
$ bundle exec cap production deploy
をしたところ、ある日突然デプロイができなくなってしまいました。
エラー分でいろいろ調べたりしているのですが、なかなか見当がつかず....
エラーについて知見のある方いらっしゃいましたら、解決策をご教示いただけないでしょうか。 何卒よろしくお願いいたします。
エラー文
00:17 unicorn:restart
01 kill -s USR2 $(< /var/www/{アプリ名}/current/tmp/pids/unicorn.pid)
01 kill: sending signal to 4667 failed: そのようなプロセスはありません
#<Thread:0x00007f84d11495a8 /Users/{自分のユーザー名}/.anyenv/envs/rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/sshkit-1.21.0/lib/sshkit/runners/parallel.rb:10 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
10: from /Users/{自分のユーザー名}/.anyenv/envs/rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/sshkit-1.21.0/lib/sshkit/runners/parallel.rb:12:in block (2 levels) in execute' 9: from /Users/{自分のユーザー名}/.anyenv/envs/rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/sshkit-1.21.0/lib/sshkit/backends/abstract.rb:31:in
run'
8: from /Users/{自分のユーザー名}/.anyenv/envs/rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/sshkit-1.21.0/lib/sshkit/backends/abstract.rb:31:in instance_exec' 7: from /Users/{自分のユーザー名}/workspace/{アプリ名}/lib/capistrano/tasks/unicorn.rb:51:in
block (3 levels) in <top (required)>'
6: from /Users/{自分のユーザー名}/workspace/{アプリ名}/lib/capistrano/tasks/unicorn.rb:22:in reload_unicorn' 5: from /Users/{自分のユーザー名}/.anyenv/envs/rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/sshkit-1.21.0/lib/sshkit/backends/abstract.rb:80:in
execute'
4: from /Users/{自分のユーザー名}/.anyenv/envs/rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/sshkit-1.21.0/lib/sshkit/backends/abstract.rb:148:in create_command_and_execute' 3: from /Users/{自分のユーザー名}/.anyenv/envs/rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/sshkit-1.21.0/lib/sshkit/backends/abstract.rb:148:in
tap'
2: from /Users/{自分のユーザー名}/.anyenv/envs/rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/sshkit-1.21.0/lib/sshkit/backends/abstract.rb:148:in block in create_command_and_execute' 1: from /Users/{自分のユーザー名}/.anyenv/envs/rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/sshkit-1.21.0/lib/sshkit/backends/netssh.rb:170:in
execute_command'
/Users/{自分のユーザー名}/.anyenv/envs/rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/sshkit-1.21.0/lib/sshkit/command.rb:97:in exit_status=': kill exit status: 1 (SSHKit::Command::Failed) kill stdout: Nothing written kill stderr: kill: sending signal to 4667 failed: そのようなプロセスはありません 1: from /Users/{自分のユーザー名}/.anyenv/envs/rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/sshkit-1.21.0/lib/sshkit/runners/parallel.rb:11:in
block (2 levels) in execute'
/Users/{自分お}/.anyenv/envs/rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/sshkit-1.21.0/lib/sshkit/runners/parallel.rb:15:in `rescue in block (2 levels) in execute': Exception while executing as {ユーザー名}@{VPSのIP}: kill exit status: 1 (SSHKit::Runner::ExecuteError)
kill stdout: Nothing written
kill stderr: kill: sending signal to 4667 failed: そのようなプロセスはありません
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as {ユーザー名}@{VPSのIP}: kill exit status: 1
kill stdout: Nothing written
kill stderr: kill: sending signal to 4667 failed: そのようなプロセスはありません
Caused by:
SSHKit::Command::Failed: kill exit status: 1
kill stdout: Nothing written
kill stderr: kill: sending signal to 4667 failed: そのようなプロセスはありません
/Users/{自分の}/workspace/{アプリ名}/lib/capistrano/tasks/unicorn.rb:22:in reload_unicorn' /Users/{自分のユーザー名}/workspace/{アプリ名}/lib/capistrano/tasks/unicorn.rb:51:in
block (3 levels) in <top (required)>'
Tasks: TOP => unicorn:restart
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing as {ユーザー名}@{VPSのIP}: kill exit status: 1
kill stdout: Nothing written
kill stderr: kill: sending signal to 4667 failed: そのようなプロセスはありません
** DEPLOY FAILED
** Refer to log/capistrano.log for details. Here are the last 20 lines:
/var/www/{アプリ名}/shared/bundle/ruby/2.7.0/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/query_cache.rb:95: warning: The called method `select_all' is defined here
DEBUG [31ba97dd] /var/www/{アプリ名}/shared/bundle/ruby/2.7.0/gems/activerecord-5.2.4.3/lib/active_record/transactions.rb:212: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/var/www/{アプリ名}/shared/bundle/ruby/2.7.0/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/database_statements.rb:260: warning: The called method `transaction' is defined here
/var/www/{アプリ名}/shared/bundle/ruby/2.7.0/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/transaction.rb:171: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/var/www/{アプリ名}/shared/bundle/ruby/2.7.0/gems/activerecord-5.2.4.3/lib/active_record/connection_adapters/abstract/transaction.rb:97: warning: The called method `initialize' is defined here
DEBUG [31ba97dd] /var/www/{アプリ名}/shared/bundle/ruby/2.7.0/gems/activerecord-5.2.4.3/lib/active_record/persistence.rb:705: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/var/www/{アプリ名}/shared/bundle/ruby/2.7.0/gems/activerecord-5.2.4.3/lib/active_record/timestamp.rb:105: warning: The called method `_update_record' is defined here
INFO [31ba97dd] Finished in 1.576 seconds with exit status 0 (successful).
INFO [a4af0fe4] Running /usr/bin/env ln -s /var/www/{アプリ名}/releases/20200828065236 /var/www/{アプリ名}/releases/current as {ユーザー名}@{VPSのIP}
DEBUG [a4af0fe4] Command: ( export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.7.0" ; /usr/bin/env ln -s /var/www/{アプリ名}/releases/20200828065236 /var/www/{アプリ名}/releases/current )
INFO [a4af0fe4] Finished in 0.099 seconds with exit status 0 (successful).
INFO [2f1ad773] Running /usr/bin/env mv /var/www/{アプリ名}/releases/current /var/www/{アプリ名} as {ユーザー名}@{VPSのIP}
DEBUG [2f1ad773] Command: ( export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.7.0" ; /usr/bin/env mv /var/www/{アプリ名}/releases/current /var/www/{アプリ名} )
INFO [2f1ad773] Finished in 0.120 seconds with exit status 0 (successful).
DEBUG [110d8972] Running [ -f /var/www/{アプリ名}/current/tmp/pids/unicorn.pid ] as {ユーザー名}@{VPSのIP}
DEBUG [110d8972] Command: [ -f /var/www/{アプリ名}/current/tmp/pids/unicorn.pid ]
DEBUG [110d8972] Finished in 0.122 seconds with exit status 0 (successful).
INFO [1a847683] Running /usr/bin/env kill -s USR2 $(< /var/www/{アプリ名}/current/tmp/pids/unicorn.pid) as {ユーザー名}@{VPSのIP}
DEBUG [1a847683] Command: ( export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.7.0" ; /usr/bin/env kill -s USR2 $(< /var/www/{アプリ名}/current/tmp/pids/unicorn.pid) )
DEBUG [1a847683] kill: sending signal to 4667 failed: そのようなプロセスはありません
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/08/28 13:36
2020/08/28 13:47
2020/08/28 15:43