質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Amazon EC2

Amazon EC2は“Amazon Elastic Compute Cloud”の略称です。Amazon Web Services(AWS)の一部であり、仮想化されたWebサーバーのコンピュータリソースをレンタルできるサービスです。

AWS(Amazon Web Services)

Amazon Web Services (AWS)は、仮想空間を機軸とした、クラスター状のコンピュータ・ネットワーク・データベース・ストーレッジ・サポートツールをAWSというインフラから提供する商用サービスです。

Q&A

解決済

1回答

1938閲覧

EC2にCapistranoを導入して自動デプロイの確認中にsshのエラーが発生しました。ssh-add -l で確認してもsshを確認することが出来ませんでした。

yutaro_0529

総合スコア12

Amazon EC2

Amazon EC2は“Amazon Elastic Compute Cloud”の略称です。Amazon Web Services(AWS)の一部であり、仮想化されたWebサーバーのコンピュータリソースをレンタルできるサービスです。

AWS(Amazon Web Services)

Amazon Web Services (AWS)は、仮想空間を機軸とした、クラスター状のコンピュータ・ネットワーク・データベース・ストーレッジ・サポートツールをAWSというインフラから提供する商用サービスです。

0グッド

0クリップ

投稿2020/11/10 07:12

編集2020/11/11 04:40

前提・実現したいこと

ここに質問の内容を詳しく書いてください。
Ruby on railsで個人アプリを制作し、
AWS EC2 に手動でデプロイできるようになり、
自動デプロイさせる最後の確認のため、bundle exec cap production deployを行うとエラーが発生しました。

■■な機能を実装中に以下のエラーメッセージが発生しました。

terminal

1uraokayuutarou@uraokayuutarou-no-MacBook nostalgia % raokayuutarou@uraokayuutarou-no-MacBook nostalgia % bundle exec cap production deploy 2#<Thread:0x00007fc402b5a6f8@/Users/uraokayuutarou/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sshkit-1.21.0/lib/sshkit/runners/parallel.rb:10 run> terminated with exception (report_on_exception is true): 3Traceback (most recent call last): 4 12: from /Users/uraokayuutarou/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sshkit-1.21.0/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute' 5 11: from /Users/uraokayuutarou/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sshkit-1.21.0/lib/sshkit/backends/abstract.rb:31:in `run' 6 10: from /Users/uraokayuutarou/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sshkit-1.21.0/lib/sshkit/backends/abstract.rb:31:in `instance_exec' 7 9: from /Users/uraokayuutarou/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/capistrano-rbenv-2.2.0/lib/capistrano/tasks/rbenv.rake:10:in `block (3 levels) in <top (required)>' 8 8: from /Users/uraokayuutarou/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sshkit-1.21.0/lib/sshkit/backends/abstract.rb:61:in `test' 9 7: from /Users/uraokayuutarou/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sshkit-1.21.0/lib/sshkit/backends/abstract.rb:148:in `create_command_and_execute' 10 6: from /Users/uraokayuutarou/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sshkit-1.21.0/lib/sshkit/backends/abstract.rb:148:in `tap' 11 5: from /Users/uraokayuutarou/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sshkit-1.21.0/lib/sshkit/backends/abstract.rb:148:in `block in create_command_and_execute' 12 4: from /Users/uraokayuutarou/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sshkit-1.21.0/lib/sshkit/backends/netssh.rb:130:in `execute_command' 13 3: from /Users/uraokayuutarou/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sshkit-1.21.0/lib/sshkit/backends/netssh.rb:177:in `with_ssh' 14 2: from /Users/uraokayuutarou/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sshkit-1.21.0/lib/sshkit/backends/connection_pool.rb:63:in `with' 15 1: from /Users/uraokayuutarou/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sshkit-1.21.0/lib/sshkit/backends/connection_pool.rb:63:in `call' 16/Users/uraokayuutarou/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/net-ssh-6.1.0/lib/net/ssh.rb:268:in `start': Authentication failed for user Yutaro.Uraoka@54.248.24.69 (Net::SSH::AuthenticationFailed) 17 1: from /Users/uraokayuutarou/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sshkit-1.21.0/lib/sshkit/runners/parallel.rb:11:in `block (2 levels) in execute' 18/Users/uraokayuutarou/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/sshkit-1.21.0/lib/sshkit/runners/parallel.rb:15:in `rescue in block (2 levels) in execute': Exception while executing as Yutaro.Uraoka@xx.xxx.xx.xx: Authentication failed for user Yutaro.Uraoka@xx.xxx.xx.xx (SSHKit::Runner::ExecuteError) 19(Backtrace restricted to imported tasks) 20cap aborted! 21SSHKit::Runner::ExecuteError: Exception while executing as Yutaro.Uraoka@xx.xxx.xx.xx: Authentication failed for user Yutaro.Uraoka@xx.xxx.xx.xx 22 23 24Caused by: 25Net::SSH::AuthenticationFailed: Authentication failed for user Yutaro.Uraoka@xx.xxx.xx.xx 26 27Tasks: TOP => rbenv:validate 28(See full trace by running task with --trace) 29uraokayuutarou@uraokayuutarou-no-MacBook nostalgia %

