IMD SolutionComputing LibraryShop main store

Troubleshooting

Node-RED Oracle Instant Client fails on a snap-confined edge PC

Edge computing and IIoT Published 6 min read

Short answer

Snap confinement keeps a Node-RED app from loading an Oracle Instant Client unpacked into its own data folder, so the driver fails before any SQL runs. Find the failing stage, switch to a palette that connects without the client libraries, deliver it offline through the device's node-packager, and prove the write path with a counted test.

On this page
  1. Find the failing stage before touching SQL
  2. Why the Instant Client cannot load from the app folder
  3. Choose a palette that connects without the client libraries
  4. Package the palette offline with the device's node-packager
  5. Example: a 60 second write test at one row per second
  6. Restart rerun and the production gate
  7. Decisions for each case
  8. Questions asked

When a Node-RED app runs as a snap on an industrial edge device, unpacking Oracle Instant Client into the app's own data folder does not make it loadable. Snap confinement gives the running app a private filesystem view and its own library search path, so the Oracle driver fails before any SQL runs, no matter where the files sit. The fix is structural, not another install location: find the failing stage, move to a palette that connects without the client libraries, and deliver it through the device's offline node-packager route.

Find the failing stage before touching SQL #

Do not start by rewriting queries. A missing palette, an unloaded client library, a refused connection and rejected SQL fail at different stages and need different fixes. Work down this list and keep the full error text at every step, because a generic "connection failed" line cannot tell a library-load failure from a refused login.

  • The palette is absent, or its install ends in a permission error. That is snap confinement, not Oracle: no credential or SQL change fixes it. Go to the offline packaging route below.
  • The palette installs, but first use raises a loader or initialization error naming a missing shared object. The Instant Client dependency is failing. Go to palette choice.
  • The connection is refused or times out. That is the network stage, and Fix ECONNREFUSED when Node-RED connects to a remote SQL database walks that path end to end.
  • The query executes and the database rejects it. That is SQL or schema; take the statement and the exact Oracle error to the database owner.

Why the Instant Client cannot load from the app folder #

node-oracledb, the driver under most Node-RED Oracle palettes, documents that the Oracle client libraries handle the database communication and are not bundled with the driver, so they must be present on the device before a connection opens. In the reported trial on a ctrlX OS device, palettes with that dependency either would not install under snap permissions or could not use an Instant Client unpacked into the app's data folder (AppData).

That result is the expected one. Files that merely exist in the app's data area are not loadable: strict confinement denies reads outside the app's permitted locations, and the dynamic loader's search path comes from the snap's environment, not from wherever you unpacked the archive. The client's own Linux dependencies, such as the asynchronous I/O library, must be visible in the same world the app sees. Check loadability with the palette's own diagnostics, never with a file manager.

Do not widen the snap's permissions to make the libraries visible. That is a security regression, not a fix.

Choose a palette that connects without the client libraries #

The cleanest branch is a palette that opens Oracle connections with no client libraries at all; the FAQ below explains the driver mode that makes that possible. A palette that initializes the Oracle client will need those libraries on every device, which is exactly the dependency confinement blocks.

The reported trial ended with one palette, @hylink/node-red-oracle, installing and connecting out of the box, while the palettes that needed client libraries failed under confinement. Treat that as a candidate for a controlled trial, not a proven result: it reflects one device, one palette version and one runtime state, and its stability was explicitly untested.

What you saw Likely area Next action
Install denied with a permission error Snap installation permissions Use the node-packager route below
Installs, then a missing-library error at first use Instant Client dependency Prefer a palette that connects without the client
Installs and connects Candidate integration Run the counted write test and the restart rerun before production

Package the palette offline with the device's node-packager #

On a ctrlX OS device, the Node-RED app's node-packager creates offline-installable palettes, which is the supported way to add nodes to a confined runtime. Pin the exact palette version so a later rebuild reproduces the same set; Stable Node-RED gateway flows with vendor-pinned nodes shows what unpinned node sets break.

  1. Identify the exact palette and version and every declared dependency, including whether it needs client libraries.
  2. Build the offline package with the node-packager workflow and install it on a test device.
  3. Deploy a minimal flow and confirm the node loads. A successful package install is only the first gate: the dependency must resolve at runtime, and again after restart.
  4. If loading still fails, keep the package manifest, the permission error and the runtime log, and take them to the platform vendor. Do not copy libraries into undocumented paths.

On a general-purpose industrial Linux PC the alternative is to run Node-RED outside snap packaging entirely; start by identifying the Linux base as described in Identify the Linux base before installing Node-RED natively. On a fixed-function edge device, stay on the vendor's app route, because the snap is part of the device's supported state.

Example: a 60 second write test at one row per second #

