A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/oracle/python-oracledb/issues/178 below:

ORA-12162 when connecting to database since upgrade to 1.3.0 · Issue #178 · oracle/python-oracledb · GitHub

  1. What versions are you using?

python-oracledb 1.3.1
Oracle DB 19c
RHEL 7.9
Python 3.8

  1. Is it an error or a hang or a crash?
    error
  2. What error(s) or behavior you are seeing?
    We are using python-oracledb in thick-mode to connect to an Oracle database specified in a tnsnames.ora file (i.e. TNS_ADMIN is set to point to the tnsnames.ora file).
    We are also using a sqlnet.ora file that contains a reference to a wallet that contains the DB user and password.

We connect to the database in the following way:

>>> import oracledb;oracledb.init_oracle_client();oracledb.connect(dsn="TEST.WORLD")
<oracledb.Connection to externally identified user>

This is working in python-oracledb up to version 1.2.2.
Since version 1.3.0 (as well as 1.3.1) the same code now results in an error:

>>> import oracledb;oracledb.init_oracle_client();oracledb.connect(dsn="TEST.WORLD")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/PYTHON_LIBS_38/lib64/python3.8/site-packages/oracledb/connection.py", line 1008, in connect
    return conn_class(dsn=dsn, pool=pool, params=params, **kwargs)
  File "/PYTHON_LIBS_38/lib64/python3.8/site-packages/oracledb/connection.py", line 133, in __init__
    impl.connect(params_impl, pool_impl)
  File "src/oracledb/impl/thick/connection.pyx", line 387, in oracledb.thick_impl.ThickConnImpl.connect
  File "src/oracledb/impl/thick/utils.pyx", line 413, in oracledb.thick_impl._raise_from_odpi
  File "src/oracledb/impl/thick/utils.pyx", line 403, in oracledb.thick_impl._raise_from_info
oracledb.exceptions.DatabaseError: ORA-12162: TNS:net service name is incorrectly specified

The tnsnames.ora file:

TEST.WORLD =
  (DESCRIPTION =
    (CONNECT_TIMEOUT=10)(RETRY_COUNT=3)
    (ADDRESS_LIST =
      (ADDRESS=(PROTOCOL=TCP)(HOST= primary_url)(PORT=1721))
      (ADDRESS=(PROTOCOL=TCP)(HOST= secondary_url)(PORT=1721))
    )
    (CONNECT_DATA=(SERVICE_NAME=TEST_PRIM.WORLD)(SERVER=DEDICATED))
 )

I can still connect to the database in 1.3.1 with all parameters in the connect-statement:

>>> import oracledb;oracledb.init_oracle_client();oracledb.connect(host="primary_url", port=1721, service_name="TEST.WORLD", user="TEST", password="")

<oracledb.Connection to TEST@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=primary_url)(PORT=1721))(CONNECT_DATA=(SERVICE_NAME=TEST.WORLD)))>

Have there been any changes in release 1.3.0 that I overlooked or is there a bug in release 1.3.0?


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4