試したこと

まずMysquelに接続できていないかもとエラーログを確認し、
mariadbに接続し直しました。
その後のbundle exec cap production deployを行うと、
sshでエラーが発生しているとterminalをみて考え、
sshを追加しようと、ssh-add ~/.ssh/hoge.pemを実行してみましたが、
うまくいかず質問させていただきました。

ssh-copy-id を使用して登録しようとしても手動で登録しようとしてもうまくいきませんでした。
秘密鍵はキーペアで作成しているものの、公開鍵はどう設定して良いのかわからない状態で終了しています。

terminal

1uraokayuutarou@uraokayuutarou-no-MacBook .ssh % ssh -i xxxxxxxx.pem ec2-user@54.248.24.69 2Last login: Tue Nov 10 06:24:37 2020 from 137.140.5.103.wi-fi.wi2.ne.jp 3 4 __| __|_ ) 5 _| ( / Amazon Linux 2 AMI 6 ___|\___|___| 7 8https://aws.amazon.com/amazon-linux-2/ 9[ec2-user@ip-172-31-45-251 ~]$ sudo systemctl start mariadb 10[ec2-user@ip-172-31-45-251 ~]$ sudo systemctl restart nginx 11Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details. 12[ec2-user@ip-172-31-45-251 ~]$ sudo systemctl start nginx 13Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details. 14[ec2-user@ip-172-31-45-251 ~]$ ps aux | grep unicorn 15ec2-user 23647 0.0 0.0 119436 968 pts/5 S+ 06:41 0:00 grep --color=auto unicorn 16[ec2-user@ip-172-31-45-251 ~]$ ssh-add ~/.ssh/hoge.pem 17Could not open a connection to your authentication agent. 18[ec2-user@ip-172-31-45-251 ~]$ chmod 600 xxxxxxxxx.pem 19chmod: `nostalgia2020.pem' にアクセスできません: No such file or directory 20[ec2-user@ip-172-31-45-251 ~]$ cd ~ 21[ec2-user@ip-172-31-45-251 ~]$ cd .ssh/ 22[ec2-user@ip-172-31-45-251 .ssh]$ ls 23authorized_keys id_rsa id_rsa.pub known_hosts 24[ec2-user@ip-172-31-45-251 .ssh]$ chmod 600 xxxxxxxxxx.pem 25chmod: `nostalgia2020.pem' にアクセスできません: No such file or directory 26[ec2-user@ip-172-31-45-251 .ssh]$ exit 27ログアウト 28Connection to 54.248.24.69 closed. 29uraokayuutarou@uraokayuutarou-no-MacBook .ssh % ssh -i xxxxxxxxxx0.pem ec2-user@54.248.24.69 30Last login: Tue Nov 10 06:39:30 2020 from 137.140.5.103.wi-fi.wi2.ne.jp 31 32 __| __|_ ) 33 _| ( / Amazon Linux 2 AMI 34 ___|\___|___| 35 36https://aws.amazon.com/amazon-linux-2/ 37[ec2-user@ip-172-31-45-251 ~]$ cd /var/www/nostalgia 38[ec2-user@ip-172-31-45-251 nostalgia]$ ssh-add ~/.ssh/hoge.pem 39Could not open a connection to your authentication agent. 40[ec2-user@ip-172-31-45-251 nostalgia]$ 41 42

登録されているsshの鍵を確認しようとしましたが、
接続を開くことができませんでした。
個人開発のディレクトリに入って実行もしてみましたが、
同じエラー(Could not open a connection to your authentication agent.)が出てきました。

termnal

1https://aws.amazon.com/amazon-linux-2/ 2[ec2-user@ip-172-31-45-251 ~]$ ssh-add -l 3Could not open a connection to your authentication agent. 4[ec2-user@ip-172-31-45-251 ~]$ cd /var/www/nostalgia 5[ec2-user@ip-172-31-45-251 nostalgia]$ ssh-add -l 6Could not open a connection to your authentication agent. 7[ec2-user@ip-172-31-45-251 nostalgia]$

terminal

1https://aws.amazon.com/amazon-linux-2/ 2[ec2-user@ip-172-31-45-251 ~]$ mkdir .ssh 3mkdir: ディレクトリ `.ssh' を作成できません: File exists 4[ec2-user@ip-172-31-45-251 ~]$ touch .ssh/authorized_keys 5[ec2-user@ip-172-31-45-251 ~]$ chmod 700 .ssh 6[ec2-user@ip-172-31-45-251 ~]$ chmod 600 .ssh/authorized_keys 7[ec2-user@ip-172-31-45-251 ~]$ cat ~/.ssh/id_rsa.pub | ssh -i xxxxxxxxx.pem ec2-user@xx.xxx.xx.xx 'cat >> .ssh/authorized_keys' 8Warning: Identity file xxxxxxx.pem not accessible: No such file or directory. 9The authenticity of host '54.248.24.69 (54.248.24.69)' can't be established. 10ECDSA key fingerprint is SHA256:lLzqkqg3f5NLltGU++DHfcxavWesbyq92o4DDfV3Iw8. 11ECDSA key fingerprint is MD5:e0:7f:2f:a5:50:eb:3f:45:bc:b7:bf:31:8d:47:50:34. 12Are you sure you want to continue connecting (yes/no)? y 13Please type 'yes' or 'no': y 14Please type 'yes' or 'no': y 15Please type 'yes' or 'no':

補足情報(FW/ツールのバージョンなど)

設定ファイル
Capfile

# Load DSL and set up stages require "capistrano/setup" # Include default deployment tasks require "capistrano/deploy" # Load the SCM plugin appropriate to your project: # # require "capistrano/scm/hg" # install_plugin Capistrano::SCM::Hg # or # require "capistrano/scm/svn" # install_plugin Capistrano::SCM::Svn # or require "capistrano/scm/git" install_plugin Capistrano::SCM::Git # Include tasks from other gems included in your Gemfile # # For documentation on these, see for example: # # https://github.com/capistrano/rvm # https://github.com/capistrano/rbenv # https://github.com/capistrano/chruby # https://github.com/capistrano/bundler # https://github.com/capistrano/rails # https://github.com/capistrano/passenger # # require "capistrano/rvm" # require "capistrano/rbenv" # require "capistrano/chruby" # require "capistrano/bundler" # require "capistrano/rails/assets" # require "capistrano/rails/migrations" # require "capistrano/passenger" require "capistrano/setup" require "capistrano/deploy" require 'capistrano/rbenv' require 'capistrano/bundler' require 'capistrano/rails/assets' require 'capistrano/rails/migrations' require 'capistrano3/unicorn' # Load custom tasks from `lib/capistrano/tasks` if you have any defined Dir.glob("lib/capistrano/tasks/*.rake").each { |r| import r }

config/deploy.rb

# capistranoのバージョンを記載。固定のバージョンを利用し続け、バージョン変更によるトラブルを防止する lock '3.14.1' set :application, 'nostalgia' set :repo_url, 'git@github.com:uraokayutaro1990/nostalgia.git' set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', 'public/system', 'public/uploads') set :rbenv_type, :user set :rbenv_ruby, '2.6.5p114' # どの公開鍵を利用してデプロイするか set :ssh_options, auth_methods: ['publickey'], keys: ['~/.ssh/xxxxxxxxxx.pem'] set :unicorn_pid, -> { "#{shared_path}/tmp/pids/unicorn.pid" } set :unicorn_config_path, -> { "#{current_path}/config/unicorn.rb" } set :keep_releases, 5 after 'deploy:publishing', 'deploy:restart' namespace :deploy do task :restart do invoke 'unicorn:restart' end end

config/deploy/production.rb

server 'xx.xxx.xx.xx', user: 'Yutaro.Uraoka', roles: %w{app db web}

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

リモートホスト側に登録するのは公開鍵のほうです。
ssh-addはssh-agentに秘密鍵を登録するコマンドなのでリモートホスト上で使っても意味がありません。

capistranoではYutaro.Uraokaxx.xxx.xx.xxに対してSSHログインするのに失敗していると思われるので、SSHログインに使おうとしている秘密鍵に対応する公開鍵がYutaro.Uraoka~/.ssh/authorized_keysに登録されているかを確認してください。
やりかたは色々出てきますがとりあえず一発目に出てきたこれを貼っておきます。
ssh公開鍵認証設定まとめ
単純なところだと、公開鍵の内容をコピーしてauthorized_keysに貼り付けるといいでしょう。

あと、自分の接続元ホストとか接続先IPとかはちゃんと隠しておいてください。

投稿2020/11/10 09:58

yu_1985

総合スコア7440

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

yutaro_0529

2020/11/10 10:43

yu_1985さん、いつもご回答いただきありがとうございます。 ひとまず、接続元ホストと接続先IPと思われるものを編集しました。 ご指摘ありがとうございます。 これからご回答いただいたものを確認していきます!
yutaro_0529

2020/11/10 11:30

EC2ターミナルでcat ~/.ssh/id_rsa.pubを実行し、 GitHubのWebからNew SSH Keyを登録しようとすると、 個人開発アプリを作成中何かのエラーで、公開鍵を2つ登録していたと思い出しました。 すでにcat ~/.ssh/id_rsa.pubを実行してしまい新しい公開鍵が出来てしまったのですが、 以前作成した2つの公開鍵はdeleteボタンで削除しても問題ないのでしょか!?
yutaro_0529

2020/11/10 12:02

GitHubに公開鍵2つ登録した状態かつ ターミナルでcat ~/.ssh/id_rsa.pubを実行した後、 ssh -T git@github.comをターミナルで実行すると、 Hi uraokayutaro1990! You've successfully authenticated, but GitHub does not provide shell access.と表示され問題なさそうだったたので、元々作成していた2つの公開鍵を削除するのをためらっています。
yu_1985

2020/11/11 00:39

GitHubではなくてリモートホスト上の~/.ssh/authorized_keys に鍵が登録されているかの話をしています。 GitHubに接続するための鍵の話はここではしていません。
yutaro_0529

2020/11/11 03:43

yu_1985さん、ご回答ありがとうございます。 すみません、間違えていました。 下記で公開鍵が登録されているか確認したところ、 見当たりませんでした。 設定方法調べて設定してみます。 [ec2-user@ip-172-31-45-251 ~]$ ~/.ssh/authorized_keys -bash: /home/ec2-user/.ssh/authorized_keys: Permission denied [ec2-user@ip-172-31-45-251 ~]$
yutaro_0529

2020/11/11 04:21

全然わからず、立ち止まっています。。 記載していたたssh公開鍵認証設定まとめを参考に公開鍵の設定方法を確認していたのですが、 ssh-copy-id を使用して登録を試してもうまくいかず、 試したことの中にこれから追記します。 [ec2-user@ip-172-31-45-251 ~]$ cat ~/.ssh/id_rsa.pub | ssh USER@HOST "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys" ssh: Could not resolve hostname host: Name or service not known [ec2-user@ip-172-31-45-251 ~]$
yu_1985

2020/11/11 04:27

コマンドをそのままコピペするだけでは当然うまく行きません…。 まず、ec2-userはリモートホスト上のユーザです。 にもかかわらず、ec2-userでさらにsshして別のユーザで別のホストにSSHログインしようとしています。。 やりたいことはそうではないですよね? ローカルの鍵の情報を`Yutaro.Uraoka`に登録したいのだから、最も簡単な方法は自分が回答に記載した > 公開鍵の内容をコピーしてauthorized_keysに貼り付ける です。 自分がローカルで使いたい秘密鍵に対応する公開鍵をそのままコピーして、`Yutaro.Uraoka`ユーザのホームディレクトリ配下にある`.ssh/authorized_keys`に貼り付けてください(なければ作成する。その際権限には注意。このへんは参考サイトの記載のとおりです。) また、ec2-userの鍵の情報を登録してもそれは自分がローカルから接続に使いたい鍵ではないので意味がありません。
yutaro_0529

2020/11/11 06:05

ご回答ありがとうございます。 先ほどのですと全然うまく行きませんでした…。 ec2-userで別のホストにログインしたい訳ではなかったです。 ローカルの鍵情報は、GithubのNew Keyの登録していたので、 公開鍵は見つけることが出来ました。 authorized_keysに貼り付けるという手順がうまく行きません…。 参考にさせていただいたサイトの手動で登録 ssh hoge_user@hogehoge.hoge.com ←こちらをどのURLをしてしてあげれば良いのかわかりませんでした。 そのため他の方法を探してみました。 https://ssilab.co.jp/blog/tech-blog/tech-blog-child/public_key_authentication これを参考に.sshの直下に「authorized_keys」という空のファイルを作成し、編集するの $vi ~/.ssh/authorized_keys を実行すると指定していたおそらく公開鍵のようなものが出てきました。 以前作成した公開鍵と照らし合わせると違うものが登録されており。 鍵自体が作成した公開鍵に比べ短く、$vi ~/.ssh/authorized_keysで確認したものは最後に私がつけたキーペアの名前が記載されていました。nostalgiaxxxxxxxx [ec2-user@ip-172-31-45-251 ~]$ mkdir ~/.ssh mkdir: ディレクトリ `/home/ec2-user/.ssh' を作成できません: File exists [ec2-user@ip-172-31-45-251 ~]$ vi ~/.ssh/authorized_keys [ec2-user@ip-172-31-45-251 ~]$
yu_1985

2020/11/11 06:10

> ssh hoge_user@hogehoge.hoge.com それは単にリモートホストにSSHしているだけなので無視してください。 ec2-userのauthorized_keysを編集しようとしていますが、接続したいのは`Yutaro.Uraoka`ではないのですか? それならば`Yutaro.Uraoka`のホームディレクトリを見る必要があるのですが。 まずどのユーザでデプロイしたいんでしょうか。
yutaro_0529

2020/11/11 06:18

ありがとうございます!わかりました。 ターミナルの使い方が全然わかっておらずすみません。 接続したいのはAWS アカウントのYutaro.Uraokaにデプロイしたいです。
yu_1985

2020/11/11 06:21

AWSにログインするためのIAMユーザとEC2インスタンス内のユーザは関係ないのですが、混同していませんか? EC2インスタンス内に`Yutaro.Uraoka`というユーザを作成していなければそれはできません。 ユーザを適切に作成するか、既に存在するユーザを使ってデプロイしてください。最も手っ取り早いのはec2-userでデプロイすることです。
yutaro_0529

2020/11/11 06:36

ご回答ありがとうございます! AWSにログインするためのIAMユーザとEC2インスタンス内のユーザを混同していました…。 EC2インスタンス内にユーザー登録していないまま、 production.rbにユーザー名をYutaro.Uraokaと記述していました。 手取り早い方法のec2-userでデプロイしてみます!
yu_1985

2020/11/11 06:41

ec2-userでデプロイをするのなら、鍵はec2-userでsshログインするのに使っている鍵にしてください。 このあたりの理解がまだ浅いようでしたら、試しに自分でユーザ作成〜鍵を用いたログインの設定まで一通りやってみることをおすすめします。
yutaro_0529

2020/11/11 06:58

ec2-userでsshログインですが、xxxxxxx.pemという事前にダウンロードした鍵でアクセスしているのだと思っていました。正しい解釈でしょうか!? まだまだ理解が浅いです。。 ユーザー作成する場合、ユーザーを作成した後に鍵を作成し、秘密鍵はアクセスされないところに保管、 公開鍵は作成した時に表示されてものをコピーして、ターミナル上で登録するで間違いないでしょうか…。 ec2-userでデプロイしようとしたところ、 違う問題が発生してしまいました。 まだ時間がかかりそうなので、ひとまずec2-userデプロイできるようにして、 それからインスタンスにユーザーを作って以前作成していたアプリをデプロイしてみようと思います!
yutaro_0529

2020/11/11 07:29

結局、自動デプロイしようとしたところまたエラーになりました。 原因はrubyのバージョンをproduct.rbで誤っていたためでした。 修正し無事にデプロイ出来たのですが、 いざIPアドレスにアクセスするとWEBに接続することが出来ませんでした…。 ひとまずエラーログを確認してみました。 [ec2-user@ip-172-31-45-251 log]$ tail -f production.log D, [2020-11-11T07:12:27.255822 #11469] DEBUG -- : (0.3ms) SET NAMES utf8, @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'), @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483 D, [2020-11-11T07:12:28.782734 #11501] DEBUG -- : (0.3ms) SET NAMES utf8, @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'), @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483 D, [2020-11-11T07:19:08.860470 #12870] DEBUG -- : (2.0ms) SET NAMES utf8, @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'), @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483 D, [2020-11-11T07:19:08.873104 #12870] DEBUG -- : (0.1ms) SET NAMES utf8, @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'), @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483 D, [2020-11-11T07:19:08.873458 #12870] DEBUG -- : (0.1ms) SELECT GET_LOCK('6517012043257192470', 0) D, [2020-11-11T07:19:08.879557 #12870] DEBUG -- : (0.2ms) SELECT `schema_migrations`.`version` FROM `schema_migrations` ORDER BY `schema_migrations`.`version` ASC D, [2020-11-11T07:19:08.883440 #12870] DEBUG -- : ActiveRecord::InternalMetadata Load (0.2ms) SELECT `ar_internal_metadata`.* FROM `ar_internal_metadata` WHERE `ar_internal_metadata`.`key` = 'environment' LIMIT 1 D, [2020-11-11T07:19:08.887944 #12870] DEBUG -- : (0.1ms) SELECT RELEASE_LOCK('6517012043257192470') D, [2020-11-11T07:19:11.212998 #12981] DEBUG -- : (0.3ms) SET NAMES utf8, @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'), @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483 D, [2020-11-11T07:19:12.703104 #13013] DEBUG -- : (0.3ms) SET NAMES utf8, @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'), @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483 別でまとめて質問してみようと思います! ありがとうございます!
yu_1985

2020/11/11 07:37

なぜかみんな判を押したようにtail -fでログを確認しようとするのですが、tail -f は追記されていくログを順次画面に表示していくコマンドなので既にあるログを確認するのには適していません。 tailコマンドはファイルの末尾を見るコマンドですが、デフォルトだと10行しか見られないので長いログを確認しようとした場合見たい部分が見えないことがあります。 DEBUGと出ているものはERRORとは異なります。 tailコマンドのオプションで表示行数を増やすか、catやlessなどでもっと広い範囲を確認するようにしてください。 tail -fを使うのは、tail -fでファイルを開きながらアクセスしてみてどのようにログに出力されるかを確認したい場合などです。
yutaro_0529

2020/11/11 08:03

おっしゃる通り10行しか表示されておらず、 less log/unicorn.stderr.logでエラーを確認しました。 ArgumentError:が発生していました。 まだまだ勉強不足です。 ご指摘ありがとうございます。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問