getting this strange popup error on selecting ssh key using remote-ssh vs code extension
no remote connections have been successful since this error has began
checked out my log file but didnt get much more information than the popup gave
seems out of place for vs code to do this window popup instead of the notif in the bottom right
i've made efforts into searching this text on SE and google to no luck
if nothing else i'd rather remove VScode entirely from my pc and start from scratch
2022-12-08 00:43:12.981 [info] Extension host with pid 388 started
2022-12-08 00:43:13.044 [info] ExtensionService#_doActivateExtension vscode.microsoft-authentication, startup: false, activationEvent: 'onAuthenticationRequest:microsoft'
2022-12-08 00:43:13.063 [info] ExtensionService#_doActivateExtension vscode.git-base, startup: true, activationEvent: '*', root cause: vscode.git
2022-12-08 00:43:13.073 [info] ExtensionService#_doActivateExtension vscode.git, startup: true, activationEvent: '*'
2022-12-08 00:43:13.091 [info] ExtensionService#_doActivateExtension vscode.github, startup: true, activationEvent: '*'
2022-12-08 00:43:13.114 [info] ExtensionService#_doActivateExtension vscode.github-authentication, startup: false, activationEvent: 'onAuthenticationRequest:github'
2022-12-08 00:43:13.141 [info] Eager extensions activated
2022-12-08 00:43:13.143 [info] ExtensionService#_doActivateExtension vscode.debug-auto-launch, startup: false, activationEvent: 'onStartupFinished'
2022-12-08 00:43:13.146 [info] ExtensionService#_doActivateExtension vscode.emmet, startup: false, activationEvent: 'onStartupFinished'
2022-12-08 00:43:13.151 [info] ExtensionService#_doActivateExtension vscode.merge-conflict, startup: false, activationEvent: 'onStartupFinished'
2022-12-08 00:43:13.159 [info] ExtensionService#_doActivateExtension ms-vscode-remote.remote-wsl-recommender, startup: false, activationEvent: 'onStartupFinished'
2022-12-08 00:43:13.167 [info] ExtensionService#_doActivateExtension ms-vscode-remote.remote-containers, startup: false, activationEvent: 'onStartupFinished'
2022-12-08 00:43:13.193 [info] ExtensionService#_doActivateExtension ms-vscode-remote.remote-wsl, startup: false, activationEvent: 'onStartupFinished'
2022-12-08 00:43:46.716 [info] ExtensionService#_doActivateExtension ms-vscode-remote.remote-ssh, startup: false, activationEvent: 'onCommand:opensshremotes.openEmptyWindow'
2022-12-08 00:44:09.327 [error] Error: EINVAL: invalid argument, mkdir 'C:\Users\*username*\AppData\Local\Programs\Microsoft VS Code\"C:' opensshremotes.addNewSshHost {"value":"ms-vscode-remote.remote-ssh","c":"ms-vscode-remote.remote-ssh"}
2022-12-08 00:44:09.328 [error] Error: EINVAL: invalid argument, mkdir 'C:\Users\*username*\AppData\Local\Programs\Microsoft VS Code\"C:' opensshremotes.openEmptyWindow {"value":"ms-vscode-remote.remote-ssh","c":"ms-vscode-remote.remote-ssh"}
this is the persistent error in question on a clean window from the exthost.log, omitted my username
running Windows 11 Home build 22621.819
i've tried looking up solutions on SE and google and come up empty handed every time.
I can't help you with the error since it doesn't tell enough but I'll share with you my setup which you can try.
On your local computer from which you establish SSH to remote PC create a new config file (without extension) in your C:\Users\User\.ssh directory
Following are the contents of the file which you must update according to comments:
# This is the ssh client configuration sample file
# File syntax info: https://man7.org/linux/man-pages/man5/ssh_config.5.html
# Connection name as it will be displayed in Remote Explorer
Host Remote_SSH
# Specifies the real host name to log into.
HostName REMOTE_COMPUTER_NAME
# User name to which to log on on remote host
User RemoteAdminName
# Specifies the protocol versions in order of preference.
# The possible values are '1' and '2'.
# protocol version 1 is NOT RECOMMENDED for security reasons.
Protocol 2
# Specifies which address family to use when connecting.
# Valid arguments are: any, inet, inet6.
AddressFamily inet
# Specifies the ciphers allowed for protocol version 2 in order of preference.
# Multiple ciphers must be comma-separated.
# Run: "ssh -Q cipher" to see available chipers
Ciphers aes256-cbc,aes256-ctr
# Specifies a file from which the user's identity key is read when using public key authentication.
# This should be public key
IdentityFile ~\\.ssh\\YOUR_PUBLIC_SSH_KEY.pub
Next step is to copy your public SSH key to remote computer into the following location:
C:\Users\REMOTE_ADMIN_NAME\.ssh\authorized_keys
Where authorized_keys is not a directory but rather a file with no extension that contains your public SSH key. (simply rename your copied key to authorized_keys on remote PC.
For more information see:
https://code.visualstudio.com/docs/remote/troubleshooting#_configuring-key-based-authentication
Remote computer must have VSCode installed.
Once you update relevant parameters in local config file and set up SSH key on remote computer open up VSCode and click on Remote-Explorer in action bar (side bar)
Click on little + sign when you hover over SSH node as shown in the image below:
Then into the box that appears type the ssh command ex. ssh Admin#REMOTE_PC
This will show you the list to choose your config that you previously created, select it from the list.
Then you should be prompted to connect to remote host.
Related
I have the lastest version of Visual Code installed on my Windows Server 2022 machine.
I have the Powershell Extensions installed in Visual Code
Initially Intellisense and the ability to run selected Powershell script from the file were working. Now, they've suddenly stopped working. Intellisense does nothing, nor does attempting to run a simple Powershell cmd via F8.
If I look at the Visual Code bottom status bar, it looks like Powershell does not start. The Progress indicator just keeps spinning.
This is the contents of my exthost.log file:
2023-02-03 19:48:33.473 [info] Extension host with pid 12980 started
2023-02-03 19:48:33.522 [info] ExtensionService#_doActivateExtension
ms-vscode.powershell, startup: false, activationEvent:
'onLanguage:powershell' 2023-02-03 19:48:33.580 [info]
ExtensionService#_doActivateExtension ms-vscode.powershell-preview,
startup: false, activationEvent: 'onLanguage:powershell' 2023-02-03
19:48:33.626 [info] ExtensionService#_doActivateExtension
vscode.emmet, startup: false, activationEvent: 'onLanguage' 2023-02-03
19:48:33.633 [info] ExtensionService#_doActivateExtension
vscode.git-base, startup: true, activationEvent: '', root cause:
vscode.git 2023-02-03 19:48:33.636 [info]
ExtensionService#_doActivateExtension EditorConfig.EditorConfig,
startup: true, activationEvent: '' 2023-02-03 19:48:33.691 [info]
ExtensionService#_doActivateExtension johnpapa.vscode-peacock,
startup: true, activationEvent: '' 2023-02-03 19:48:33.698 [info]
ExtensionService#_doActivateExtension mhutchie.git-graph, startup:
true, activationEvent: '' 2023-02-03 19:48:33.732 [info]
ExtensionService#_doActivateExtension oderwat.indent-rainbow, startup:
true, activationEvent: '' 2023-02-03 19:48:33.734 [info]
ExtensionService#_doActivateExtension vsls-contrib.codetour, startup:
true, activationEvent: '' 2023-02-03 19:48:33.745 [info]
ExtensionService#_doActivateExtension vsls-contrib.gistfs, startup:
true, activationEvent: '' 2023-02-03 19:48:33.763 [info]
ExtensionService#_doActivateExtension vsls-contrib.gitdoc, startup:
true, activationEvent: '' 2023-02-03 19:48:33.823 [error] Activating
extension ms-vscode.powershell-preview failed due to an error:
2023-02-03 19:48:33.823 [error] Error: command 'PowerShell.ShowLogs'
already exists at s.registerCommand
(c:\Users\Administrator\AppData\Local\Programs\Microsoft VS
Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:96:106489)
at Object.registerCommand
(c:\Users\Administrator\AppData\Local\Programs\Microsoft VS
Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:117:29961)
at new qa
(c:\Users\Administrator.vscode\extensions\ms-vscode.powershell-preview-2023.2.0\out\main.js:133:9998)
at SM
(c:\Users\Administrator.vscode\extensions\ms-vscode.powershell-preview-2023.2.0\out\main.js:133:13021)
at Ui.db (c:\Users\Administrator\AppData\Local\Programs\Microsoft VS
Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:108:14818)
at Ui.cb (c:\Users\Administrator\AppData\Local\Programs\Microsoft VS
Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:108:14519)
at c:\Users\Administrator\AppData\Local\Programs\Microsoft VS
Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:108:12519
at async f.n (c:\Users\Administrator\AppData\Local\Programs\Microsoft
VS
Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:94:6818)
at async f.m (c:\Users\Administrator\AppData\Local\Programs\Microsoft
VS
Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:94:6781)
at async f.l (c:\Users\Administrator\AppData\Local\Programs\Microsoft
VS
Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:94:6238)
2023-02-03 19:48:33.871 [info] ExtensionService#_doActivateExtension
vscode.git, startup: true, activationEvent: '' 2023-02-03
19:48:33.904 [info] ExtensionService#_doActivateExtension
vscode.github, startup: true, activationEvent: '' 2023-02-03
19:48:33.958 [info] ExtensionService#_doActivateExtension
vscode.github-authentication, startup: false, activationEvent:
'onAuthenticationRequest:github' 2023-02-03 19:48:34.030 [error]
Activating extension vsls-contrib.gitdoc failed due to an error:
2023-02-03 19:48:34.030 [error] Error: Git model not found at
s.getAPI (c:\Users\Administrator\AppData\Local\Programs\Microsoft VS
Code\resources\app\extensions\git\dist\main.js:2:1937819) at
c:\Users\Administrator.vscode\extensions\vsls-contrib.gitdoc-0.1.0\out\git.js:28:34
at Generator.next () at fulfilled
(c:\Users\Administrator.vscode\extensions\vsls-contrib.gitdoc-0.1.0\out\git.js:5:58)
2023-02-03 19:48:34.031 [info] Eager extensions activated 2023-02-03
19:48:34.047 [info] ExtensionService#_doActivateExtension
vscode.debug-auto-launch, startup: false, activationEvent:
'onStartupFinished' 2023-02-03 19:48:34.050 [info]
ExtensionService#_doActivateExtension vscode.merge-conflict, startup:
false, activationEvent: 'onStartupFinished' 2023-02-03 19:48:34.061
[info] ExtensionService#_doActivateExtension
ms-vscode-remote.remote-wsl-recommender, startup: false,
activationEvent: 'onStartupFinished' 2023-02-03 19:48:34.070 [info]
ExtensionService#_doActivateExtension bierner.color-info, startup:
false, activationEvent: 'onStartupFinished' 2023-02-03 19:48:34.074
[info] ExtensionService#_doActivateExtension eamodio.gitlens, startup:
false, activationEvent: 'onStartupFinished' 2023-02-03 19:48:34.109
[info] ExtensionService#_doActivateExtension
GitHub.vscode-pull-request-github, startup: false, activationEvent:
'onStartupFinished' 2023-02-03 19:48:34.184 [info]
ExtensionService#_doActivateExtension Gruntfuggly.todo-tree, startup:
false, activationEvent: 'onStartupFinished' 2023-02-03 19:48:34.202
[info] ExtensionService#_doActivateExtension
ms-vscode-remote.remote-containers, startup: false, activationEvent:
'onStartupFinished' 2023-02-03 19:48:34.228 [info]
ExtensionService#_doActivateExtension ms-vscode-remote.remote-wsl,
startup: false, activationEvent: 'onStartupFinished' 2023-02-03
19:48:34.238 [info] ExtensionService#_doActivateExtension
rangav.vscode-thunder-client, startup: false, activationEvent:
'onStartupFinished' 2023-02-03 19:48:34.459 [info]
ExtensionService#_doActivateExtension usernamehw.errorlens, startup:
false, activationEvent: 'onStartupFinished' 2023-02-03 19:48:34.461
[info] ExtensionService#_doActivateExtension
vscode-icons-team.vscode-icons, startup: false, activationEvent:
'onStartupFinished' 2023-02-03 19:48:34.626 [info]
ExtensionService#_doActivateExtension vscode.microsoft-authentication,
startup: false, activationEvent: 'onAuthenticationRequest:microsoft'
2023-02-03 19:48:35.718 [error] Error: Git model not found at
s.getAPI (c:\Users\Administrator\AppData\Local\Programs\Microsoft VS
Code\resources\app\extensions\git\dist\main.js:2:1937819) at new _p
(c:\Users\Administrator.vscode\extensions\github.vscode-pull-request-github-0.58.0\dist\extension.js:1526:24442)
at _p.createProvider
(c:\Users\Administrator.vscode\extensions\github.vscode-pull-request-github-0.58.0\dist\extension.js:1526:25179)
at async $0
(c:\Users\Administrator.vscode\extensions\github.vscode-pull-request-github-0.58.0\dist\extension.js:1526:31243)
at async Zm
(c:\Users\Administrator.vscode\extensions\github.vscode-pull-request-github-0.58.0\dist\extension.js:1555:5616)
at async eg
(c:\Users\Administrator.vscode\extensions\github.vscode-pull-request-github-0.58.0\dist\extension.js:1555:6721)
I've tried uninstalling/installing the Powershell Extensions and Visual Code.
I've tried rebooting my machine several times.
Nothing seems to work so far.
I did the same installation process on a Windows Server 2019 box, and it works fine.
I installed on a Windows 10 machine and Intellisense does not work, although using F8 does.
To add more weirdness, I also see "Get Help for Command and "Run Selection" occur twice in my popup context menu in ps file I'm editing. That makes me believe that something is truly hosed with the install. I've tried uninstalling (Add - Remove) and rebooting. I still get the same results.
From doing some reading, it seems like Visual Code can be flakey when it comes to Powershell.
How do I figure out what the issues are and fix them?
I am having trouble connecting to libera.chat and irc.libera.chat using Konversation Version 1.8.21123 on Jammy Jellyfish (fully updated). I have worked through the steps given on https://userbase.kde.org/Konversatio...tication#step5 and still cannot connect. The repeating log is shown below.
[12:44] [Info] Looking for server irc.libera.chat (port 6697)...
[12:44] [Info] Server found, connecting...
[12:44] [Info] Negotiating capabilities with server...
[12:44] [Notice] -lithium.libera.chat- *** Checking Ident
[12:44] [Notice] -lithium.libera.chat- *** Looking up your hostname...
[12:44] [Notice] -lithium.libera.chat- *** Couldn't look up your hostname
[12:45] [Notice] -lithium.libera.chat- *** No Ident response
[12:45] [Capabilities] account-notify away-notify chghost extended-join multi-prefix sasl=PLAIN,ECDSA-NIST256P-CHALLENGE,EXTERNAL tls account-tag cap-notify echo-message server-time solanum.chat/identify-msg solanum.chat/oper solanum.chat/realhost
[12:45] [Info] Requesting capabilities: account-notify away-notify chghost extended-join multi-prefix sasl cap-notify server-time
[12:45] [Info] SASL capability acknowledged by server, attempting SASL PLAIN authentication...
[12:45] [Error] SASL authentication attempt failed.
[12:45] [Info] Closing capabilities negotiation.
[12:45] [Error] Connection to server irc.libera.chat (port 6697) lost: The TLS/SSL connection has been closed.
[12:45] [Info] Trying to reconnect to irc.libera.chat (port 6697) in 10 seconds.
[12:45] [Info] Looking for server irc.libera.chat (port 6697)... <-- Log repeats from this line.
Is there something blatant that I have overlooked ?
Is there some web page that I need to visit in order to register my ident/hostname/whatever (!) ?
Stuart
Following the indications here: https://hyperledger-fabric-ca.readthedocs.io/en/release-1.4/users-guide.html#configuring-the-database I'm trying to understand how to correctly set Fabric-CA with a PostgreSQL-11 database in Ubuntu 18.04.02 Server Edition.
I created a postgresql-11 db to which I can connect with SSL:
(base) marco#pc:~$ psql --cluster 11/fabmnet -h 127.0.0.1 -d fabmnetdb -U fabmnet_admin
Password for user fabmnet_admin:
psql (11.5 (Ubuntu 11.5-1.pgdg18.04+1))
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, bits: 256, compression: off)
Type "help" for help.
fabmnetdb=> \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+---------------+----------+---------+---------+-----------------------
fabmnetdb | fabmnet_admin | UTF8 | C.UTF-8 | C.UTF-8 |
postgres | postgres | UTF8 | C.UTF-8 | C.UTF-8 |
template0 | postgres | UTF8 | C.UTF-8 | C.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | C.UTF-8 | C.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
(4 rows)
fabmnetdb=>
but when trying to start a fabric-ca-server :
(base) marco#pc:~/fabric/fabric-ca$ fabric-ca-server start -b admin:adminpw
2019/09/23 11:54:20 [INFO] Configuration file location: /home/marco/fabric/fabric-ca/fabric-ca-
server-config.yaml
2019/09/23 11:54:20 [INFO] Starting server in home directory: /home/marco/fabric/fabric-ca
2019/09/23 11:54:20 [INFO] Server Version: 1.4.4
2019/09/23 11:54:20 [INFO] Server Levels: &{Identity:2 Affiliation:1 Certificate:1 Credential:1
RAInfo:1 Nonce:1}
2019/09/23 11:54:20 [INFO] The CA key and certificate already exist
2019/09/23 11:54:20 [INFO] The key is stored by BCCSP provider 'SW'
2019/09/23 11:54:20 [INFO] The certificate is at: /home/marco/fabric/fabric-ca/ca-cert.pem
2019/09/23 11:54:20 [WARNING] Failed to connect to database 'fabmnetdb'
2019/09/23 11:54:20 [WARNING] Failed to connect to database 'postgres'
2019/09/23 11:54:20 [WARNING] Failed to connect to database 'template1'
2019/09/23 11:54:20 [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
2019/09/23 11:54:20 [INFO] Home directory for default CA: /home/marco/fabric/fabric-ca
2019/09/23 11:54:20 [INFO] Operation Server Listening on 127.0.0.1:9443
2019/09/23 11:54:20 [INFO] Listening on http://0.0.0.0:7054
This is how I set the pg_hba.conf file in the fabmnet postgresql cluster :
(base) marco#pc:~$ sudo -su postgres
(base) postgres#pc:~$ nano /etc/postgresql/11/fabmnet/pg_hba.conf
Unable to create directory /home/marco/.local/share/nano/: Permission denied
It is required for saving/loading search history or cursor positions.
Press Enter to continue
# TYPE DATABASE USER ADDRESS METHOD
# Database administrative login by Unix domain socket
local all postgres peer
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# Allow connections from 10.1.2.0/24 subnet only to fabric_ca_db for fabric_ca_user
hostssl fabmnetdb fabmnet_admin 10.1.2.0/24 cert
# IPv6 local connections:
host all all ::1/128 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
local replication all peer
host replication all 127.0.0.1/32 md5
host replication all ::1/128 md5
And this is the db's configuration in (base) marco#pc:~$ nano ./fabric/fabric-ca/fabric-ca-
server-config.yaml :
db:
type: postgres
datasource: host=localhost port=5433 user=fabmnet_admin password=pwd dbname=fabmnetdb
sslmode=verify-full
---Update 01---:
Trying again to start fabric-ca-server:
(base) marco#pc:~/fabric/fabric-ca$ fabric-ca-server start -b
admin:adminpw
2019/09/25 20:56:57 [INFO] Configuration file location: /home/marco/fabric
/fabric-ca/fabric-ca-server-config.yaml
2019/09/25 20:56:57 [INFO] Starting server in home directory: /home/marco
/fabric/fabric-ca
2019/09/25 20:56:57 [INFO] Server Version: 1.4.4
2019/09/25 20:56:57 [INFO] Server Levels: &{Identity:2 Affiliation:1
Certificate:1 Credential:1 RAInfo:1 Nonce:1}
2019/09/25 20:56:57 [INFO] The CA key and certificate already exist
2019/09/25 20:56:57 [INFO] The key is stored by BCCSP provider 'SW'
2019/09/25 20:56:57 [INFO] The certificate is at: /home/marco/fabric
/fabric-ca/ca-cert.pem
2019/09/25 20:56:57 [WARNING] Failed to connect to database 'fabmnetdb'
2019/09/25 20:56:57 [WARNING] Failed to connect to database 'postgres'
2019/09/25 20:56:57 [WARNING] Failed to connect to database 'template1'
2019/09/25 20:56:57 [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
2019/09/25 20:56:57 [INFO] Home directory for default CA: /home/marco
/fabric/fabric-ca
2019/09/25 20:56:57 [INFO] Operation Server Listening on 127.0.0.1:9443
2019/09/25 20:56:57 [INFO] Listening on http://0.0.0.0:7054
This is the corresponding part in /var/log/postgresql/postgresql-11-fabmnet.log :
2019-09-25 20:51:52.655 CEST [1096] LOG: listening on IPv6 address "::1",
port 5433
2019-09-25 20:51:52.673 CEST [1096] LOG: listening on IPv4 address
"127.0.0.1", port 5433
2019-09-25 20:51:52.701 CEST [1096] LOG: listening on Unix socket
"/var/run/postgresql/.s.PGSQL.5433"
2019-09-25 20:51:52.912 CEST [1171] LOG: database system was interrupted;
last known up at 2019-09-25 09:50:30 CEST
2019-09-25 20:51:53.001 CEST [1171] LOG: database system was not properly
shut down; automatic recovery in progress
2019-09-25 20:51:53.011 CEST [1171] LOG: redo starts at 0/1668238
2019-09-25 20:51:53.011 CEST [1171] LOG: invalid record length at
0/1668318: wanted 24, got 0
2019-09-25 20:51:53.011 CEST [1171] LOG: redo done at 0/16682E0
2019-09-25 20:51:53.043 CEST [1096] LOG: database system is ready to
accept connections
2019-09-25 20:51:53.569 CEST [1206] [unknown]#[unknown] LOG: incomplete
startup packet
2019-09-25 20:56:57.540 CEST [4620] [unknown]#[unknown] LOG: could not
accept SSL connection: sslv3 alert bad certificate
2019-09-25 20:56:57.543 CEST [4622] [unknown]#[unknown] LOG: could not
accept SSL connection: sslv3 alert bad certificate
2019-09-25 20:56:57.544 CEST [4623] [unknown]#[unknown] LOG: could not
accept SSL connection: sslv3 alert bad certificate
--- Update 02 ---
Affer removing the previous cert and key files, I started again the fabric-ca server discovering that new cert and key files were created:
(base) marco#pc:~/fabric/fabric-ca$ fabric-ca-server start -b
admin:adminpw
2019/09/26 11:56:18 [INFO] Configuration file location: /home/marco
/fabric/fabric-ca/fabric-ca-server-config.yaml
2019/09/26 11:56:18 [INFO] Starting server in home directory:
/home/marco/fabric/fabric-ca
2019/09/26 11:56:18 [INFO] Server Version: 1.4.4
2019/09/26 11:56:18 [INFO] Server Levels: &{Identity:2 Affiliation:1
Certificate:1 Credential:1 RAInfo:1 Nonce:1}
2019/09/26 11:56:18 [WARNING] &{69 The specified CA certificate file
/home/marco/fabric/fabric-ca/ca-cert.pem does not exist}
2019/09/26 11:56:18 [INFO] generating key: &{A:ecdsa S:256}
2019/09/26 11:56:18 [INFO] encoded CSR
2019/09/26 11:56:18 [INFO] signed certificate with serial number
542755587310273579559145444277178107021548224556
2019/09/26 11:56:18 [INFO] The CA key and certificate were generated for
CA
2019/09/26 11:56:18 [INFO] The key was stored by BCCSP provider 'SW'
2019/09/26 11:56:18 [INFO] The certificate is at: /home/marco/fabric
/fabric-ca/ca-cert.pem
2019/09/26 11:56:18 [WARNING] Failed to connect to database 'fabmnetdb'
2019/09/26 11:56:18 [WARNING] Failed to connect to database 'postgres'
2019/09/26 11:56:18 [WARNING] Failed to connect to database 'template1'
2019/09/26 11:56:18 [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
2019/09/26 11:56:18 [INFO] Home directory for default CA: /home/marco
/fabric/fabric-ca
2019/09/26 11:56:18 [INFO] Operation Server Listening on 127.0.0.1:9443
2019/09/26 11:56:18 [INFO] Listening on http://0.0.0.0:7054
but, again, the corresponding log says "bad certificate" :
2019-09-26 11:55:04.514 CEST [4837] [unknown]#[unknown] LOG: could not
accept SSL connection: sslv3 alert bad certificate
2019-09-26 11:55:04.517 CEST [4839] [unknown]#[unknown] LOG: could not
accept SSL connection: sslv3 alert bad certificate
2019-09-26 11:55:04.518 CEST [4840] [unknown]#[unknown] LOG: could not
accept SSL connection: sslv3 alert bad certificate
2019-09-26 11:56:18.967 CEST [4862] [unknown]#[unknown] LOG: could not
accept SSL connection: sslv3 alert bad certificate
2019-09-26 11:56:18.969 CEST [4865] [unknown]#[unknown] LOG: could not
accept SSL connection: sslv3 alert bad certificate
2019-09-26 11:56:18.971 CEST [4866] [unknown]#[unknown] LOG: could not
accept SSL connection: sslv3 alert bad certificate
So..how could it be "bad certificate" if it's just been created brand new by the execution of fabric-ca-server start?
--- Update 03 ---
I initialized again fabric-ca-server in order to check if it creates the .key file as well:
(base) marco#pc:~/fabric/fabric-ca$ fabric-ca-server init -b
admin:adminpw
2019/09/26 14:52:52 [INFO] Configuration file location: /home/marco
/fabric/fabric-ca/fabric-ca-server-config.yaml
2019/09/26 14:52:52 [INFO] Server Version: 1.4.4
2019/09/26 14:52:52 [INFO] Server Levels: &{Identity:2 Affiliation:1
Certificate:1 Credential:1 RAInfo:1 Nonce:1}
2019/09/26 14:52:52 [WARNING] &{69 The specified CA certificate file
/home/marco/fabric/fabric-ca/ca-cert.pem does not exist}
2019/09/26 14:52:52 [INFO] generating key: &{A:ecdsa S:256}
2019/09/26 14:52:52 [INFO] encoded CSR
2019/09/26 14:52:52 [INFO] signed certificate with serial number
632719069251912632400042774311489818382937855511
2019/09/26 14:52:52 [INFO] The CA key and certificate were generated for
CA
2019/09/26 14:52:52 [INFO] The key was stored by BCCSP provider 'SW'
2019/09/26 14:52:52 [INFO] The certificate is at: /home/marco
/fabricfabric-ca/ca-cert.pem
2019/09/26 14:52:52 [WARNING] Failed to connect to database 'fabmnetdb'
2019/09/26 14:52:52 [WARNING] Failed to connect to database 'postgres'
2019/09/26 14:52:52 [WARNING] Failed to connect to database 'template1'
2019/09/26 14:52:52 [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
2019/09/26 14:52:52 [INFO] Home directory for default CA: /home/marco
/fabric/fabric-ca
2019/09/26 14:52:52 [INFO] Initialization was successful
I then modified /etc/postgresql/11/fabmnet/postgresql.conf accordingly:
ssl = on
ssl_cert_file = '/home/marco/fabric/fabric-ca/ca-cert.pem'
ssl_key_file = '/home/marco/fabric/fabric-ca/msp/keystore
/a486a5dbb2f9b44bfac55203dd3268be760b22eff1c6f451fdf93d6394e3da30_sk'
But again, after restarting postgresql, executing the start of fabric-ca-server gives error again:
(base) marco#pc:~/fabric/fabric-ca$ fabric-ca-server start -b
admin:adminpw
2019/09/26 15:05:06 [INFO] Configuration file location: /home/marco
/fabric/fabric-ca/fabric-ca-server-config.yaml
2019/09/26 15:05:06 [INFO] Starting server in home directory:
/home/marco/fabric/fabric-ca
2019/09/26 15:05:06 [INFO] Server Version: 1.4.4
2019/09/26 15:05:06 [INFO] Server Levels: &{Identity:2 Affiliation:1
Certificate:1 Credential:1 RAInfo:1 Nonce:1}
2019/09/26 15:05:06 [INFO] The CA key and certificate already exist
2019/09/26 15:05:06 [INFO] The key is stored by BCCSP provider 'SW'
2019/09/26 15:05:06 [INFO] The certificate is at: /home/marco/fabric
/fabric-ca/ca-cert.pem
2019/09/26 15:05:06 [WARNING] Failed to connect to database 'fabmnetdb'
2019/09/26 15:05:06 [WARNING] Failed to connect to database 'postgres'
2019/09/26 15:05:06 [WARNING] Failed to connect to database 'template1'
2019/09/26 15:05:06 [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
2019/09/26 15:05:06 [INFO] Home directory for default CA: /home/marco
/fabric/fabric-ca
2019/09/26 15:05:06 [INFO] Operation Server Listening on 127.0.0.1:9443
2019/09/26 15:05:06 [INFO] Listening on http://0.0.0.0:7054
--- Update 04 ---
In order to restart from a clean situation and configuration, I removed the previous fabric-ca folder, created a new one, and then initiated the fabric-ca-server. With the default SQLite everything seem working fine. But one I try to use the PostgreSQL-11 db I created before, errors appear:
(base) marco#pc:~/fabric$ rm -rf fabric-ca
(base) marco#pc:~/fabric$ mkdir fabric-ca
(base) marco#pc:~/fabric$ cd fabric-ca/
(base) marco#pc:~/fabric/fabric-ca$ fabric-ca-server init -b
admin:adminpw
(base) marco#pc:~/fabric/fabric-ca$ fabric-ca-server start -b
admin:adminpw
2019/09/26 15:48:54 [INFO] Created default configuration file at
/home/marco/fabric/fabric-ca/fabric-ca-server-config.yaml
2019/09/26 15:48:54 [INFO] Starting server in home directory:
/home/marco/fabric/fabric-ca
2019/09/26 15:48:54 [INFO] Server Version: 1.4.4
2019/09/26 15:48:54 [INFO] Server Levels: &{Identity:2 Affiliation:1
Certificate:1 Credential:1 RAInfo:1 Nonce:1}
2019/09/26 15:48:54 [WARNING] &{69 The specified CA certificate file
/home/marco/fabric/fabric-ca/ca-cert.pem does not exist}
2019/09/26 15:48:54 [INFO] generating key: &{A:ecdsa S:256}
2019/09/26 15:48:54 [INFO] encoded CSR
2019/09/26 15:48:54 [INFO] signed certificate with serial number
162595303982096068338873480987512684820342253664
2019/09/26 15:48:54 [INFO] The CA key and certificate were generated for
CA
2019/09/26 15:48:54 [INFO] The key was stored by BCCSP provider 'SW'
2019/09/26 15:48:54 [INFO] The certificate is at: /home/marco/fabric
/fabric-ca/ca-cert.pem
2019/09/26 15:48:54 [INFO] Initialized sqlite3 database at /home/marco
/fabric/fabric-ca/fabric-ca-server.db
2019/09/26 15:48:54 [INFO] The issuer key was successfully stored. The
public key is at: /home/marco/fabric/fabric-ca/IssuerPublicKey, secret
key is at: /home/marco/fabric/fabric-ca/msp/keystore/IssuerSecretKey
2019/09/26 15:48:54 [INFO] Idemix issuer revocation public and secret
keys were generated for CA ''
2019/09/26 15:48:54 [INFO] The revocation key was successfully stored.
The public key is at: /home/marco/fabric/fabric-
ca/IssuerRevocationPublicKey, private key is at: /home/marco/fabric
/fabric-ca/msp/keystore/IssuerRevocationPrivateKey
2019/09/26 15:48:54 [INFO] Home directory for default CA: /home/marco
/fabric/fabric-ca
2019/09/26 15:48:54 [INFO] Operation Server Listening on 127.0.0.1:9443
2019/09/26 15:48:54 [INFO] Listening on http://0.0.0.0:7054
I set the brand-new fabric-ca-server-config.yaml in this way:
#db:
# type: sqlite3
# datasource: fabric-ca-server.db
# tls:
# enabled: false
# certfiles:
# client:
# certfile:
# keyfile:
db:
type: postgres
datasource: host=localhost port=5433 user=fabmnet_admin
password=password dbname=fabmnetdb sslmode=verify-full
and in /etc/postgresql/11/fabmnet/postgresql.conf :
ssl = on
ssl_cert_file = '/home/marco/fabric/fabric-ca/ca-cert.pem'
ssl_key_file = '/home/marco/fabric/fabric-ca/msp/keystore
/IssuerSecretKey'
After systemctl restart postgresql, I tried to start the fabric-ca-server:
(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
2019/09/26 15:56:50 [INFO] Home directory for default CA: /home/marco
/fabric/fabric-ca
2019/09/26 15:56:50 [INFO] Operation Server Listening on 127.0.0.1:9443
2019/09/26 15:56:50 [INFO] Listening on http://0.0.0.0:7054
Before I also removed all the previous content of /var/log/postgresql/postgresql-11-fabmnet.log to have a clean situation. But strangely now I do not get any new logging information in postgresql-11-fabmnet.log
So. I think there must be something to fix in the interface between fabric-ca-server and PostgreSQL-11 db. In fabric-ca-server-config.yaml, in postgresql.conf, in both or somewhere else.
-- Update 05 ---
Now after fixing configuration in postgresql-11 I can connect with ssh to the database (changed db's name) :
(base) postgres#pc:~$ psql --cluster 11/fabmnet -h localhost -d fabmnet_ca
Password for user postgres:
psql (11.5 (Ubuntu 11.5-1.pgdg18.04+1))
Type "help" for help.
fabmnet_ca=# \conninfo
You are connected to database "fabmnet_ca" as user "postgres" on host
"localhost" at port "5433".
fabmnet_ca=#
But I still cannot connect fabric-ca-server to postgreSQL's db with ssh:
/var/log/postgresql/postgresql-11-fabmnet.log :
2019-09-27 15:32:59.651 CEST [5080] [unknown]#[unknown] LOG: could not
accept SSL connection: sslv3 alert bad certificate
This is what I set in fabric-ca-server-config.yaml :
#db:
# type: sqlite3
# datasource: fabric-ca-server.db
# tls:
# enabled: false
# certfiles:
# client:
# certfile:
# keyfile:
db:
type: postgres
datasource: host=localhost port=5433 user=postgres password=pwd
dbname=fabmnet_ca sslmode=verify-full
tls:
enabled: false
certfiles:
client:
certfile:
keyfile:
How to correctly set Fabric-CA in order to make it see and use PostgreSQL-11 database?
Looking forward to your kind help
Marco
I am trying to deploy my Scalatra web application in heroku but I am having one problem.
My application works in local with SBT and using "heroku local web". I am using heroku sbt plugin.
When I use "sbt stage deployHeroku" the application is uploaded and started properly, obtaining:
user#user-X550JF:~/Documents/SOFT/cloudrobe$ sbt stage deployHeroku
Detected sbt version 0.13.9
....
....
[info] Packaging /home/user/Documents/SOFT/cloudrobe/target/scala-2.11/cloudrobe_2.11-0.1.0-SNAPSHOT.war ...
[info] Done packaging.
[success] Total time: 2 s, completed May 25, 2016 1:04:51 AM
[info] -----> Packaging application...
[info] - app: cloudrobe
[info] - including: target/universal/stage/
[info] -----> Creating build...
[info] - file: target/heroku/slug.tgz
[info] - size: 45MB
[info] -----> Uploading slug... (100%)
[info] - success
[info] -----> Deploying...
[info] remote:
[info] remote: -----> Fetching set buildpack https://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/jvm-common.tgz... done
[info] remote: -----> sbt-heroku app detected
[info] remote: -----> Installing OpenJDK 1.8... done
[info] remote:
[info] remote: -----> Discovering process types
[info] remote: Procfile declares types -> web
[info] remote:
[info] remote: -----> Compressing...
[info] remote: Done: 93.5M
[info] remote: -----> Launching...
[info] remote: Released v11
[info] remote: https://cloudrobe.herokuapp.com/ deployed to Heroku
[info] remote:
[info] -----> Done
___________________________________________________________________________
Using "heroku logs" I can see:
2016-05-24T23:14:16.007200+00:00 app[web.1]: 23:14:16.006 [main] INFO org.mongodb.driver.connection - Opened connection [connectionId{localValue:5, serverValue:5}] to localhost:33333
2016-05-24T23:14:16.370324+00:00 app[web.1]: 23:14:16.370 [main] INFO o.f.s.servlet.ServletTemplateEngine - Scalate template engine using working directory: /tmp/scalate-5146893161861816095-workdir
2016-05-24T23:14:16.746719+00:00 app[web.1]: 23:14:16.746 [main] INFO o.e.j.server.handler.ContextHandler - Started o.e.j.w.WebAppContext#7a356a0d{/,file:/app/src/main/webapp,AVAILABLE}
2016-05-24T23:14:16.782745+00:00 app[web.1]: 23:14:16.782 [main] INFO o.e.jetty.server.ServerConnector - Started ServerConnector#7dc51783{HTTP/1.1}{0.0.0.0:8080}
2016-05-24T23:14:16.782924+00:00 app[web.1]: 23:14:16.782 [main] INFO org.eclipse.jetty.server.Server - Started #6674ms
But, 5 or 10 seconds later appears the following error showing that the connection has been timed out:
2016-05-24T23:52:32.962896+00:00 heroku[router]: at=error code=H20 desc="App boot timeout" method=GET path="/" host=cloudrobe.herokuapp.com request_id=a7f68d98-54a2-44b7-8f5f-47efce0f1833 fwd="52.90.128.17" dyno= connect= service= status=503 bytes=
2016-05-24T23:52:45.463575+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
This is my Procfile using the port 5000:
web: target/universal/stage/bin/cloudrobe -Dhttp.address=127.0.0.1
Thank you.
Your app is binding to port 8080, but it needs to bind to the port set as the $PORT environment variable on Heroku. To do this, you need to add -Dhttp.port=$PORT to your Procfile. It also needs to bind to 0.0.0.0 and not 127.0.0.1. So it might look like this:
web: target/universal/stage/bin/cloudrobe -Dhttp.address=0.0.0.0 -Dhttp.port=$PORT
Does anyone have any experience working with DeepDive? It involves installing Java, Python 2.x, PostgreSQL, and SBT, then the DeepDive package. I'm not very familiar with PostgreSQL, but I'm intending to learn these simultaneously.
I'm working on Ubuntu 12.04 and PostgreSQL 9.1. I made a superuser for PostgreSQL using the command in the shell createuser tom. It's worth noting that my Ubuntu username is also tom. I then changed the password for tom with the following:
$su - postgres
$psql
--> ALTER USER tom WITH password 'pa$$w0RD';
DeepDive comes with a test script, which gives me the following error (I'm not including all the other text, which doesn't include errors).
[info] LogisticRegressionApp:
[info] - should work *** FAILED ***
[info] org.postgresql.util.PSQLException: FATAL: password authentication failed for user "tom"
[info] at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:398)
[info] at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:173)
[info] at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:64)
[info] at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:136)
[info] at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:29)
[info] at org.postgresql.jdbc3g.AbstractJdbc3gConnection.<init>(AbstractJdbc3gConnection.java:21)
[info] at org.postgresql.jdbc4.AbstractJdbc4Connection.<init>(AbstractJdbc4Connection.java:31)
[info] at org.postgresql.jdbc4.Jdbc4Connection.<init>(Jdbc4Connection.java:24)
[info] at org.postgresql.Driver.makeConnection(Driver.java:393)
[info] at org.postgresql.Driver.connect(Driver.java:267)
[info] ...
Then at the end:
[info] Tests: succeeded 68, failed 2, canceled 0, ignored 0, pending 3
[info] *** 2 TESTS FAILED ***
[error] Failed tests:
[error] org.deepdive.test.integration.LogisticRegressionApp
[error] org.deepdive.test.unit.InferenceManagerSpec
[error] Error during tests:
[error] org.deepdive.test.unit.PostgresInferenceDataStoreSpec
[error] org.deepdive.test.unit.PostgresExtractionDataStoreSpec
[error] (test:test) sbt.TestsFailedException: Tests unsuccessful
[error] Total time: 10 s, completed Mar 17, 2014 8:51:47 PM
If anyone can point me in some direction, I'd appreciate it.
OK, I fixed part of the problem, but this led to a different problem. Here's what I did. test.sh contains the following lines:
export PGUSER=${PGUSER:-`whoami`}
export PGPASSWORD=${PGPASSWORD:-}
which I changed to
export PGUSER=tom
export PGPASSWORD=pa$$w0rd
Now the test proceeds farther, and gets to the point where it prints the following:
06:49:40.953 [default-dispatcher-7][$a][LocalActorRef] INFO Message [org.deepdive.calibration.CalibrationDataWriter$WriteCalibrationData] from Actor[akka://deepdive/temp/$a] to Actor[akka://deepdive/user/inferenceManager/$a#-1669803870] was not delivered. [1] dead letters encountered. This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.
06:49:40.955 [default-dispatcher-7][$a][LocalActorRef] INFO Message [akka.actor.PoisonPill$] from Actor[akka://deepdive/user/inferenceManager#-354953956] to Actor[akka://deepdive/user/inferenceManager/$a#-1669803870] was not delivered. [2] dead letters encountered. This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.
06:49:40.957 [default-dispatcher-5][inferenceManager][InferenceManager$PostgresInferenceManager] INFO Starting
06:49:40.958 [default-dispatcher-6][factorGraphBuilder][FactorGraphBuilder$PostgresFactorGraphBuilder] INFO Starting
06:50:06.679 [TaskManagerSpec-scheduler-1][akka://TaskManagerSpec/user/$$d][TaskManager] INFO Memory usage: 233/982MB (max: 982MB)
06:50:06.699 [TaskManagerSpec-scheduler-1][akka://TaskManagerSpec/user/$$e][TaskManager] INFO Memory usage: 233/982MB (max: 982MB)
06:50:06.709 [TaskManagerSpec-scheduler-1][akka://TaskManagerSpec/user/$$f][TaskManager] INFO Memory usage: 233/982MB (max: 982MB)
06:50:06.738 [TaskManagerSpec-scheduler-1][akka://TaskManagerSpec/user/$$g][TaskManager] INFO Memory usage: 233/982MB (max: 982MB)
06:50:06.759 [TaskManagerSpec-scheduler-1][akka://TaskManagerSpec/user/$$h][TaskManager] INFO Memory usage: 233/982MB (max: 982MB)
06:50:06.780 [TaskManagerSpec-scheduler-1][akka://TaskManagerSpec/user/$$i][TaskManager] INFO Memory usage: 233/982MB (max: 982MB)
06:50:06.799 [TaskManagerSpec-scheduler-1][akka://TaskManagerSpec/user/$$j][TaskManager] INFO Memory usage: 233/982MB (max: 982MB)
06:50:07.396 [default-dispatcher-5][taskManager][TaskManager] INFO Memory usage: 233/982MB (max: 982MB)
And this continues ad infinitum. The key seems to be the first line, about the message not being delivered between the two Actors.
As I noted in a comment below, I checked out the postgresql.conf file, and uncommented the following line
listen_addresses = 'localhost'
listen on;
It resolved one of the original errors, but not the second error.
In item 2 of Patrick's response, here are the parameters from the pg_hba.conf file:
# Database administrative login by Unix domain socket
local all postgres peer
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
Doesn't the part local all all support all local connections?
The error you mention can have multiple causes:
Have you modified postgresql.conf to accept incoming TCP/IP connections? Check the listen_addresses parameter.
Have you modified pg_hba.conf? Here you need setup an authentication method for DeepDive and/or the jdbc driver definition.
Lastly, can DeepDive connect to the database it intends to connect to with the credentials you have supplied it (or the jdbc driver definition)?
Both of the configuration files are in your $PGDATA directory, typically /etc/postgresql/9.3/main.
Note that psql logs on using the unix sockets by default (unless you specify -h host_ip) and jdbc uses a TCP/IP connection. Try psql over TCP/IP to see if that works. If not, work on 1, then 2. If it does, work on 2, then 3.