Troubleshooting
Node-RED Data Layer subscription crash on ctrlX CORE
Short answer
Deploying a 60th Data Layer Subscribe node in Node-RED on ctrlX CORE v1.12 can crash and reboot the controller, discarding the unsaved flow edit. Stabilize production without a shutdown by moving excess tags to a Data Layer Request node polled on a 500 ms Inject interval with rising-edge detection. For a permanent fix, schedule a shutdown to upgrade system apps, the Node-RED app, and matching engineering tools together to v1.20 or later.

On this page
On a ctrlX CORE running v1.12 system apps, deploying a 60th ctrlx-datalayer-subscribe node in Node-RED can crash and reboot the controller, discarding the unsaved flow edit on restart. Do not keep retrying deploys on a live machine. To stabilize production without a shutdown, move the new tag—and enough low-priority status tags to regain headroom below the working ceiling—onto a Data Layer Request node polled on a 500 ms Inject interval with rising-edge detection for Boolean events. For the permanent fix, schedule a planned shutdown to upgrade ctrlX CORE system apps, the Node-RED app, and matching engineering tools together to v1.20 or later.
Confirm the subscription crash and audit the flow #
Before restructuring a production flow, verify that the crash tracks active subscription count rather than a malformed tag path. On legacy v1.12 controllers where 59 subscriptions operate reliably, deploying one additional ctrlx-datalayer-subscribe node forces a controller reboot, yet removing an existing subscription and adding the new address deploys cleanly.
Run these checks before editing further:
- Verify the swap behavior: Confirm off-shift that deleting one existing Subscribe node allows the new address to deploy. That isolates the fault to total active subscriptions rather than a bad Data Layer path.
- Audit installed versions: Record the AutomationCore System App build alongside the Node-RED app and
node-red-contrib-ctrlx-automationpackage version. Per the Node-RED Flow Library documentation for node-red-contrib-ctrlx-automation, AutomationCore System App version1.20.0(XCR-V-0120/ Milestone23.03) or newer is recommended for full subscription-property support and to prevent[404] Not Founderrors. - Count
ctrlx-config-subscriptionnodes: Check the Configuration Nodes sidebar in Node-RED. According to thenode-red-contrib-ctrlx-automationreference manual, subscribed items sharing onectrlx-config-subscriptionnode run on a single server-side subscription thread; duplicate configuration nodes multiply server threads even at the same tag count. - Inspect server-side bounds and CPU load: Read
datalayer/subscriptions/settings(backed by FlatBuffers schemassub_settings.fbsandsub_properties.fbs, viewable underSettings -> Data Layer) to check active controller limits on sampling, publishing, and queue buffers. Monitor CPU load onframework/metrics/system/cpu-utilisation-percent, as shown in thenode-red-contrib-ctrlx-automationexamples guide. - Check logbook persistence: Enable a persistent logbook and capture a system report after a crash where supported. Older v1.12 builds may lack the persistent logbook option in the UI, so export the flow JSON before testing changes.
The 59-to-60 failure point on v1.12 is an observed operational crash threshold, not a vendor-published hard cap. Each ctrlx-datalayer-subscribe node runs over Server-Sent Events (SSE) rather than polling, adding server-side sampling, queue buffering (samplingInterval and publishInterval default to 1 s, and queueSize defaults to 10), and JSON stream parsing alongside other flow nodes such as SQL and HTTP clients. On a memory-constrained ARM controller such as a ctrlX CORE X3 with 2 GB RAM, stacking dozens of subscriptions on v1.12 system apps—paired with older package builds that lacked fixes for partially received JSON event streams—can crash the controller on deploy.
Stabilize production with Data Layer Request polling #
When production cannot stop for an upgrade, replace slow or newly added Subscribe nodes with polled Data Layer Request reads to stay safely below the crash ceiling.
- Export the working flow JSON: Save a backup from the Node-RED menu first, since a crash-reboot discards unsaved edits.
- Move non-critical tags to Data Layer Request (
read): Replace excess Subscribe nodes with a Data Layer Request node configured to read each address. When related signals live under one branch, consolidate calls by reading a Data Layer node and its subnodes in Node-RED instead of issuing one request per tag. - Drive reads from a repeating Inject node: Use a 500 ms interval for operator status bits and handshakes, or a slower period (2 s to 5 s) for temperatures and counters.
- Detect rising edges on Boolean triggers: Polled reads emit the current value every cycle rather than only on change, so add edge detection before SQL writes, HTTP requests, or counters.
- Keep overflow protection enabled: In the
node-red-contrib-ctrlx-automationreference manual, Data Layer Request defaults topendingWarnLevelat 50 pending requests (logging"Number of requests very high. There are already responses pending.") andpendingErrorLevelat 100 pending requests (dropping further incoming requests and raising an error for a Node-REDcatchnode). Wire acatchnode to log drops rather than disabling the guard with0or an empty field.
Rising-edge detection for polled Boolean signals #
Place a Function node directly after the Data Layer Request node so steady true reads emit only on the false-to-true transition. Below, msg.payload, context.get, and context.set are documented Node-RED APIs; currentState, previousState, and lastEdgeState are illustrative local Boolean variables initialized to false:
// Illustrative local Boolean variables; initial stored state is false
const currentState = Boolean(msg.payload);
const previousState = Boolean(context.get("lastEdgeState") ?? false);
context.set("lastEdgeState", currentState);
if (currentState && !previousState) {
msg.payload = true;
return msg;
}
return null;
Prove the behavior with a Debug node before connecting downstream outputs by injecting five values in order (false, true, true, false, true): only the first and final true values should pass through, while the repeated true and both false inputs return nothing. Remember the basic polling constraint: any PLC pulse shorter than one poll cycle can rise and fall between scans unseen. Hold polled trigger bits high for at least 1 s, or latch them in the PLC until Node-RED writes a handshake reset.
Dynamic subscriptions as a second workaround #
Starting in node-red-contrib-ctrlx-automation v1.9.x, the ctrlx-datalayer-subscribe node supports runtime dynamic subscribe and unsubscribe commands, documented in the package's examples guide and release notes. For intermittent diagnostic screens or recipe-specific tags, dynamic subscription lets one flow switch monitored addresses on demand instead of holding dozens of static subscriptions open continuously. Confirm matching system app support first, because running dynamic subscription features against outdated system apps can return [404] Not Found errors.
Worked example: sizing a polled tag group against request limits #
Always verify poll burst drain time against the documented pending-request limits (pendingWarnLevel of 50 and pendingErrorLevel of 100) before loading many tags onto one Inject node. Take an illustrative example where you move 14 slow subscriptions plus 1 new tag (15 polled tags total, leaving 45 active subscriptions below the working ceiling) onto a single Data Layer Request node triggered every 0.5 s:
- Incoming request rate:
15 requests / 0.5 s = 30 requests/s. - Healthy controller (illustrative 25 ms serialized response per request): One poll burst drains in
15 requests * 25 ms/request = 375 ms, leaving500 ms - 375 ms = 125 msof margin before the next tick. Peak pending count stays at 15, safely below the warning threshold. - Loaded controller (illustrative 50 ms serialized response per request): Service capacity falls to
1 request / 0.05 s = 20 requests/s, creating a net backlog growth of30 requests/s - 20 requests/s = 10 requests/s. - Time to warning and drop thresholds: At
10 requests/snet growth, pending requests reach the warning threshold in50 requests / 10 requests/s = 5 sand the drop threshold in100 requests / 10 requests/s = 10 s, throwing a catchable error and discarding further requests.
The engineering decision follows directly from those numbers. If measured burst drain time approaches the poll period or logs pending-request warnings, never set pendingErrorLevel to 0. Instead, lengthen the Inject interval—1 s lowers the 15-tag rate to 15 requests/s and 2 s lowers it to 7.5 requests/s, both below the illustrative 20 requests/s loaded capacity—stagger reads across offset timers, or collapse scalar reads into one parent-branch request.
Plan the coordinated upgrade from v1.12 to v1.20 or later #
Polled reads buy time in production, but the permanent fix is upgrading the ctrlX CORE system apps and the Node-RED app together to v1.20 or later during a scheduled maintenance shutdown. Moving to AutomationCore System App 1.20.0 (XCR-V-0120) or newer with a matching node-red-contrib-ctrlx-automation package resolves the v1.12 subscription incompatibilities and brings package fixes for partial JSON event streams, read timeouts, pending-request limits, and automatic reconnection after reboots.
Total upgrade downtime is not a fixed constant—it varies with installed apps, drive firmware alignment, and scheduler checks—so time the full procedure on a bench or spare controller before setting a production outage window. Address each dependency below:
- Take complete backups first: Archive the ctrlX CORE configuration and apps, back up the PLC project, and export the Node-RED flow JSON plus external database or HTTP credentials off-controller.
- Upgrade system apps and Node-RED together: Do not mix v1.12 system apps with a newer Node-RED app or vice versa; keep the Node-RED app matched to the v1.20+ system app release.
- Upgrade
ctrlX WORKSand the PLC project: Opening or modifying the PLC project after upgrading the controller requiresctrlX WORKSv1.20 (or matching target release), and the PLC project should be updated to the corresponding version. - Match
ctrlX DRIVEruntime on drive-integrated controllers: Confirm that the target ctrlX CORE system app version matches a compatiblectrlX DRIVEruntime version in the vendor release documentation before flashing. - Plan for scheduler resets: Carrying a v1.12 configuration forward to v1.20 can require resetting scheduler settings—for example, to resolve a Motion app stalling between Configuration and Running states on boot.
- Verify full subscription load before handing back production: Re-enable all required Subscribe nodes, confirm clean deploys without
[404] Not Founderrors, and checkframework/metrics/system/cpu-utilisation-percentunder cycle load.
Decide when to keep Node-RED on the controller or offload it #
Subscription crashes also highlight a deployment boundary decision when running PLC logic and Node-RED on one ctrlX CORE: decide whether the IIoT flow belongs inside the PLC controller at all.
| Deployment case | Recommended path | Operational trade-off |
|---|---|---|
| Live v1.12 controller cannot shut down yet | Move excess or slow tags to Data Layer Request polling with rising-edge detection | Keeps production running immediately; requires latched or long pulses |
| Moderate flow with a planned shutdown | Upgrade ctrlX CORE system apps, Node-RED, and ctrlX WORKS together to v1.20+ |
Keeps a single-controller footprint; Node-RED still shares PLC RAM and reboot domain |
Lossless or high-rate real-time sampling (samplingInterval set to 0) |
Shift real-time capture out of Node-RED to the ctrlX Telegraf app | Built for deterministic real-time subscriptions without Node.js parsing overhead |
| Heavy IIoT workload (SQL writes, HTTP APIs, dashboards, or strict PLC isolation) | Run node-red-contrib-ctrlx-automation remotely over HTTPS (port 443) on a cabinet edge host |
Isolates Node-RED crashes and heap growth from the PLC; adds an external host and network link |
For deterministic, lossless real-time data capture rather than event-driven status integration, move acquisition to sampling real-time data with the ctrlX Telegraf app instead of pushing high-frequency streams through Node-RED.
When flows combine dozens of Data Layer tags with SQL databases, HTTP clients, and dashboards—and a Node-RED fault must never reboot the machine controller—move Node-RED off the PLC onto an industrial mini PC in the cabinet. The node-red-contrib-ctrlx-automation package connects remotely over HTTPS on port 443 with Bearer-token authentication (POST /identity-manager/api/v2/auth/token), separating flow deploys and Node.js memory management from the real-time core.
On a standalone embedded Linux edge host running Node-RED as a systemd service, constrain the Node.js V8 heap with node-red-pi --max-old-space-size=256 or Environment="NODE_OPTIONS=--max_old_space_size=256" in /lib/systemd/system/nodered.service, per the Node-RED Raspberry Pi startup documentation, and configure automatic service recovery as outlined in recovering Node-RED from memory-growth crashes with systemd. On a ctrlX CORE itself, Node-RED runs inside the controller's managed app environment rather than a user-edited systemd unit, so on-controller memory control relies on consolidating ctrlx-config-subscription nodes, trimming unused subscriptions, and keeping queueSize conservative.
Questions asked
How do queueBehaviour and deadBandValue reduce Data Layer subscription load?
Setting a positive deadBandValue filters out analog noise by publishing updates only when the absolute difference between the last captured value and the new value exceeds that threshold. Pairing a deadband with Discard Oldest queue behavior keeps the newest process state during brief bursts, whereas Discard Newest preserves early transition history for fault sequences. Together, these parameters lower event traffic across the subscription stream without removing monitored items.
Can an external client subscribe to multiple Data Layer nodes without Node-RED?
Yes. The ctrlX AUTOMATION SDK provides native multi-node Data Layer client subscriptions in C++, Python, .NET, and Node.js alongside a REST Server-Sent Events endpoint at automation/api/v2/events accepting comma-separated node paths and a publishIntervalMs query parameter. Clients authenticate with a Bearer token over HTTPS, letting a separate edge service monitor many addresses without running the Node-RED app on the controller.
What do errorInterval and keepaliveInterval control in a subscription configuration node?
In a ctrlx-config-subscription node, errorInterval sets how frequently subscription errors are reported or retried when a subscribed Data Layer path becomes unavailable, while keepaliveInterval sets how often an idle subscription sends a heartbeat so the stream stays verified when monitored values do not change. Configuring conservative intervals on quiet status groups prevents log floods and unnecessary heartbeat traffic across the event connection.
Can special characters in Data Layer paths or IPv6 addresses cause separate Node-RED failures?
Yes. Older builds of node-red-contrib-ctrlx-automation had separate defects with IPv6 addresses containing zone indices and with special characters such as a caret in axis acceleration paths. If a single newly added node fails while your total active subscription count sits well below sixty, check the target path syntax and connection address formatting and verify the installed package release before changing your subscription architecture.


