oracle / node-oracledb

Oracle Database driver for Node.js maintained by Oracle Corp.
http://oracle.github.io/node-oracledb/
Other
2.24k stars 1.07k forks source link

Running Oracledb on concourse CI/CD pipeline is showing error #1548

Closed Tash2610 closed 1 year ago

Tash2610 commented 1 year ago
  1. What versions are you using? 5.5.0
  2. Are you installing into vanilla Node.js, or using something like Electron? Using dockerfile to create an image of automation project and then run the image on the concourse CI/CD pipeline.

  3. Show the directory listing where your Oracle Client libraries are installed (e.g. the Instant Client directory). Is it 64-bit or 32-bit?

  4. Show what the PATH environment variable (on Windows) or LD_LIBRARY_PATH (on Linux) are set to?

  5. Show any Oracle environment variables set (e.g. ORACLE_HOME, ORACLE_BASE).

cjbj commented 1 year ago

[edit: until 6.0 arrives with Thin mode, you'll have to configure Instant Client!]

Read https://node-oracledb.readthedocs.io/en/latest/user_guide/initialization.html#setting-the-oracle-client-directory-on-linux-and-related-platforms

For Docker tips that relate to Thick mode and Instant Client, see Docker for Oracle Database Applications in Node.js and Python

Tash2610 commented 1 year ago

@cjbj is there a way to handle the oracledb library missing error through package.json or dockerfile?

cjbj commented 1 year ago

See the blog post series link I gave earlier which shows how to do it in the Dockerfile.

Tash2610 commented 1 year ago

@cjbj Thank you for sharing those insightful links. We already have a dockerfile in our playwright automation project, as added below, where we're already using the playwright image, and the steps which are mentioned in the Docker for Oracle Database Applications in Node.js and Python suggest to pull oracle client image first from Docker registry and then use that image in a dockerfile. As, we're already using Playwright image and can't use another image to create docker image, Can you suggest something to fix the CI/CD pipeline issue of missing OracleDB libraries through Dockerfile during pipeline execution on server? Dockerfile

FROM mcr.microsoft.com/playwright:v1.32.3-focal AS local
WORKDIR /app
COPY .npmrc .
COPY package.json .
RUN yarn install
COPY . .

FROM local AS ci
ARG ACCOUNT_ENV
ENV ACCOUNT_ENV=$ACCOUNT_ENV
cjbj commented 1 year ago

The blog post shows various ways to install and configure Instant Client. Check it out!

cjbj commented 1 year ago

Closing this since the solutions for client library installation and loading have been shared.

The just-released node-oracledb 6.0 doesn't necessarily need Instant Client libraries so there is also an easier solution now.