Skip to content

Conversation

@bigorn0
Copy link
Contributor

@bigorn0 bigorn0 commented Sep 9, 2024

Sub-bugHCK-7941 Fix Postgres ssh tunelling

Content

When trying to RE from an AWS RDS instance e.g. through ssh tunneling with an EC2 instance it's been discovered that the RE process was crashing.

image
    "message": "write EPIPE",
    "stack": "Error: write EPIPE\n    at target._send (node:internal/child_process:879:20)\n    at target.send (node:internal/child_process:752:19)\n    at callMethod (/Users/bigorn0/dev/hackolade/studio/services/workerService/createWorkerConsumer.js:52:10)\n    at /Users/bigorn0/dev/hackolade/studio/services/workerService/createWorkerConsumer.js:65:7\n    at new Promise (<anonymous>)\n    at Object.openTunnel (/Users/bigorn0/dev/hackolade/studio/services/workerService/createWorkerConsumer.js:64:6)\n    at createClient (/Users/bigorn0/.hackolade/plugins-develop/PostgreSQL/reverse_engineering/helpers/connectionHelper.js:64:40)\n    at Object.connect (/Users/bigorn0/.hackolade/plugins-develop/PostgreSQL/reverse_engineering/helpers/postgresService.js:74:41)\n    at async Object.getDbCollectionsNames (/Users/bigorn0/.hackolade/plugins-develop/PostgreSQL/reverse_engineering/api.js:81:4)\n    at async callApiHandler (/Users/bigorn0/dev/hackolade/studio/RE_API/helpers/callApiHandler.js:66:2)",
    "code": "EPIPE",
    "originalMessage": "write EPIPE"
}




Date: Tue Sep 10 2024 13:44:59 GMT+0200 (Central European Summer Time)
Application version: 7.7.8 (desktop)

System information:
 Hostname:  ub1home
 Platform:  darwin arm64
 Release:   23.5.0
 Version:   Darwin Kernel Version 23.5.0: Wed May  1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000
 Uptime:    973:29
 Total RAM: 16.00 GB
 CPU Model: Apple M1 Pro
 CPU Clock: 2400 MHZ
 CPU Cores: 10 cores

Application Information: 
Application version: 7.7.8 
Target: PostgreSQL 
Plugin version: 0.2.9

Technical details

The connect function is currently trying to always setup the ssh tunnel when it's called thus the function can't be called twice in the same RE process because we try to re-setup the ssh tunnel twice and it's failing with a weird error. (Maybe it means we need a better connectivity management but that's another story...).

@bigorn0 bigorn0 marked this pull request as ready for review September 10, 2024 11:45
@bigorn0 bigorn0 changed the title Connecting twice after listing databases was failing on opening the sssh tunnel twice [HCK-7941] Connecting twice after listing databases was failing on opening the ssh tunnel Sep 10, 2024
@bigorn0 bigorn0 closed this Sep 10, 2024
@bigorn0 bigorn0 reopened this Sep 10, 2024
@sonarqubecloud
Copy link

@chulanovskyi-bs chulanovskyi-bs enabled auto-merge (squash) September 10, 2024 11:52
@chulanovskyi-bs chulanovskyi-bs merged commit f081aa9 into develop Sep 10, 2024
@chulanovskyi-bs chulanovskyi-bs deleted the fix/ssh-tunneling-dont-reconnect-after-initial-connection branch September 10, 2024 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants