Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iDfzv-0005Eu-Uu for pgsql-general@arkaria.postgresql.org; Fri, 27 Sep 2019 02:28:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iDfzu-0006oh-KC for pgsql-general@arkaria.postgresql.org; Fri, 27 Sep 2019 02:28:42 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iDfzu-0006oa-8x for pgsql-general@lists.postgresql.org; Fri, 27 Sep 2019 02:28:42 +0000 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iDfzr-0005d4-S1 for pgsql-general@lists.postgresql.org; Fri, 27 Sep 2019 02:28:41 +0000 Received: by mail-pl1-x629.google.com with SMTP id t10so437390plr.8 for ; Thu, 26 Sep 2019 19:28:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=9MHo+Hi50AjIjnmj7fDdn/cwYYrxTaH0gG9dx9LeYz0=; b=QV6TxSMVPxJJNswmPYuTRM/D65cL5G4sxS1kLke7EnpYA3UZ4YEBV5hl5ojkH0U7aG qVH5mwNs188eQkrNjF8HwfcjH1Ti6LQOvFcvgNH0e2YkkpXXQRM7BTvHHxd9y7qxspH1 l/JirncecbXMBhpzykVVTazTaFXbIdbejgxn4SuGTkXNmXlkNkyk1hZnY/76T9VyPyO9 /yrQ4ZhLszhqAhJY1Gf5BN90zxQAl9uW3KxJkfTchAn7IQ8QlX+lkn68QOCQRnkltQdW 6rPl0hYqf1CvpODRT+j0sYjs7pZd390ZYPHUXxrR0IoO35Tk81ZqA9iHA+ajU0YdmE+0 z7IQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=9MHo+Hi50AjIjnmj7fDdn/cwYYrxTaH0gG9dx9LeYz0=; b=bNHkA2/Ps3PPCAjcuR5pR2kzQXYF7XbRH3uLc6v/f5SqE4GZDsD+rPIF3IFYnCCVOu VKxNqXcg4Xb5O6AQ3GDyfRrX40nWQO5X/QsZXmLLgZyRpCV8L7YYdaRVivJIgcLNmIRu h8D/LYnPV5oTfvKWtFXJptbi0cYb2M4/MSb4A1QOevyZa5BWce90Z7VtgQCqtS1QpAw7 WE9rd66Y1P5MMWyGeHCRM2tefWf06ouZTx1kdbwz0ipplupeaaVgqVcipNgvwM5L85ZD a4ezKwApLlnmbtNjhH0bWGwf0rrTuy0Vvbsmz/qhlNls2soo7sHxlhFvdsXE0iRcH3eL OKmg== X-Gm-Message-State: APjAAAUxQpV7EiMuBsqsgDPjJche0wgNIj4lb07uWrvp4I1GgTJvH1ab yDKs13XWsHbNVR+nvyo8LYI= X-Google-Smtp-Source: APXvYqyrdPd+gXKmK02r2O2nuxKfppnWaOjD46jZK0uYY+Gf7JvL1VaHUgLwf+gNtNY3NoKK0jfKpg== X-Received: by 2002:a17:902:7d98:: with SMTP id a24mr1896621plm.271.1569551316924; Thu, 26 Sep 2019 19:28:36 -0700 (PDT) Received: from 192-168-1-100.tpgi.com.au (194-193-168-133.tpgi.com.au. [194.193.168.133]) by smtp.gmail.com with ESMTPSA id c6sm3478285pgd.79.2019.09.26.19.28.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 19:28:36 -0700 (PDT) Message-ID: Subject: Re: "Failed to connect to Postgres database" From: rob stone To: Marco Ippolito , Martin Gainty , pgsql-general@lists.postgresql.org, Adrian Klaver Date: Fri, 27 Sep 2019 12:28:31 +1000 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5-1.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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