pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: rob stone <floriparob@gmail.com>
To: Marco Ippolito <ippolito.marco@gmail.com>
To: Martin Gainty <mgainty@hotmail.com>
To: pgsql-general@lists.postgresql.org
To: Adrian Klaver <adrian.klaver@aklaver.com>
Subject: Re: "Failed to connect to Postgres database"
Date: Fri, 27 Sep 2019 12:28:31 +1000
Message-ID: <c8251b79fdb66c5888ad1c0c24cbb07f8094772d.camel@gmail.com> (raw)
In-Reply-To: <CAFegzBQnwgx=+5DqRVrqBHBBpBRzapZrGB3DamCc4qdYUfOEOA@mail.gmail.com>
References: <CAFegzBQf-TH3BqWcL2MTq8hPyE3NLsHt6-LSLQLfYPeLu7tRdQ@mail.gmail.com>
	<CH2PR19MB3893AC0F5133DF53B453BB01AE870@CH2PR19MB3893.namprd19.prod.outlook.com>
	<CAFegzBRmMWTC2r0UN6VyOrLWWiLGK6TVbmUufx+vkFX9WxPDHg@mail.gmail.com>
	<CAFegzBQnwgx=+5DqRVrqBHBBpBRzapZrGB3DamCc4qdYUfOEOA@mail.gmail.com>

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@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







view thread (19+ messages)  latest in thread

Message-ID: <c8251b79fdb66c5888ad1c0c24cbb07f8094772d.camel@gmail.com>
Permalink:  ../c8251b79fdb66c5888ad1c0c24cbb07f8094772d.camel@gmail.com/
Also on:    postgresql.org/message-id/c8251b79fdb66c5888ad1c0c24cbb07f8094772d.camel@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: floriparob@gmail.com, ippolito.marco@gmail.com, mgainty@hotmail.com, adrian.klaver@aklaver.com
  Subject: Re: "Failed to connect to Postgres database"
  In-Reply-To: <c8251b79fdb66c5888ad1c0c24cbb07f8094772d.camel@gmail.com>
  References: <CAFegzBQf-TH3BqWcL2MTq8hPyE3NLsHt6-LSLQLfYPeLu7tRdQ@mail.gmail.com> <CH2PR19MB3893AC0F5133DF53B453BB01AE870@CH2PR19MB3893.namprd19.prod.outlook.com> <CAFegzBRmMWTC2r0UN6VyOrLWWiLGK6TVbmUufx+vkFX9WxPDHg@mail.gmail.com> <CAFegzBQnwgx=+5DqRVrqBHBBpBRzapZrGB3DamCc4qdYUfOEOA@mail.gmail.com> <c8251b79fdb66c5888ad1c0c24cbb07f8094772d.camel@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox