Connect() hangs with SSH tunnels and 11g database
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
Inizia con la riproduzione Python fornita usando SSHTunnelForwarder, oracledb.connect() e Oracle 11g, quindi confrontala con i casi funzionanti con 19c e con un tunnel esterno. Verifica le combinazioni indicate di client, Python, SID e credenziali. Il lavoro è completato quando la causa del blocco è stata identificata e risolta, preservando le connessioni riuscite e gli errori previsti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
-
What versions are you using?
Python 3.13.3 (also tried with 3.11)
Oracledb 3.1.1 (also tried 3.0.0 and 2.5.1)
Oracle database 11g
Oracle instant client 18.5 (also tried with 12.2)platform.platform: Windows-11-10.0.26100-SP0
sys.maxsize > 2**32: True
platform.python_version: 3.13.3
oracledb.version: 3.1.1 -
Is it an error or a hang or a crash? Hang
-
What error(s) or behavior you are seeing?
While trying to connect to 11g databases through SSHtunnels, oracledb.connect() hangs and doesn't return anything.
I tried it on multiple tunnels/databases combinaisons, while mixing oracledb / instantclient / python versions.If I open the tunnel through putty, oracledb.connect works.
If I open the tunnel through another script, oracledb.connect works. (!)
If I try to open a tunnel and connect to a 19c database, it works
If I do the same thing using python 3.9 and cx_oracle, it works.If I provide a wrong username or password, I get an (expected) error.
If I provide a wrong SID, I get an (expected) error.I do see an inactive connection in my v$session linked to my script.
I tried everything I could think of and do not understand what I'm missing.
-
Does your application call init_oracle_client()? Yes, I tried with instant client versions 11.2, 12.1, 18.5
I had success accessing a 19c db using instant client 21.18 through the same tunnel (and same script) -
Include a runnable Python script that shows the problem.
from sshtunnel import SSHTunnelForwarder
import oracledb
# ssh config
ssh_host = "###_tunnel.com"
ssh_port = 21
ssh_username = "ssh_user"
ssh_password = "ssh_psw"
# db config
oracle_host = "ip.of.my.db"
oracle_port = 1521
oracle_sid = "DB_SID"
oracle_user = "DB_USER"
oracle_password = "DB_PSW"
#oracle_client_path = r"C:\instant_client18c\instantclient-basic-windows.x64-18.5.0.0.0dbru\instantclient_18_5"
oracle_client_path = r"C:\instant_client11g\instantclient-basic-windows.x64-11.2.0.4.0\instantclient_11_2"
oracledb.init_oracle_client(lib_dir=oracle_client_path)
print("Thin mode enabled?", oracledb.is_thin_mode())
try:
with SSHTunnelForwarder(
(ssh_host, ssh_port),
ssh_username=ssh_username,
ssh_password=ssh_password,
remote_bind_address=(oracle_host, oracle_port),
) as tunnel:
print(f"binding on {tunnel.local_bind_host}:{tunnel.local_bind_port}")
print(oracledb.clientversion())
param = oracledb.ConnectParams(
user=oracle_user,
password=oracle_password,
host="localhost",
port=tunnel.local_bind_port,
sid=oracle_sid,
)
with oracledb.connect(params=param) as connection:
print("connected to Oracle 11.2!") # this never prints for tunnel + 11g
with connection.cursor() as cursor:
cursor.execute("SELECT 'query success' AS TEST FROM dual")
result = cursor.fetchone()
print(result[0])
except Exception as e:
print(f"Error : {e}")
- Lingua principale
- Python
- Stelle
- 451
- Fork
- 118
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di oracle/python-oracledb
-
fetch_df_batches() segfaults with fetch_decimals=True and repeated NUMBER values across batches Apertabug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
oracle/python-oracledb#608 · 1 commento ·
-
bug
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
oracle/python-oracledb#607 · 1 commento ·
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
oracle/python-oracledb#592 · 6 commenti · 1 reazione ·
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
oracle/python-oracledb#564 ·
-
bug Client Library or Database
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
oracle/python-oracledb#422 · 1 commento ·
Tutte le issue di oracle/python-oracledb
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
xinnan-tech/xiaozhi-fde-talk#263 ·
-
rules
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
huggingface/Repo2RLEnv#163 · 1 commento ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
huggingface/sentence-transformers#4074 ·
-
comp/dashboard invalid P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
NousResearch/hermes-agent#121143 ·