RE: SSH Tunnel Broken on version 6.14

From: Paul & Caroline Lewis <paulcaz80(at)hotmail(dot)com>
To: Akshay Joshi <akshay(dot)joshi(at)enterprisedb(dot)com>
Cc: "pgadmin-support(at)lists(dot)postgresql(dot)org" <pgadmin-support(at)lists(dot)postgresql(dot)org>
Subject: RE: SSH Tunnel Broken on version 6.14
Date: 2022-10-13 16:30:23
Message-ID: PA4PR03MB829544A84D4694FF43EC42B1B7259@PA4PR03MB8295.eurprd03.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

Thanks for input guys but not sure what else I can check to help.
Suggestions welcome and I'll try.

Not a big issue my side as I can connect with version 5.0 but I’m sure you’d rather know what might be wrong!!

Anyway, my setup is.
PostgreSQL is 14.1 running on an AWS RDS service.
Tunnel VM is an old AWS EC2 VM running Ubuntu 14. (Can try a newer version if possible issue there.)
My machine is Windows 10.
My PEM key is password protected.

The strange bit is that I can currently connect fine from PGAdmin V5.0 but get the SSH gateway error when I try PGAdmin V6.14 on the same setup.
I have V5 and V6 running on the same Windows 10 Machine.
1 difference in the 2 connections involves the connection dialogue, in images below.
Both versions pop up a dialogue to enter the key password and database password.
But V5.0 dialogue doesn't request my PEM key password only the DB password, the V6 dialogue defaults to wanting me to enter it the key password first then the DB password.
Whether I enter the key password or not V6 just results in the error shown in image below.

I can SSH fine through Putty with that PEM key to the VM and the VM can connect fine to the DB.

Regards

Paul

PGAdmin V6.14 Images
[cid:image002(dot)png(at)01D8DF29(dot)77537140]
[cid:image007(dot)png(at)01D8DF29(dot)77537140]

PGAdmin V5.0 Images
[cid:image009(dot)png(at)01D8DF29(dot)77537140]
[cid:image011(dot)png(at)01D8DF29(dot)77537140]

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows

From: Akshay Joshi<mailto:akshay(dot)joshi(at)enterprisedb(dot)com>
Sent: Thursday 13 October 2022 07:05
To: Paul & Caroline Lewis<mailto:paulcaz80(at)hotmail(dot)com>
Cc: pgadmin-support(at)lists(dot)postgresql(dot)org<mailto:pgadmin-support(at)lists(dot)postgresql(dot)org>
Subject: Re: SSH Tunnel Broken on version 6.14

Hi Paul

I am not able to reproduce the issue. I have tried today with the following setup:

1. VM 1 (Ubuntu 22) : PostgreSQL 13 install on this machine.
2. VM 2 (Windows 10): pgAdmin v6.14 installed on this machine.
3. Base Machine (OSX Monterey): Used for creating the SSH tunnel between the database server and pgAdmin. Public key created on the Windows machine is saved on this machine.

Please refer to the attached screenshots.

On Wed, Oct 12, 2022 at 3:30 PM Paul & Caroline Lewis <paulcaz80(at)hotmail(dot)com<mailto:paulcaz80(at)hotmail(dot)com>> wrote:
I’ve been using PGAdmin V5.0 to SSH Tunnel to an AWS RDS PostgreSQL DB through an AWS EC2 VM for quite a while now with no problems.
The tunnel uses a pem key with a password.
Luckily I didn’t uninstall this version as I can still get connected, however yesterday I installed V6.14 but keep getting a ‘cannot establish SSH gateway’ error message as follows!!

********************************************************************************
2022-10-11 20:22:48,238: ERROR pgadmin: Could not establish session to SSH gateway
Traceback (most recent call last):
File "C:\Program Files\pgAdmin 4\v6\web\pgadmin\utils\driver\psycopg2\server_manager.py", line 587, in create_ssh_tunnel
self.tunnel_object.start()
File "C:\Program Files\pgAdmin 4\v6\python\lib\site-packages\sshtunnel.py", line 1331, in start
self._raise(BaseSSHTunnelForwarderError,
File "C:\Program Files\pgAdmin 4\v6\python\lib\site-packages\sshtunnel.py", line 1174, in _raise
raise exception(reason)
sshtunnel.BaseSSHTunnelForwarderError: Could not establish session to SSH gateway
2022-10-11 20:22:48,243: ERROR pgadmin: Could not connect to server(#7) - 'Ubipix Database'.
Error: Failed to create the SSH tunnel.
Error: Could not establish session to SSH gateway
********************************************************************************

The startup log is as follows:
********************************************************************************
ALLOW_SAVE_PASSWORD = True
ALLOW_SAVE_TUNNEL_PASSWORD = False
APP_COPYRIGHT = "Copyright (C) 2013 - 2022, The pgAdmin Development Team"
APP_ICON = "pg-icon"
APP_NAME = "pgAdmin 4"
APP_RELEASE = 6
APP_REVISION = 14
APP_SUFFIX = ""
APP_VERSION = "6.14"
APP_VERSION_EXTN = ('.css', '.js', '.html', '.svg', '.png', '.gif', '.ico')
APP_VERSION_INT = 61400
APP_VERSION_PARAM = "ver"
AUTHENTICATION_SOURCES = ['internal']
AUTO_DISCOVER_SERVERS = True
AZURE_CREDENTIAL_CACHE_DIR = "........\Roaming\pgadmin\azurecredentialcache"
CA_FILE = "C:\Program Files\pgAdmin 4\v6\web\cacert.pem"
CHECK_EMAIL_DELIVERABILITY = False
CHECK_SESSION_FILES_INTERVAL = 24
CHECK_SUPPORTED_BROWSER = True
COMPRESS_LEVEL = 9
COMPRESS_MIMETYPES = ['text/html', 'text/css', 'text/xml', 'application/json', 'application/javascript']
COMPRESS_MIN_SIZE = 500
CONSOLE_LOG_FORMAT = "%(asctime)s: %(levelname)s %(name)s: %(message)s"
CONSOLE_LOG_LEVEL = 30
CONTENT_SECURITY_POLICY = "default-src ws: http: data: blob: 'unsafe-inline' 'unsafe-eval';"
COOKIE_DEFAULT_DOMAIN = None
COOKIE_DEFAULT_PATH = "/"
DATA_DIR = ".......\AppData\Roaming\pgadmin"
DEBUG = False
DEFAULT_BINARY_PATHS = {'pg': '$DIR/../runtime', 'ppas': ''}
DEFAULT_SERVER = "127.0.0.1"
DEFAULT_SERVER_PORT = 5050
DESKTOP_USER = "pgadmin4(at)pgadmin(dot)org<mailto:pgadmin4(at)pgadmin(dot)org>"
EFFECTIVE_SERVER_PORT = 58388
ENABLE_BINARY_PATH_BROWSING = False
ENABLE_PSQL = True
ENHANCED_COOKIE_PROTECTION = True
FILE_LOG_FORMAT = "%(asctime)s: %(levelname)s %(name)s: %(message)s"
FILE_LOG_LEVEL = 30
HELP_PATH = "../../../docs/en_US/html/"
IS_WIN = True
KERBEROS_CCACHE_DIR = ".......\AppData\Roaming\pgadmin\krbccache"
KRB_APP_HOST_NAME = "127.0.0.1"
KRB_AUTO_CREATE_USER = True
KRB_KTNAME = "<KRB5_KEYTAB_FILE>"
LANGUAGES = {'en': 'English', 'zh': 'Chinese (Simplified)', 'cs': 'Czech', 'fr': 'French', 'de': 'German', 'it': 'Italian', 'ja': 'Japanese', 'ko': 'Korean', 'pl': 'Polish', 'pt_BR': 'Portuguese (Brazilian)', 'ru': 'Russian', 'es': 'Spanish'}
LDAP_ANONYMOUS_BIND = False
LDAP_AUTO_CREATE_USER = True
LDAP_BASE_DN = "<Base-DN>"
LDAP_BIND_USER = None
LDAP_CA_CERT_FILE = ""
LDAP_CERT_FILE = ""
LDAP_CONNECTION_TIMEOUT = 10
LDAP_DN_CASE_SENSITIVE = False
LDAP_KEY_FILE = ""
LDAP_SEARCH_BASE_DN = "<Search-Base-DN>"
LDAP_SEARCH_FILTER = "(objectclass=*)"
LDAP_SEARCH_SCOPE = "SUBTREE"
LDAP_SERVER_URI = "ldap://<ip-address>:<port>"
LDAP_USERNAME_ATTRIBUTE = "<User-id>"
LDAP_USE_STARTTLS = False
LOGIN_ATTEMPT_FIELDS = ['password']
LOGIN_BANNER = ""
LOG_FILE = ".......\AppData\Roaming\pgadmin\pgadmin4.log"
LOG_ROTATION_AGE = 1440
LOG_ROTATION_MAX_LOG_FILES = 90
LOG_ROTATION_SIZE = 10
MAIL_DEBUG = False
MAIL_PORT = 25
MAIL_SERVER = "localhost"
MAIL_USERNAME = ""
MAIL_USE_SSL = False
MAIL_USE_TLS = False
MASTER_PASSWORD_REQUIRED = True
MAX_LOGIN_ATTEMPTS = 3
MAX_QUERY_HIST_STORED = 20
MAX_SESSION_IDLE_TIME = 60
MFA_EMAIL_SUBJECT = None
MFA_ENABLED = False
MFA_FORCE_REGISTRATION = False
MFA_SUPPORTED_METHODS = ['email', 'authenticator']
MODULE_BLACKLIST = ['test']
NODE_BLACKLIST = []
OAUTH2_AUTO_CREATE_USER = True
OAUTH2_CONFIG = [{'OAUTH2_NAME': None, 'OAUTH2_DISPLAY_NAME': '<Oauth2 Display Name>', 'OAUTH2_CLIENT_ID': None, 'OAUTH2_CLIENT_SECRET': None, 'OAUTH2_TOKEN_URL': None, 'OAUTH2_AUTHORIZATION_URL': None, 'OAUTH2_API_BASE_URL': None, 'OAUTH2_USERINFO_ENDPOINT': None, 'OAUTH2_SCOPE': None, 'OAUTH2_ICON': None, 'OAUTH2_BUTTON_COLOR': None}]
ON_DEMAND_RECORD_COUNT = 1000
OVERRIDE_USER_INACTIVITY_TIMEOUT = True
PG_DEFAULT_DRIVER = "psycopg2"
PROXY_X_FOR_COUNT = 1
PROXY_X_HOST_COUNT = 0
PROXY_X_PORT_COUNT = 1
PROXY_X_PREFIX_COUNT = 0
PROXY_X_PROTO_COUNT = 1
SECURITY_EMAIL_SENDER = "no-reply(at)localhost"
SECURITY_EMAIL_SUBJECT_PASSWORD_CHANGE_NOTICE = "Your password for pgAdmin 4 has been changed"
SECURITY_EMAIL_SUBJECT_PASSWORD_NOTICE = "Your pgAdmin 4 password has been reset"
SECURITY_EMAIL_SUBJECT_PASSWORD_RESET = "Password reset instructions for pgAdmin 4"
SECURITY_EMAIL_VALIDATOR_ARGS = {'check_deliverability': False}
SEND_FILE_MAX_AGE_DEFAULT = 31556952
SERVER_MODE = False
SESSION_COOKIE_DOMAIN = None
SESSION_COOKIE_HTTPONLY = True
SESSION_COOKIE_NAME = "pga4_session"
SESSION_COOKIE_SAMESITE = "Lax"
SESSION_COOKIE_SECURE = False
SESSION_DB_PATH = "......\AppData\Roaming\pgadmin\sessions"
SESSION_EXPIRATION_TIME = 7
SESSION_SKIP_PATHS = ['/misc/ping']
SETTINGS_SCHEMA_VERSION = 33
SHOW_GRAVATAR_IMAGE = True
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLITE_PATH = ".......\AppData\Roaming\pgadmin\pgadmin4.db"
SQLITE_TIMEOUT = 500
STORAGE_DIR = "......\AppData\Roaming\pgadmin\storage"
STRICT_TRANSPORT_SECURITY = "max-age=31536000; includeSubDomains"
STRICT_TRANSPORT_SECURITY_ENABLED = False
SUPPORT_SSH_TUNNEL = True
TEST_SQLITE_PATH = "......\AppData\Roaming\pgadmin\test_pgadmin4.db"
THREADED_MODE = True
UPGRADE_CHECK_ENABLED = True
UPGRADE_CHECK_KEY = "pgadmin4"
UPGRADE_CHECK_URL = "https://www.pgadmin.org/versions.json"
USER_INACTIVITY_TIMEOUT = 0
WEBSERVER_AUTO_CREATE_USER = True
WEBSERVER_REMOTE_USER = "REMOTE_USER"
WEB_SERVER = "Python"
WTF_CSRF_HEADERS = ['X-pgA-CSRFToken']
X_CONTENT_TYPE_OPTIONS = "nosniff"
X_FRAME_OPTIONS = "SAMEORIGIN"
X_XSS_PROTECTION = "1; mode=block"
********************************************************************************

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows

--

[https://lh6.googleusercontent.com/WcEtG72XZbGPBjzFoT-IW51OH1-da3cwCza1hPem5JkmnMynMx8eDqT6SmW_cdVEiMfZ_Jdv6eIOyecDI6T80m2fCnrwM7zB_aMVD_qe83FiCYLmKZTo3rEJKsrMd8c3UlX9elWDkEy8O-63RA]<http://www.enterprisedb.com>

Akshay Joshi

Principal Software Architect

+91 9767888246

www.enterprisedb.com<http://www.enterprisedb.com>

[https://lh3.googleusercontent.com/hOgeCoGgRwHX8P0ijzFG1CRqVJOlTI9EM1PqH9irQC2HcnBSRTQGWZwRv9-NycVskPUmNrH73Lb9X4O1iFWIMbGVbTRwCaYp8XY6ITxi756FWu40z-wK3jFp8j8_leUh1zA-6_hAFe232lApBw]

In response to

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Akshay Joshi 2022-10-17 06:09:22 Re: SSH Tunnel Broken on version 6.14
Previous Message Matheus Alcantara 2022-10-13 11:17:30 Re: pgAdmin hangs while there is a long running process marked red