python-cx_Oracle icon indicating copy to clipboard operation
python-cx_Oracle copied to clipboard

DatabaseError: ORA-24912 When subscribed the query for notification.

Open thoo opened this issue 6 years ago • 6 comments

I got CQN working for a while and suddenly when I start subscribing from Docker images, I start getting errors and couldn't get CQN working again. I can do regular queries to my database but the notification is not working anymore.

  1. What versions are you using?
platform.platform: Linux-5.3.0-1034-azure-x86_64-with-debian-buster-sid
sys.maxsize > 2**32: True
platform.python_version: 3.7.6
cx_Oracle.version: 8.0.0
cx_Oracle.clientversion: (19, 6, 0, 0, 0)
  1. Describe the problem
subscr = con.subscribe(callback=CQNCallback,
        operations=cx_Oracle.OPCODE_INSERT | cx_Oracle.OPCODE_DELETE ,
        qos = cx_Oracle.SUBSCR_QOS_QUERY | cx_Oracle.SUBSCR_QOS_ROWIDS)
  1. Include a runnable Python script that shows the problem.
---------------------------------------------------------------------------
DatabaseError                             Traceback (most recent call last)
<ipython-input-5-5165f10999d9> in <module>
      1 subscr = con.subscribe(callback=CQNCallback,
      2         operations=cx_Oracle.OPCODE_INSERT | cx_Oracle.OPCODE_DELETE ,
----> 3         qos = cx_Oracle.SUBSCR_QOS_QUERY | cx_Oracle.SUBSCR_QOS_ROWIDS)
      4 

DatabaseError: ORA-24912: Listener thread failed. Failed to get IP address of host.

thoo avatar Jul 31 '20 02:07 thoo

@onmp may have a few thoughts, but your best bet is to ask on a Docker forum how to setup your networking and container configuration so that the DB server can reliably callback to the container running Python.

You may also find that clientInitiated=True client-initiated CQN works, or you may hit some of its "V1" quirks (which the CQN team is working to resolve).

cjbj avatar Jul 31 '20 03:07 cjbj

Definitely try client-initiated CQN. It is a simpler model than setting up Docker network configuration to allow communication on a dynamic port.

onmp avatar Aug 05 '20 22:08 onmp

I think clientInitiated only works in Database version 19.4. We are still in version 12 and now in the process of migrating to version 18.

thoo avatar Aug 06 '20 01:08 thoo

@thoo migrating to 18 is a very bad idea because 19 is the long-term release of that series. You should revisit your plans.

cjbj avatar Aug 06 '20 02:08 cjbj

@cjbj Thanks. I will talk to the infrastructure engineer.

thoo avatar Aug 06 '20 14:08 thoo

Closing - no activity.

cjbj avatar Nov 19 '20 06:11 cjbj