Skip to content
This repository has been archived by the owner on Oct 7, 2020. It is now read-only.

Unable to connect to database when initializing a postgresql server #125

Open
Dreeckan opened this issue Sep 7, 2017 · 15 comments
Open

Comments

@Dreeckan
Copy link

Dreeckan commented Sep 7, 2017

Hello everyone !
First of all, thanks for this great project, it helps a lot ! ^^

I have an error when initializing a new Symfony (v3.3) project and using manalize. I just download Symfony (using Symfony's command line) and tried to use manalize.

The error :

TASK [manala.postgresql : roles > Handle] **************************************
failed: [localhost] (item={u'attributes': [u'SUPERUSER'], u'password': None, u'role': u'app'}) => {"failed": true, "item": {"attributes": ["SUPERUSER"], "password": null, "role": "app"}, "msg": "unable to connect to database: fe_sendauth: no password supplied\n"}

Do I have to create it myself inside the vagrant ? Or do I need anything before starting you command ?

Thanks !

@chalasr
Copy link
Member

chalasr commented Sep 8, 2017

Hey. Thanks for the feedback, very pleased to read that.

What version of postgesql are you using?

@Dreeckan
Copy link
Author

Dreeckan commented Sep 8, 2017

You're very welcome :) .

I need to use version 9.5 of postgresql (as on my current production server ;) )

@nervo
Copy link
Member

nervo commented Sep 8, 2017

I'm afraid we still don't have tests for postgresql 9.5, only for 9.4: https://github.com/manala/ansible-roles/blob/master/manala.postgresql/tests/0100_install.yml

Could you try with 9.4 ?

@Dreeckan
Copy link
Author

Dreeckan commented Sep 11, 2017

Hello :) .

I just tried with postgresql 9.4 and yes, it works, until this appends :

> symfony-scripts: Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::prepareDeploymentTarget

                                                                             
  [Doctrine\DBAL\Exception\ConnectionException]                              
  An exception occured in driver: SQLSTATE[HY000] [2002] Connection refused  
                                                                             

                                             
  [Doctrine\DBAL\Driver\PDOException]        
  SQLSTATE[HY000] [2002] Connection refused  
                                             

                                             
  [PDOException]                             
  SQLSTATE[HY000] [2002] Connection refused  
                                             

doctrine:database:create [--shard SHARD] [--connection [CONNECTION]] [--if-not-exists] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command>

Makefile:66: recipe for target 'install' failed

I guess I just have to create my db by hand and re-start the make install command ;) .

By the way : if version 9.5 is not tested, how about stay in 9.4 by default ?

@Dreeckan
Copy link
Author

Erratum :
Database is created, but I still can't connect to the database.

@chalasr
Copy link
Member

chalasr commented Sep 11, 2017

Do you have app as username and no password in your doctrine config? That should be the default pgsql credentials. Be sure that the driver is set to pdo_pgsql and that the port is either null or 5432 also.

@chalasr
Copy link
Member

chalasr commented Sep 11, 2017

By the way : if version 9.5 is not tested, how about stay in 9.4 by default ?

Yea, even remove 9.5 from the alternatives until it's not fully supported I'd say

@nervo
Copy link
Member

nervo commented Sep 11, 2017

I've just add an issue: manala/ansible-roles#40
@Dreeckan could you confirm your doctrine parameters ?

@Dreeckan
Copy link
Author

Ok, I completely forgot to update the driver parameter in config.yml -_-... Thanks for pointing that out ;) .

Parameters.yml :

parameters:
    database_host: 127.0.0.1
    database_port: 5432
    database_name: app
    database_user: app
    database_password: null
    mailer_transport: smtp
    mailer_host: 127.0.0.1
    mailer_user: null
    mailer_password: null
    secret: 2088e948c33d10e100a0f9c372ac7f992530d121

@Dreeckan
Copy link
Author

Dreeckan commented Sep 11, 2017

Thanks @nervo ! Do you need me to comment on that new issue with more details about the problem ?

@nervo
Copy link
Member

nervo commented Sep 11, 2017

@Dreeckan fyi you can leave the database_port parameter to null, it will be defaulted to 5432
And yes, if you can provide the ansible logs in the issue, that would help :) (only the "manala.postgresql" parts)

@chalasr
Copy link
Member

chalasr commented Sep 12, 2017

Unless I'm mistaken we're done for this one.

@chalasr chalasr closed this as completed Sep 12, 2017
@Dreeckan
Copy link
Author

Dreeckan commented Sep 12, 2017

Hello again !
I had to install the project on a second machine, and I'm afraid to tell you I have now the same problem with postgresql 9.4.

So no, I'm afraid you're not done with me, yet ;) .
I'll send the ansible logs tomorrow

@chalasr chalasr reopened this Sep 17, 2017
@hyvs
Copy link
Member

hyvs commented Dec 1, 2017

Related issue : manala/ansible-roles#123

@chalasr
Copy link
Member

chalasr commented Dec 1, 2017

@Dreeckan we just released a fix, can you retry using the role in its latest version and confirm it fixes your issue?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants