oracle / python-oracledb

Python driver for Oracle Database conforming to the Python DB API 2.0 specification. This is the renamed, new major release of cx_Oracle
https://oracle.github.io/python-oracledb
Other
328 stars 66 forks source link

1.3.0 can't connect in thin mode: DPY-5000: internal error: unknown protocol message type 10 #171

Closed AZSlow3 closed 1 year ago

AZSlow3 commented 1 year ago
  1. What versions are you using? Oracle: 19.3.0-ee (in docker, note the bug does not appear with another image based on 18.4.0-xe) platform.platform: Linux-5.15.0-67-generic-x86_64-with-glibc2.35 sys.maxsize > 2**32: True platform.python_version: 3.9.13 oracledb.version: 1.3.0

  2. Is it an error or a hang or a crash? Error.

  3. What error(s) or behavior you are seeing? oracledb.exceptions.InternalError: DPY-5000: internal error: unknown protocol message type 10

  4. Does your application call init_oracle_client()? No

  5. Include a runnable Python script that shows the problem. import oracledb import os

un = os.environ.get('USER_NAME') pw = os.environ.get('PASSWORD') cs = os.environ.get('CONNECT_STRING') oracledb.connect(user=un, password=pw, dsn=cs, disable_oob=True)


Traceback (most recent call last): File "/mnt/vm/BK/tests/oracle_connect.py", line 8, in oracledb.connect(user=un, password=pw, dsn=cs, disable_oob=True) File "/mnt/vm/BK/diracos/lib/python3.9/site-packages/oracledb/connection.py", line 1008, in connect return conn_class(dsn=dsn, pool=pool, params=params, **kwargs) File "/mnt/vm/BK/diracos/lib/python3.9/site-packages/oracledb/connection.py", line 130, in init impl.connect(params_impl) File "src/oracledb/impl/thin/connection.pyx", line 314, in oracledb.thin_impl.ThinConnImpl.connect File "src/oracledb/impl/thin/connection.pyx", line 202, in oracledb.thin_impl.ThinConnImpl._connect_with_params File "src/oracledb/impl/thin/connection.pyx", line 173, in oracledb.thin_impl.ThinConnImpl._connect_with_description File "src/oracledb/impl/thin/connection.pyx", line 114, in oracledb.thin_impl.ThinConnImpl._connect_with_address File "src/oracledb/impl/thin/protocol.pyx", line 229, in oracledb.thin_impl.Protocol._connect_phase_two File "src/oracledb/impl/thin/protocol.pyx", line 343, in oracledb.thin_impl.Protocol._process_message File "src/oracledb/impl/thin/protocol.pyx", line 322, in oracledb.thin_impl.Protocol._process_message File "src/oracledb/impl/thin/messages.pyx", line 292, in oracledb.thin_impl.Message.process File "src/oracledb/impl/thin/messages.pyx", line 179, in oracledb.thin_impl.Message._process_message File "/mnt/vm/BK/diracos/lib/python3.9/site-packages/oracledb/errors.py", line 118, in _raise_err raise exc_type(_Error(message)) from cause oracledb.exceptions.InternalError: DPY-5000: internal error: unknown protocol message type 10

Wireshark recognize the last TNS message, 1.2.x get the same packet and is also happy (PYO_DEBUG_PACKETS=1 output is attached, one from 1.2.0 another from 1.3.0)

trace_failed.txt trace_ok.txt

cjbj commented 1 year ago

Has your password expired?

AZSlow3 commented 1 year ago

Not yet ;) Precise commit with which the problem appears: 2c879f8 https://github.com/oracle/python-oracledb/commit/2c879f8d455cb23b20ef96d13bcc787ce46430d5

AZSlow3 commented 1 year ago

Now I understand why you ask... Oracle returns sized string as the warning (if I understand that correctly). Can you give me a hint how to revert the behavior, if that is possible with some flag? I mean till there is a fix and it is released I should find some workaround or just trick with 1.2.x for a while. We will for sure update the password, but I guess the problem can re-appear with any warning.

anthony-tuininga commented 1 year ago

I have pushed a patch that should correct this issue. If you are able to build from source you can verify that it corrects your issue as well.

chrisburr commented 1 year ago

I've tested with main and it now works.

Thank a lot for the prompt fix! 🍰

AZSlow3 commented 1 year ago

Yes, fine in my local setup as well. Thanks.

anthony-tuininga commented 1 year ago

This has been included in version 1.3.1 which was just released!