前提・実現したいこと
自動デプロイの実行
ご教授何卒よろしくお願いします。
ここに質問の内容を詳しく書いてください。
Railsでチャット機能があるアプリを作っています。
capistranoによる自動デプロイ機能を実装中に以下のエラーメッセージが発生しました。
発生している問題・エラーメッセージ
master failed to start, check stderr log for details #<Thread:***************@/Users/<ユーザー名>/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sshkit-1.20.0/lib/sshkit/runners/parallel.rb:10 run> terminated with exception (report_on_exception is true): Traceback (most recent call last): 1: from /Users/<ユーザー名>/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sshkit-1.20.0/lib/sshkit/runners/parallel.rb:11:in `block (2 levels) in execute' /Users/<ユーザー名>/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sshkit-1.20.0/lib/sshkit/runners/parallel.rb:15:in `rescue in block (2 levels) in execute': Exception while executing as ec2-user@<IP>: bundle exit status: 1 (SSHKit::Runner::ExecuteError) bundle stdout: Nothing written bundle stderr: master failed to start, check stderr log for details (Backtrace restricted to imported tasks) cap aborted! SSHKit::Runner::ExecuteError: Exception while executing as ec2-user@<IP>: bundle exit status: 1 bundle stdout: Nothing written bundle stderr: master failed to start, check stderr log for details Caused by: SSHKit::Command::Failed: bundle exit status: 1 bundle stdout: Nothing written bundle stderr: master failed to start, check stderr log for details Tasks: TOP => unicorn:start (See full trace by running task with --trace) The deploy has failed with an error: Exception while executing as ec2-user@52.199.234.141: bundle exit status: 1 bundle stdout: Nothing written bundle stderr: master failed to start, check stderr log for details
該当のソースコード
unicorn.rb
1app_path = File.expand_path('../../../', __FILE__) 2 3worker_processes 1 4 5working_directory "#{app_path}/current" 6 7pid "#{app_path}/shared/tmp/pids/unicorn.pid" 8listen "#{app_path}/shared/tmp/sockets/unicorn.sock" 9stderr_path "#{app_path}/shared/log/unicorn.stderr.log" 10stdout_path "#{app_path}/shared/log/unicorn.stdout.log" 11 12timeout 60 13 14 15preload_app true 16GC.respond_to?(:copy_on_write_friendly=) && GC.copy_on_write_friendly = true 17 18check_client_connection false 19 20run_once = true 21 22before_fork do |server, worker| 23 defined?(ActiveRecord::Base) && 24 ActiveRecord::Base.connection.disconnect! 25 26 if run_once 27 run_once = false # prevent from firing again 28 end 29 30 old_pid = "#{server.config[:pid]}.oldbin" 31 if File.exist?(old_pid) && server.pid != old_pid 32 begin 33 sig = (worker.nr + 1) >= server.worker_processes ? :QUIT : :TTOU 34 Process.kill(sig, File.read(old_pid).to_i) 35 rescue Errno::ENOENT, Errno::ESRCH => e 36 logger.error e 37 end 38 end 39end 40 41after_fork do |_server, _worker| 42 defined?(ActiveRecord::Base) && ActiveRecord::Base.establish_connection 43end
試したこと
バケット名の確認
Nginxの再起動
Unicornの再起動
Unicornのエラーログの確認
cat /var/www/(アプリ名)/current/log/unicorn.stderr.log
bundler: failed to load command: unicorn (/var/www/(アプリ名)/shared/bundle/ruby/2.5.0/bin/unicorn) ArgumentError: Missing required arguments: aws_access_key_id, aws_secret_access_key
補足情報(FW/ツールのバージョンなど)
Rails 5.0.7.2
毎度unicorn:startでエラーが出てしまいます。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。