-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ORA-03115 on attempt to connect in Thin mode #476
Comments
Can you e-mail me the output you get when you run your script after setting the environment variable |
Hello Anthony, Same problem here. My code works well with oracledb 2.5.1 but not with 3.0.0. This is my example code: import os
import re
import ldap3
import oracledb
oid_server = os.environ.get("ORA_OIDSERVER")
dbname = os.environ.get("ORA_DBNAME")
dbuser = os.environ.get("ORA_DBUSER")
dbpass = os.environ.get("ORA_DBPASS")
# Get the Oracle Database connection string from an LDAP server when
# connection calls use an LDAP URL.
def ldap_hook(protocol, arg, params):
pattern = r"^(.+)\/(.+)\,(cn=OracleContext.*)$"
match = re.match(pattern, arg)
ldap_server, db, ora_context = match.groups()
server = ldap3.Server(ldap_server)
conn = ldap3.Connection(server)
conn.bind()
conn.search(ora_context, f"(cn={db})", attributes=['orclNetDescString'])
connect_string = conn.entries[0].orclNetDescString.value
params.parse_connect_string(connect_string)
oracledb.register_protocol("ldap", ldap_hook)
connection = oracledb.connect(user=dbuser, password=dbpass,
dsn=f"ldap://{oid_server}/{dbname},cn=OracleContext,dc=world")
with connection.cursor() as cursor:
for (r,) in cursor.execute("select version from v$instance"):
print(r)
print(connection.version)
connection.close() Output with oracledb 2.5.1: $ python misc/oracledb-test.py
19.0.0.0.0
19.24.0.0.0 Output with oracledb 3.0.0: $ python misc/oracledb-test.py
Traceback (most recent call last):
File "/home/myuser/projects/x/misc/oracledb-test.py", line 29, in <module>
connection = oracledb.connect(user=dbuser, password=dbpass,
dsn=f"ldap://{oid_server}/{dbname},cn=OracleContext,dc=world")
File "/home/myuser/.cache/pypoetry/virtualenvs/x-AFGDswDt-py3.13/lib/python3.13/site-packages/oracledb/connection.py", line 1257, in connect
return conn_class(dsn=dsn, pool=pool, params=params, **kwargs)
File "/home/myuser/.cache/pypoetry/virtualenvs/x-AFGDswDt-py3.13/lib/python3.13/site-packages/oracledb/connection.py", line 575, in __init__
impl.connect(params_impl)
~~~~~~~~~~~~^^^^^^^^^^^^^
File "src/oracledb/impl/thin/connection.pyx", line 439, in oracledb.thin_impl.ThinConnImpl.connect
File "src/oracledb/impl/thin/connection.pyx", line 435, in oracledb.thin_impl.ThinConnImpl.connect
File "src/oracledb/impl/thin/connection.pyx", line 395, in oracledb.thin_impl.ThinConnImpl._connect_with_params
File "src/oracledb/impl/thin/connection.pyx", line 376, in oracledb.thin_impl.ThinConnImpl._connect_with_description
File "src/oracledb/impl/thin/connection.pyx", line 345, in oracledb.thin_impl.ThinConnImpl._connect_with_address
File "src/oracledb/impl/thin/protocol.pyx", line 333, in oracledb.thin_impl.Protocol._connect_phase_two
File "src/oracledb/impl/thin/protocol.pyx", line 440, in oracledb.thin_impl.Protocol._process_message
File "src/oracledb/impl/thin/messages.pyx", line 103, in oracledb.thin_impl.Message._check_and_raise_exception
oracledb.exceptions.DatabaseError: ORA-03115: unsupported network datatype or representation
Help: https://docs.oracle.com/error-help/db/ora-03115/ I will e-mail you the output with PYO_DEBUG_PACKETS set. |
Thanks - yes please email trace output. Can you also share the actual DB version ? 19.0.0.0.0 is the release line. Can you print |
DB Version is 19.24.0.0.0. |
Thanks. Email received. Can you also send the packet output for a successful connection with 2.5.1? Comparing them might be instructive. Thanks! |
Of course. Mail has been sent. |
Thanks. Looking at that I see that the database is reporting as 19.24, not 19.26. Is that expected? Are you able to build binaries yourself? If so, I have some thoughts you could try to see if that is the source of the issues. |
Question: are you able to get access to the server traces? You can do that as follows:
Then from the base directory, you should see trace files in:
Hopefully the trace file reveals the source of the issue! |
The original bug reporter has version 19.26. I have 19.24. I don't have access to the database server, but I will ask my colleagues from the database team tomorrow. |
Thanks for clarifying.
The package for python-oracledb from source (after making some modifications). The documentation is here.
Thanks. |
I think I should be able to do that. Regarding the server traces, I've opened a ticket with my DB colleagues, but it might take a while to get a response. |
This reproduces against ADB-S with Transparent Application Continuity (and likely AC too). As ADMIN, enable TAC:
and then connection to the service will fail with ORA-3115. Luckily @anthony-tuininga has a patch which is being tested. |
I have pushed a patch that corrects this issue and have initated a build from which you can download pre-built development wheels once it completes. You can also build from source if you prefer. If you can test your scenario and confirm the patch works as expected, that would be appreciated! |
Hi there! We've recently hit this bug and just found this issue. In case it helps, testing the |
@crimoniv it does help. Thanks for sharing your feedback. |
I have tested your patch, and it works for us. Thanks again for your support! |
3.0.0
db version
19.26
python output
platform.platform: macOS-15.3.2-arm64-arm-64bit
sys.maxsize > 2**32: True
platform.python_version: 3.12.7
oracledb.version: 3.0.0
Is it an error or a hang or a crash?
error
What error(s) or behavior you are seeing?
oracledb.exceptions.DatabaseError: ORA-03115: unsupported network datatype or representation
no
oracledb.create_pool_async(
user="someuser",
host="somehost",
service_name="someservicename",
password="somepassword",
port=1521,
)
I made 0 code changes, just upgrading from 2.X -> 3.x broke it.
The text was updated successfully, but these errors were encountered: