python-oracledb瘦客户机返回DPY-6000

bmp9r5qi  于 2023-01-04  发布在  Python
关注(0)|答案(1)|浏览(177)

我正在OCI Ampere节点上运行Docker容器中打包的Python应用程序。
环境:

  • 基本映像:python:3.10.9-slim使用buildxarm64构建
  • 客户端库:oracledb==1.2.1
  • Docker版本:20.10.22, build 3a2c30b
  • Docker主机操作系统:5.4.17-2136.311.6.1.el8uek.aarch64

但当应用尝试使用瘦客户端连接到自治事务处理DB时,它返回以下错误:

File "/app/utils/db_connection_managers/oracle_connection_manager.py", line 13, in __init__
    self.db_conn = oracledb.connect(
  File "/usr/local/lib/python3.10/site-packages/oracledb/connection.py", line 1013, in connect
    return conn_class(dsn=dsn, pool=pool, params=params, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/oracledb/connection.py", line 135, in __init__
    impl.connect(params_impl)
  File "src/oracledb/impl/thin/connection.pyx", line 318, in oracledb.thin_impl.ThinConnImpl.connect
  File "src/oracledb/impl/thin/connection.pyx", line 206, in oracledb.thin_impl.ThinConnImpl._connect_with_params
  File "src/oracledb/impl/thin/connection.pyx", line 177, in oracledb.thin_impl.ThinConnImpl._connect_with_description
  File "src/oracledb/impl/thin/connection.pyx", line 105, in oracledb.thin_impl.ThinConnImpl._connect_with_address
  File "src/oracledb/impl/thin/connection.pyx", line 101, in oracledb.thin_impl.ThinConnImpl._connect_with_address
  File "src/oracledb/impl/thin/protocol.pyx", line 168, in oracledb.thin_impl.Protocol._connect_phase_one
  File "src/oracledb/impl/thin/protocol.pyx", line 344, in oracledb.thin_impl.Protocol._process_message
  File "src/oracledb/impl/thin/protocol.pyx", line 323, in oracledb.thin_impl.Protocol._process_message
  File "src/oracledb/impl/thin/messages.pyx", line 1676, in oracledb.thin_impl.ConnectMessage.process
  File "/usr/local/lib/python3.10/site-packages/oracledb/errors.py", line 111, in _raise_err
    raise exc_type(_Error(message)) from cause
oracledb.exceptions.OperationalError: DPY-6000: cannot connect to database. Listener refused connection. (Similar to ORA-12506)

这暗示客户端能够连接到数据库(即,不存在连接/联网问题),但是连接请求被服务器主动拒绝。

    • 我在Mac(Intel)上使用相同的dockerfile(显然是为amd64构建的)和相同的连接细节运行相同的容器,没有任何问题。**

文档中有关于此行为的提示,但我不确定它如何/为什么会适用于我的情况。具体来说,它如何不会在我的Intel Mac上运行的container中导致问题,但当arm64 container在A1节点上运行时,它是一个因素。
我是不是忽略了一些东西,或者试图做一些规范不支持的事情?

vm0i2vca

vm0i2vca1#

Yasin B正确的指出了问题的原因,是ATP示例上ACL的现有配置没有包含A1节点的公有IP地址,调整ACL后问题得到解决。

相关问题