Oracle: opt-in thick mode for servers that require Native Network Encryption (NJS-533 / ORA-12660)
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- node.js, typescript
Hướng nghiên cứu
Read the Oracle connector and startup flow to find where oracledb is imported and pools are created; the issue does not name those files. Check how CLI and environment options are defined, then follow the startup path to ensure thick mode initializes once before any pool. Done means the opt-in works with an optional client library directory, reports library load failures clearly, and leaves thin mode as the default; linked pull request #549 is already open.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
Oracle servers that require Native Network Encryption (NNE) and crypto-checksumming (SQLNET.ENCRYPTION_SERVER = REQUIRED / SQLNET.CRYPTO_CHECKSUM_SERVER = REQUIRED in the server's sqlnet.ora) cannot be used with DBHub. The Oracle connector always runs node-oracledb in thin mode, and thin mode does not implement NNE, so every query on the source fails:
NJS-533: Advanced Networking Option service negotiation failed. Native Network Encryption and DataIntegrity only supported in node-oracledb thick mode.
Cause: ORA-12660
NNE is a common way to encrypt Oracle traffic without TLS certificates or wallets. Other clients (SQLcl/JDBC, SQL*Plus, OCI-based tools) connect to the same server fine. Switching to TCPS (sslmode=require) needs a TLS listener and certificates on the server. Relaxing the server to REQUESTED would let unencrypted clients in. Both are DBA-side changes that are often not possible.
Environment
- DBHub 2.1.0 (also reproduced on 1.6.1), node-oracledb 7.0.1, Node.js 22, Linux x86_64
- Oracle Database 19c (19.23) Standard Edition 2, server requires AES256 encryption + SHA256 integrity
- Source configured in TOML with
type = "oracle",host,port,database(service name),sslmode = "disable"
Workaround
Install Oracle Instant Client and switch node-oracledb to thick mode before DBHub imports it, with a preload passed through NODE_OPTIONS="--require /path/to/oracle-thick.cjs":
// oracle-thick.cjs
const path = require("path");
try {
const dbhubDir = path.join(process.env.HOME, ".local/lib/node_modules/@bytebase/dbhub");
const oracledb = require(require.resolve("oracledb", { paths: [dbhubDir] }));
oracledb.initOracleClient(); // Instant Client found via ldconfig / LD_LIBRARY_PATH
} catch (err) {
process.stderr.write(`[oracle-thick] thick mode not enabled: ${err.message}\n`);
}
This works because oracledb has no exports map, so the CommonJS instance initialized by the preload is the same one DBHub's ESM import oracledb from "oracledb" gets. With it, queries succeed and v$session_connect_info shows the session using the AES256 encryption and SHA256 crypto-checksumming adapters. Read-only mode keeps working. It is fragile, though: it depends on the install path and on DBHub's module layout.
Proposal
Add an opt-in to run the Oracle connector in thick mode, e.g.:
- a CLI flag / env var such as
--oracle-thick/DBHUB_ORACLE_THICK=1, plus an optional--oracle-client-lib-dir/DBHUB_ORACLE_CLIENT_LIB_DIRpassed aslibDir; - when set, call
oracledb.initOracleClient({ libDir })once at startup, before any Oracle pool is created, and fail with a clear message if the Oracle Client libraries cannot be loaded (DPI-1047).
Since node-oracledb's mode is process-wide, a global setting seems a better fit than a per-source TOML option. I understand thin mode was chosen on purpose in #433 to keep the install free of native dependencies (npm, Docker image, MCPB bundle). This proposal keeps that: thin stays the default, and Instant Client is only loaded when someone explicitly opts in, so nothing changes for current users. Thick mode would also cover other server features that thin mode doesn't support, such as older server versions (#36).
Related: #36 (thin mode vs. older servers), #488 (wallet/mTLS in thin mode).
- Ngôn ngữ chính
- TypeScript
- Star
- 4k
- Fork
- 370
- Merge trung bình
- 6 giờ 28 phút
- Pull request đã merge (30 ngày)
- 41
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của bytebase/dbhub
-
execute_sql cannot create a SQLite trigger or a PostgreSQL BEGIN ATOMIC function: the statement is cut at the semicolons inside its bodyCó thể đã có người làm @goranai đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
SQLite: max_rows breaks LIMIT -1 OFFSET n with a syntax errorCó thể đã có người làm @goranai đã nhận 4 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
MySQL: query_timeout fallback KILL QUERY uses the handshake thread id, which is wrong behind a proxyCó thể đã có người làm @DongJinNam đã nhận 2 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
👉👉👉 Please share your use case to shape DBHub roadmapCó thể làm lại được @tianzhou đã nhận 367 ngày trước và không có pull request nào đang mở. Đang mở
bytebase/dbhub#146 · 27 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của bytebase/dbhub
Issue tương tự
-
Flaky test: selecting a portion just after inserting it can also match its Change and Delete buttonsĐang mởready-for-agent
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
linagora/dcs-onlyoffice#172 ·
-
bug follow-up
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
nightly-tests
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
BlackBeltTechnology/pi-agent-dashboard#1226 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
danielmiessler/LifeOS#3028 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100