Re: "Failed to connect to Postgres database"

From: rob stone <floriparob(at)gmail(dot)com>
To: Marco Ippolito <ippolito(dot)marco(at)gmail(dot)com>, Martin Gainty <mgainty(at)hotmail(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Subject: Re: "Failed to connect to Postgres database"
Date: 2019-09-27 02:28:31
Message-ID: c8251b79fdb66c5888ad1c0c24cbb07f8094772d.camel@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

On Thu, 2019-09-26 at 16:21 +0200, Marco Ippolito wrote:
>
> db:
> type: postgres
> datasource: host=localhost port=5433 user=fabmnet_admin
> password=password dbname=fabmnetdb sslmode=verify-full
>

>
> (base) marco(at)pc:~/fabric/fabric-ca$ fabric-ca-server start -b
> admin:adminpw
> 2019/09/26 15:56:50 [INFO] Configuration file location: /home/marco
> /fabric/fabric-ca/fabric-ca-server-config.yaml
> 2019/09/26 15:56:50 [INFO] Starting server in home directory:
> /home/marco/fabric/fabric-ca
> 2019/09/26 15:56:50 [INFO] Server Version: 1.4.4
> 2019/09/26 15:56:50 [INFO] Server Levels: &{Identity:2 Affiliation:1
> Certificate:1 Credential:1 RAInfo:1 Nonce:1}
> 2019/09/26 15:56:50 [INFO] The CA key and certificate already exist
> 2019/09/26 15:56:50 [INFO] The key is stored by BCCSP provider 'SW'
> 2019/09/26 15:56:50 [INFO] The certificate is at: /home/marco/fabric
> /fabric-ca/ca-cert.pem
> 2019/09/26 15:56:50 [WARNING] Failed to connect to database
> 'fabmnetdb'
> 2019/09/26 15:56:50 [WARNING] Failed to connect to database
> 'postgres'
> 2019/09/26 15:56:50 [WARNING] Failed to connect to database
> 'template1'
> 2019/09/26 15:56:50 [ERROR] Error occurred initializing database:
> Failed
> to connect to Postgres database. Postgres requires connecting to a
> specific database, the following databases were tried: [fabmnetdb
> postgres template1]. Please create one of these database before
> continuing

Why is it trying to connect to *any* database?

In the fabric-ca docs it shows the connection string as a single line
but your configuration file has it split over two lines.
My uneducated guess is that it is ignoring the 'password=password
dbname=fabmnetdb sslmode=verify-full'
line and thus unable to connect to fabmnetdb.

Cheers,
Robert

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Pankaj Jangid 2019-09-27 03:06:03 Re: managing primary key conflicts while restoring data to table with existing data
Previous Message keisuke kuroda 2019-09-27 01:50:46 pg12 rc1 on CentOS8 depend python2