rails-composer icon indicating copy to clipboard operation
rails-composer copied to clipboard

postgres socket connection without password not working

Open bryanlarsen opened this issue 10 years ago • 3 comments

I left both of these options blank:

    option  Host for PostgreSQL in database.yml? (leave blank to use default socket connection) 
    option  Password for PostgreSQL user vagrant? 

My resulting database.yml contained these lines:

 host: localhost
 password: 

All rake db actions failed with fe_sendauth: no password supplied. Removing the host and password lines from my database.yml fixed my database access.

option  Build a starter application?
choose  Enter your selection: [rails-devise-roles]
option  Get on the mailing list for Rails Composer news?
choose  Enter your selection: [none]
option  Web server for development?
choose  Enter your selection: [unicorn]
option  Web server for production?
choose  Enter your selection: [unicorn]
option  Database used in development?
choose  Enter your selection: [postgresql]
option  Template engine?
choose  Enter your selection: [erb]
option  Test framework?
choose  Enter your selection: [none]
option  Continuous testing?
choose  Enter your selection: []
option  Front-end framework?
choose  Enter your selection: [bootstrap3]
option  Add support for sending email?
choose  Enter your selection: [gmail]
option  Authentication?
choose  Enter your selection: [devise]
option  Devise modules?
choose  Enter your selection: [invitable]
option  OmniAuth provider?
choose  Enter your selection: []
option  Authorization?
choose  Enter your selection: [roles]
option  Use a form builder gem?
choose  Enter your selection: [simple_form]
option  Add pages?
choose  Enter your selection: [users]
option  Set a locale?
choose  Enter your selection: [none]
option  Install page-view analytics?
choose  Enter your selection: [none]
option  Add a deployment mechanism?
choose  Enter your selection: [none]
option  Set a robots.txt file to ban spiders?
choose  Enter your selection: [true]
option  Create a GitHub repository? (y/n)
choose  Enter your selection: []
option  Add gem and file for environment variables?
choose  Enter your selection: [false]
option  Reduce assets logger noise during development?
choose  Enter your selection: [true]
option  Improve error reporting with 'better_errors' during development?
choose  Enter your selection: [true]
option  Use 'pry' as console replacement during development and test?
choose  Enter your selection: [false]
option  Use or create a project-specific rvm gemset?
choose  Enter your selection: [false]

bryanlarsen avatar May 13 '15 13:05 bryanlarsen

For others with this or similar problems, it appears that the config/database.yml file may be safely edited manually while at the "Okay to drop all existing databases " prompt.

bryanlarsen avatar May 13 '15 13:05 bryanlarsen

@bryanlarsen are you still encountering this issue?

@DanielKehoe do you reckon this is a rails-composer issue or a machine-environment specific issue that can be prevented?

Schwad avatar Nov 23 '17 16:11 Schwad

StackOverflow

This might be related to something like this. Meaning, if the access is not fixed, rails will not be able to access the database unless you've allowed connections in the pg_hba.conf file. So when composer attempts to access even with correct credentials it doesn't matter.

This is not affected when you log into your postgres normally which is probably why it fails.

I might be off, but sounds like this.

Juksefantomet avatar Jun 21 '18 16:06 Juksefantomet