# OPCA UA problem with autostarting

**URL:** <https://discourse.nodered.org/t/opca-ua-problem-with-autostarting/99216>\
**Category:** General\
**Tags:** opcua\
**Created:** [29 September 2025 13:49 UTC](https://discourse.nodered.org/t/opca-ua-problem-with-autostarting/99216 "2025-09-29T13:49:38Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![mbb](https://avatars.discourse-cdn.com/v4/letter/m/eb9ed0/32.png) [@mbb](https://discourse.nodered.org/u/mbb)\
**Post date:** [29 September 2025 13:49 UTC](https://discourse.nodered.org/t/opca-ua-problem-with-autostarting/99216/1 "2025-09-29T13:49:38Z")

</div>

Hello  
I'm still new to node red - i have such a problem.  
I've created the flow that is working fine but - after power restart of my revice( raspberry ) im automatically starting the nodered but then im in such a state :

 ![unnamed](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/7/174c179a69d09da8a383bc4f544648144013072b.jpeg)  
So the first part of the flow is in keeaplive / subscribe state  
While the second part ( there's no connectiong between thoose parts) is all the time in connecting phase.  
For both parts im using the same injects and same settings.

If i deploy the flow - its starts to work , but in the end i want to have the flow running automatically after power reset

---

<div class="post-metadata">

**Author:** ![leftymuller](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/leftymuller/32/102326_2.png) [@leftymuller](https://discourse.nodered.org/u/leftymuller)\
**Post date:** [30 September 2025 02:52 UTC](https://discourse.nodered.org/t/opca-ua-problem-with-autostarting/99216/2 "2025-09-30T02:52:33Z")

</div>

Hi mbb, Welcome to the forum

Bit confusing what your actually asking.

Do you need help with node-red auto starting on your pi or the flow to start automatically when node-red starts?

I would highly recommend you use PM2 to start and watchdog node-red, this will restart node-red if it becomes unresponsive or crashes

as far as your flow it looks like your starting it on node-red start but if you can post a copy of your flow into the post with the \</\> to embed your flow into the forum post that would be helpful.

---

<div class="post-metadata">

**Author:** ![mbb](https://avatars.discourse-cdn.com/v4/letter/m/eb9ed0/32.png) [@mbb](https://discourse.nodered.org/u/mbb)\
**Post date:** [30 September 2025 08:57 UTC](https://discourse.nodered.org/t/opca-ua-problem-with-autostarting/99216/3 "2025-09-30T08:57:22Z")

</div>

Hi leftymuller,  
thank you  
Node red is already autostarting.  
But the problem is as on the screentshot - first OPC-UA client is in keepalive / active subsribed if i press the button 2 that is connected.  
But OPC UA Client underneeth is all the time in connecting mode . If i click button 1 nothing changes.  
I need to make some changes in the flow, click deploy and its working then.  
But after power reset - again im able to open the flow automatically but its in the same state.

For the PM2 i was trying to install it using npm install -g pm2 but i have an error : EACCES : permision denied, mkdir 'usr/lib/node\_modules/pm2

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [30 September 2025 14:56 UTC](https://discourse.nodered.org/t/opca-ua-problem-with-autostarting/99216/4 "2025-09-30T14:56:37Z")

</div>

> [@mbb](#):
>
> click deploy and its working then.

I suspect the problem may be that node red is up and running before the OPC-UA server is ready, so the initial connection fails, and that the node is not able to recover from that situation. I seem to remember previous reports of that.

Are there any relevant messages in the node-red log?

---

<div class="post-metadata">

**Author:** ![mbb](https://avatars.discourse-cdn.com/v4/letter/m/eb9ed0/32.png) [@mbb](https://discourse.nodered.org/u/mbb)\
**Post date:** [30 September 2025 19:11 UTC](https://discourse.nodered.org/t/opca-ua-problem-with-autostarting/99216/5 "2025-09-30T19:11:55Z")

</div>

thank you, but i quess thats not the thing. i use the same OPC\_UA server for both connections.  
In the meantime i've found on [Issues · mikakaraila/node-red-contrib-opcua](https://github.com/mikakaraila/node-red-contrib-opcua/issues)  
similar case and solution was to use single client and switch function. It works, but ...  
i have also in that flow OPC\_UA client in write mode. And that i cannot connect to the same OPC\_UA client ( here i'm just subsrcibing) and for that OPC\_UA client in write mode i again have a problem with that it's still in connecting , not keep alive

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [30 September 2025 19:56 UTC](https://discourse.nodered.org/t/opca-ua-problem-with-autostarting/99216/6 "2025-09-30T19:56:42Z")

</div>

> [@Colin](#):
>
> Are there any relevant messages in the node-red log?

You don't appear to have answered that.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [30 September 2025 19:57 UTC](https://discourse.nodered.org/t/opca-ua-problem-with-autostarting/99216/7 "2025-09-30T19:57:59Z")

</div>

Also, if you stop node-red from autostarting, reboot, wait till it is fully booted and then start node-red is it ok?

---

<div class="post-metadata">

**Author:** ![mbb](https://avatars.discourse-cdn.com/v4/letter/m/eb9ed0/32.png) [@mbb](https://discourse.nodered.org/u/mbb)\
**Post date:** [1 October 2025 13:56 UTC](https://discourse.nodered.org/t/opca-ua-problem-with-autostarting/99216/8 "2025-10-01T13:56:28Z")

</div>

thank you,  
yes you're right.  
There are some errors in the log.  
The opcUAnode1237.... is the not that is in the connecting .  
At the sceond screenshot there's some other error - im not really sure weather its related to also those nodes, but perhaps yes. I cannot set the clock / clock server at my opc\_ua server - it's not online

 ![IMG_5310](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/f/ffc0a907b2cf7fc4a30ade45657fb9332f046ba9.jpeg)  
 ![IMG_5311](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/5/d524a0353357c9726f960133dad8f0b4754a0c2e.jpeg)

---

<div class="post-metadata">

**Author:** ![mbb](https://avatars.discourse-cdn.com/v4/letter/m/eb9ed0/32.png) [@mbb](https://discourse.nodered.org/u/mbb)\
**Post date:** [3 October 2025 08:28 UTC](https://discourse.nodered.org/t/opca-ua-problem-with-autostarting/99216/9 "2025-10-03T08:28:52Z")

</div>

Problem was with contrib-opcua.  
When i downgrade it, it works

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [1 January 2026 08:29 UTC](https://discourse.nodered.org/t/opca-ua-problem-with-autostarting/99216/10 "2026-01-01T08:29:29Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
