この内容は古いバージョンです。最新バージョンを表示するには、戻るボタンを押してください。
バージョン:1
ページ更新者:爽健
更新日時:2018-12-23 06:28:27

タイトル: rake aborted! PG::ConnectionBad: FATAL: Ident authentication failed for user "redmine"
SEOタイトル: rake aborted! PG::ConnectionBad: FATAL: Ident authentication failed for user "redmine"

この記事の要点
  • Redmine の PG::ConnectionBad: Ident authentication failed
  • 原因: pg_hba.conf の認証方式が ident になっており、OS ユーザ名と PG ユーザ名の一致を要求している
  • 対処: pg_hba.confidentmd5 に変更 → PostgreSQL 再起動
  • パスワード認証になればアプリ側で接続可能

 

エラー内容

rake aborted!
PG::ConnectionBad: FATAL:  Ident authentication failed for user "redmine"

...

Tasks: TOP => db:migrate => environment

 

発生条件/原因/対処法

Redmineインストール時に以下のコマンドを実行に発生するエラー。

RAILS_ENV=production bundle exec rake db:migrate

OSユーザーとpostgresqlのユーザー名が一致していないと発生するエラー。

 

/var/lib/pgsql/data/pg_hba.conf にて認証方法を変えれば解決できる。

METHODがIndentとなっているユーザーがOSユーザーと一致しなければならないユーザー。

host    all             all             127.0.0.1/32            ident
host    all             all             ::1/128                 ident

上記のようになっているユーザーはmd5(パスワード認証)、trust(無条件)に変更する。

 

設定変更したら再起動をして設定を変更する。

service postgresql restart