I am dragging for personal use a rails application using postgresql that has been working for some time now. As I installed Fedora 16 adapted the rails application to the new tools. The application works fine as long as It is tried in development environment.
As soon as the production environment is used the following messages are captured: “we’re sorry, but something went wrong.” in the browser. And
Started GET “/album/” for 200.88.224.30 at Sun Dec 11 19:28:07 -0400 2011
PGError (FATAL: Peer authentication failed for user “postgres” ):
in the log/production.log file
I am dragging for personal use a rails application using postgresql
that has been working for some time now. As I installed Fedora 16
adapted the rails application to the new tools. The application works
fine as long as It is tried in development environment.
As soon as the production environment is used the following messages
are captured: "we're sorry, but something went wrong." in the
browser. And
Started GET "/album/" for 200.88.224.30 at Sun Dec 11 19:28:07 -0400
2011
PGError (FATAL: Peer authentication failed for user "postgres" ):
in the log/production.log file
fine as long as It is tried in development environment.
As soon as the production environment is used the following messages
are captured: “we’re sorry, but something went wrong.” in the
browser. And
Started GET “/album/” for 200.88.224.30 at Sun Dec 11 19:28:07 -0400
2011
PGError (FATAL: Peer authentication failed for user “postgres” ):
in the log/production.log file
Any help would be very much appreciated .
I would not recommend that user ‘postgres’ is the user of any postgresql database from within rails but that is not an answer to your question but only a suggestion.
If you check your RAILS_ROOT/config/database.yml file, you should have a section at least for ‘development’, ‘test’ and ‘production’
You don’t say what is different from each configuration (obviously only the development & production configurations are relevant to your question) and you don’t tell us if the the server is the same for both development and production.
If I was going to guess, I would think that your development section uses a ‘socket’ to connect (something like /var/lib/mysql/mysqld.sock) and in production, you don’t use a socket so it tries to use TCP/IP Port 5432 which would cause user postgres to fail unless specifically configured in the pg_hba_conf file (but user postgres is really intended to use only via a local socket.
Craig
Hi again:
I should remenber that there are no great differences between development and production section in the database yml file.
And yes, I am using the same database for both environments. (maybe I should use another database for production), but what get me confused is that I get access to the database from any other node in the network when rails is not the tool used.
I shall tried with other database users and other database in this application.
> Hi everyone:
>
The application works
> fine as long as It is tried in development environment.
>
> As soon as the production environment is used the following messages
> are captured: "we're sorry, but something went wrong." in the
> browser. And
>
> Started GET "/album/" for 200.88.224.30 at Sun Dec 11 19:28:07 -0400
> 2011
> PGError (FATAL: Peer authentication failed for user "postgres" ):
> in the log/production.log file
>
> Any help would be very much appreciated .
----
I would not recommend that user 'postgres' is the user of any postgresql database from within rails but that is not an answer to your question but only a suggestion.
If you check your RAILS_ROOT/config/database.yml file, you should have a section at least for 'development', 'test' and 'production'
You don't say what is different from each configuration (obviously only the development & production configurations are relevant to your question) and you don't tell us if the the server is the same for both development and production.
If I was going to guess, I would think that your development section uses a 'socket' to connect (something like /var/lib/mysql/mysqld.sock) and in production, you don't use a socket so it tries to use TCP/IP Port 5432 which would cause user postgres to fail unless specifically configured in the pg_hba_conf file (but user postgres is really intended to use only via a local socket.
Craig
Hi again:
I should remenber that there are no great differences between development and production section in the database yml file.
And yes, I am using the same database for both environments. (maybe I should use another database for production), but what get me confused is that I get access to the database from any other node in the network when rails is not the tool used.
I shall tried with other database users and other database in this application.
I should remenber that there are no great differences between development and production section in the database yml file.
config/database.yml
development:
adapter: postgresql
encoding: unicode
database: db_album
pool: 5
username: user
And yes, I am using the same database for both environments. (maybe I should use another database for production), but what get me confused is that I get access to the database from any other node in the network when rails is not the tool used.
I shall tried with other database users and other database in this application.
Thanks
and what does
production:
adapter: ?
encoding: ?
database: ?
pool: ?
username: ?
look like?
Craig
Craig:
as I said, there is no difference between the two sections
production:
adapter: postgresql
encoding: unicode
database: db_album
pool: 5
username: user
password:
And, the strange in it all is that it has worked before.
> I should remenber that there are no great differences between development and production section in the database yml file.
>
> # config/database.yml
> development:
> adapter: postgresql
> encoding: unicode
> database: db_album
> pool: 5
> username: user
>
> And yes, I am using the same database for both environments. (maybe I should use another database for production), but what get me confused is that I get access to the database from any other node in the network when rails is not the tool used.
>
> I shall tried with other database users and other database in this application.
>
> Thanks
----
and what does
production:
adapter: ?
encoding: ?
database: ?
pool: ?
username: ?
look like?
Craig
Craig:
as I said, there is no difference between the two sections