Inputs:

  • Test table ctrlx_data as in the reported trial: id NUMBER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, value NUMBER (*, 2), timestamp TIMESTAMP.
  • Write rate: one row per second, a controlled trial rate chosen so the result is countable by eye, not a performance claim.
  • Window: 60 seconds of wall-clock time.

The rule is counting: expected rows equal the write rate times the window, and the identity key must advance by exactly one per accepted write. Two statements do the whole test, the insert with placeholders for the submitted value and timestamp, then the check:

INSERT INTO ctrlx_data (value, timestamp) VALUES (:val, :ts);
SELECT COUNT(*) AS total_rows, COUNT(DISTINCT timestamp) AS distinct_times FROM ctrlx_data;

The arithmetic: 1 row/s × 60 s = 60 rows expected.

The decision: if the count returns the expected 60 rows with 60 distinct timestamps, every message produced exactly one row and the write path is single-shot, so move to the restart rerun. If the total sits above the expected count while distinct timestamps still match the window, a retry or a repeated inject is double-writing; fix the flow before any production loop. Have the database owner confirm the table's column naming and the NUMBER (*, 2) precision before this schema leaves the lab.

Restart rerun and the production gate #

Restart the app by the device's normal update or restart method and rerun the same window; require the same row count as the first run, which catches dependencies that only resolve from a transient location. Watch the app log across both runs for permission or library-load messages, and read the database side for duplicate writes.

Keep the flow out of production until the database owner has approved the account's privileges, the write rate and retention. If any gate fails, the artifacts from the packaging step are the escalation package, not a permission change on the device.

Decisions for each case #

  • Install denied under snap permissions: package the palette offline with the node-packager and install on a test device. Do not fight the permission.
  • Palette needs the Instant Client and confinement blocks it: stop that branch the same day. Move to a palette that connects without client libraries or to a supported packaging design; never loosen confinement.
  • Palette installs and connects, like the reported @hylink/node-red-oracle result: candidate only. Pass the counted write test, the restart rerun and database-owner sign-off before production.
  • Refused connection or timeout: not this article's failure. Work the network stage with the ECONNREFUSED guide linked above.

Questions asked

Does node-oracledb still need the Oracle Instant Client?

Not always. Current node-oracledb releases include a thin mode that speaks the Oracle wire protocol in pure JavaScript and loads no client libraries. A Node-RED palette benefits from it only if it starts the driver in that mode; a palette that initializes the Oracle client needs the Basic or Basic Light package on every device regardless. Check the palette's documentation for the mode it uses before planning any client install.

Which Instant Client package does the driver need?

Every Instant Client installation starts from a Basic or Basic Light package, matched to the edge PC's CPU architecture and to the database release you connect to. Basic Light is the smaller package and carries only a reduced set of error messages and character sets, so confirm your database's character set is covered before choosing it. The driver documentation lists supported pairings.

How do I tell a library-load failure from a network failure in the log?

A library-load failure appears at deploy time or on first use, names the missing shared object or reports that the client library cannot be initialized, and no socket is ever opened. A network failure names the host and port and reports a refused or timed-out connection. Sort the log by the first appearance of the message to see which stage actually failed.

Can I just grant the snap more permissions to see the Instant Client?

Do not. Widening a confined runtime's file or library access moves the device outside its supported security state, and it usually still fails, because the loader search path is fixed by the packaging rather than by where the files sit. Stay on the offline packaging route, and if no supported combination loads the libraries, send the package manifest, the permission error and the runtime log to the platform vendor.

Keep reading

  • How-to

    Configuring MQTT TLS certificates in Node-RED on an edge PC

    Configure the MQTT node's own TLS inputs: the broker's CA chain always, the client certificate and private key when the broker requires mutual TLS. A platform certificate store is invisible to Node-RED until the installed integration exposes it, so use persistent files unless store support is verified, and renew in a staged 30-day window.

    Edge computing and IIoT

  • Troubleshooting

    Fix Node-RED Docker x509 Certificate Expired on an Edge PC

    The error x509: certificate has expired or is not yet valid means Docker reached the registry over TLS but the controller clock falls outside the certificate's validity dates. Set the correct date and an NTP server, confirm the controller shows the right UTC time, and re-run the same docker run command — the pull verifies on the next connection. Change nothing else first.

    Edge computing and IIoT

  • How-to

    Route MQTT sensor data into Grafana on an edge PC

    An MQTT broker forwards each message once and keeps no history, so Grafana cannot trend from it directly. Subscribe with Node-RED, write each payload into InfluxDB, set a 365-day retention policy, and point a Grafana data source at that database. For the example below — 720 signals sampling every 5 s — that is about 0.9 TB for a year; provision roughly 2 TB.

    Edge computing and IIoT