# Node-Red Constantly Disabling on VPS: Seeking Solutions for Continuous Operation

**URL:** <https://discourse.openiap.io/t/node-red-constantly-disabling-on-vps-seeking-solutions-for-continuous-operation/1178>\
**Category:** Issues and feature requests\
**Tags:** agent, openrpa\
**Created:** [February 19, 2024, 1:32pm UTC](https://discourse.openiap.io/t/node-red-constantly-disabling-on-vps-seeking-solutions-for-continuous-operation/1178 "2024-02-19T13:32:33Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fred\_Brandt](https://discourse.openiap.io/user_avatar/discourse.openiap.io/fred_brandt/32/1359_2.png) [@Fred\_Brandt](https://discourse.openiap.io/u/Fred_Brandt)\
**Post date:** [February 19, 2024, 1:32pm UTC](https://discourse.openiap.io/t/node-red-constantly-disabling-on-vps-seeking-solutions-for-continuous-operation/1178/1 "2024-02-19T13:32:33Z")

</div>

I followed Anders Jensen’s tutorial ([https://www.youtube.com/watch?v=Zy04eSDy3RI](https://www.youtube.com/watch?v=Zy04eSDy3RI)) and implemented the installation of openflow on my VPS server (digital ocean). I also enabled Node-red perfectly.

However, I noticed that node-red is constantly disabled. Is this normal? I saw something about it being turned off every 8 hours, but I thought that wouldn’t happen when the installation was done on my own server.

Either way, I looked for how to purchase the paid plans to avoid this problem and couldn’t find any.

Any advice?

---

<div class="post-metadata">

**Author:** ![Allan\_Zimmermann](https://discourse.openiap.io/user_avatar/discourse.openiap.io/allan_zimmermann/32/12_2.png) [@Allan\_Zimmermann](https://discourse.openiap.io/u/Allan_Zimmermann)\
**Post date:** [February 19, 2024, 2:02pm UTC](https://discourse.openiap.io/t/node-red-constantly-disabling-on-vps-seeking-solutions-for-continuous-operation/1178/2 "2024-02-19T14:02:19Z")

</div>

Hey.  
Go to Resources and click “Ensure common”.  
Reload the website in your browser.  
Then go to agents and on each agent, select a “non free” plan for the agent(s) …  
 ![image](https://discourse.openiap.io/uploads/default/original/2X/e/e875b57e5309c3bf357910bc5ec3f675174c360e.png)

this will ensure they do not turn off after 8 hours.

---

<div class="post-metadata">

**Author:** ![Fred\_Brandt](https://discourse.openiap.io/user_avatar/discourse.openiap.io/fred_brandt/32/1359_2.png) [@Fred\_Brandt](https://discourse.openiap.io/u/Fred_Brandt)\
**Post date:** [February 19, 2024, 2:28pm UTC](https://discourse.openiap.io/t/node-red-constantly-disabling-on-vps-seeking-solutions-for-continuous-operation/1178/3 "2024-02-19T14:28:33Z")

</div>

Thank you Allan.  
I just did that and I believe it solve it.

---

<div class="post-metadata">

**Author:** ![Allan\_Zimmermann](https://discourse.openiap.io/user_avatar/discourse.openiap.io/allan_zimmermann/32/12_2.png) [@Allan\_Zimmermann](https://discourse.openiap.io/u/Allan_Zimmermann)\
**Post date:** [February 19, 2024, 2:33pm UTC](https://discourse.openiap.io/t/node-red-constantly-disabling-on-vps-seeking-solutions-for-continuous-operation/1178/4 "2024-02-19T14:33:04Z")

</div>

Well, we will not know until 8 hours have past, but it should fix it 🙂

---

<div class="post-metadata">

**Author:** ![Fred\_Brandt](https://discourse.openiap.io/user_avatar/discourse.openiap.io/fred_brandt/32/1359_2.png) [@Fred\_Brandt](https://discourse.openiap.io/u/Fred_Brandt)\
**Post date:** [February 20, 2024, 1:09pm UTC](https://discourse.openiap.io/t/node-red-constantly-disabling-on-vps-seeking-solutions-for-continuous-operation/1178/5 "2024-02-20T13:09:59Z")

</div>

Allan, I accessed the panel today and this was the state of the agent:

 ![WhatsApp Image 2024-02-20 at 10.07.51](https://discourse.openiap.io/uploads/default/original/2X/3/33d8297db19fba49ef004933107f844196060bdb.jpeg)

I clicked the play button, and after a while it was up and running. But apparently it was turned off.

---

<div class="post-metadata">

**Author:** ![Allan\_Zimmermann](https://discourse.openiap.io/user_avatar/discourse.openiap.io/allan_zimmermann/32/12_2.png) [@Allan\_Zimmermann](https://discourse.openiap.io/u/Allan_Zimmermann)\
**Post date:** [February 20, 2024, 1:48pm UTC](https://discourse.openiap.io/t/node-red-constantly-disabling-on-vps-seeking-solutions-for-continuous-operation/1178/6 "2024-02-20T13:48:32Z")

</div>

Hmm, sounds like a bug … unless you did not turn off the agent before updating ? ( click stop and then start/play )  
Lots of questions about this topic, i think there is an issue in my code somewhere ( also mentioned here [Parameter "runtime\_hours"](https://discourse.openiap.io/t/parameter-runtime-hours/1182) )

---

<div class="post-metadata">

**Author:** ![Allan\_Zimmermann](https://discourse.openiap.io/user_avatar/discourse.openiap.io/allan_zimmermann/32/12_2.png) [@Allan\_Zimmermann](https://discourse.openiap.io/u/Allan_Zimmermann)\
**Post date:** [February 25, 2024, 11:41am UTC](https://discourse.openiap.io/t/node-red-constantly-disabling-on-vps-seeking-solutions-for-continuous-operation/1178/7 "2024-02-25T11:41:11Z")

</div>

i moved this to issues/bugs …  
I think there is a problem here, but need time to do in depth testing

---

<div class="post-metadata">

**Author:** ![Allan\_Zimmermann](https://discourse.openiap.io/user_avatar/discourse.openiap.io/allan_zimmermann/32/12_2.png) [@Allan\_Zimmermann](https://discourse.openiap.io/u/Allan_Zimmermann)\
**Post date:** [February 26, 2024, 12:49pm UTC](https://discourse.openiap.io/t/node-red-constantly-disabling-on-vps-seeking-solutions-for-continuous-operation/1178/8 "2024-02-26T12:49:30Z")

</div>

both docker and kubernetes had he exact same code

```auto
        const resource = await Config.db.GetResource("Agent Instance", parent);
        let runtime: number = resource?.defaultmetadata?.runtime_hours;
        if (NoderedUtil.IsNullUndefinded(runtime)) {
            // If agent resource does not exists, dont turn off agents
            runtime = 0;
            // If agent resource does exists, but have no default, use 24 hours
            if (!NoderedUtil.IsNullUndefinded(resource)) runtime = 24;
        }

```

it did not care about multi tenancy … guess my memory is not as good as I though.

If no agent resource has been added, **or** if the resource’s default metadata does not have `runtime_hours` it will stop all instances after 24 hours.  
If it exists, it turn them off after `runtime_hours` hours.  
That is **not** what I intended. Not sure how that ended up being like that.

So i have changed it to this in 1.5.9.17 … I will make 1.5.9 the latest version this week.

So now the code is

```auto
        const resource: any = await Config.db.GetResource("Agent Instance", parent);
        if (NoderedUtil.IsNullUndefinded(resource)) return;
        let runtime: number = resource?.defaultmetadata?.runtime_hours;
        if (NoderedUtil.IsNullUndefinded(runtime)) {
            // If agent resource does not exists, dont turn off agents
            runtime = 0;
        }
        if (runtime < 1) return;

```

If no agent resource has been added. Do nothing  
If agent resource does not have runtime\_hours, do nothing  
If runtime\_hours exists it will turn off the free plan instances after `runtime_hours` hours.

---

<div class="post-metadata">

**Author:** ![system](https://discourse.openiap.io/uploads/default/original/2X/a/a1ca7b164ac9a826839704d9ac82c7b5e6bcf557.png) [@system](https://discourse.openiap.io/u/system)\
**Post date:** [March 4, 2024, 12:50pm UTC](https://discourse.openiap.io/t/node-red-constantly-disabling-on-vps-seeking-solutions-for-continuous-operation/1178/9 "2024-03-04T12:50:04Z")

</div>

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