# Node-Red continually fails and restarts

**URL:** <https://discourse.nodered.org/t/node-red-continually-fails-and-restarts/7360>\
**Category:** General\
**Created:** [29 January 2019 10:51 UTC](https://discourse.nodered.org/t/node-red-continually-fails-and-restarts/7360 "2019-01-29T10:51:39Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![maxv](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/maxv/32/5070_2.png) [@maxv](https://discourse.nodered.org/u/maxv)\
**Post date:** [29 January 2019 10:51 UTC](https://discourse.nodered.org/t/node-red-continually-fails-and-restarts/7360/1 "2019-01-29T10:51:39Z")

</div>

I have been running Node-Red on a raspberry pi for over a year without any issues however today I noticed that I was unable to access the dashboard.

I found that Node-Red continually fails and restarts with the following errors:

_Starting as a systemd service._  
_Started Node-RED graphical event wiring tool.._  
_29 Jan 20:36:22 - [info]_  
_Welcome to Node-RED_  
_===================_  
_29 Jan 20:36:22 - [info] Node-RED version: v0.18.4_  
_29 Jan 20:36:22 - [info] Node.js version: v6.14.1_  
_29 Jan 20:36:22 - [info] Linux 4.14.79-v7+ arm LE_  
_29 Jan 20:36:24 - [info] Loading palette nodes_  
_29 Jan 20:36:30 - [info] Dashboard version 2.12.2 started at /ui_  
_29 Jan 20:36:31 - [warn] ------------------------------------------------------_  
_29 Jan 20:36:31 - [warn] [node-red-contrib-google-home-notify-volume-adjustable/google-notify] 'googlehome-notify' already registered by module node-red-contrib-google-home-notify_  
_29 Jan 20:36:31 - [warn] ------------------------------------------------------_  
_29 Jan 20:36:31 - [info] Settings file : /home/pi/.node-red/settings.js_  
_29 Jan 20:36:31 - [info] User directory : /home/pi/.node-red_  
_29 Jan 20:36:31 - [warn] Projects disabled : set editorTheme.projects.enabled=true to enable_  
_29 Jan 20:36:31 - [info] Flows file : /home/pi/.node-red/flows\_node-red-prod.json_  
_29 Jan 20:36:31 - [info] Server now running at [https://127.0.0.1:1880/](https://127.0.0.1:1880/)_  
_29 Jan 20:36:32 - [info] Starting flows_  
_29 Jan 20:36:33 - [info] Started flows_  
_29 Jan 20:36:33 - [info] [mqtt-broker:a8987a82.eda008] Connected to broker: mqtt://192.168.20.40:1883_  
_29 Jan 20:36:33 - [info] [mqtt-broker:6c25225c.ec514c] Connected to broker: mqtt://192.168.20.40:1883_  
_29 Jan 20:36:33 - [info] [mqtt-broker:d0ab341d.792168] Connected to broker: mqtt://192.168.20.40:1883_  
_29 Jan 20:36:33 - [info] [mqtt-broker:30808c8d.7772b4] Connected to broker: mqtt://192.168.20.40:1883_  
_29 Jan 20:36:33 - [info] [mqtt-broker:ffd144c3.6880a8] Connected to broker: mqtt://192.168.20.40:1883_  
_29 Jan 20:36:33 - [info] [mqtt-broker:f540f85d.d48ce8] Connected to broker: mqtt://192.168.20.40:1883_  
_29 Jan 20:36:35 - [red] Uncaught Exception:_  
_29 Jan 20:36:35 - TypeError: Cannot read property 'getHours' of undefined_  
\_ at bigTimerNode. (/home/pi/.node-red/node\_modules/node-red-contrib-bigtimer/bigtimer.js:197:26)\_  
\_ at emitOne (events.js:96:13)\_  
\_ at bigTimerNode.emit (events.js:188:7)\_  
\_ at Timeout._onTimeout (/home/pi/.node-red/node\_modules/node-red-contrib-bigtimer/bigtimer.js:859:9)_  
_nodered.service: Main process exited, code=exited, status=1/FAILURE_  
_nodered.service: Unit entered failed state._  
_nodered.service: Failed with result 'exit-code'._  
_nodered.service: Service hold-off time over, scheduling restart._  
_Stopped Node-RED graphical event wiring tool.._  
_Started Node-RED graphical event wiring tool.._  
_29 Jan 20:36:38 - [info]_

The first time it fails after it is started it mentions an error with Bigtimer however subsequent failures/restarts log the following -

_29 Jan 20:36:50 - [red] Uncaught Exception:_  
_29 Jan 20:36:50 - TypeError: Cannot read property 'getHours' of undefined_  
_nodered.service: Main process exited, code=exited, status=1/FAILURE_  
_nodered.service: Unit entered failed state._  
_nodered.service: Failed with result 'exit-code'._

Can anyone please shed any light on what the cause of the failure could be?

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [29 January 2019 11:02 UTC](https://discourse.nodered.org/t/node-red-continually-fails-and-restarts/7360/2 "2019-01-29T11:02:31Z")

</div>

> [@maxv](#):
>
> _29 Jan 20:36:35 - TypeError: Cannot read property 'getHours' of undefined_  
> \_ at bigTimerNode. (/home/pi/.node-red/node\_modules/node-red-contrib-bigtimer/bigtimer.js:197:26)\_

Yes it looks like a problem with the bigtimer node. (the error after restart is the same)

But given you haven't upgraded in over a year, it might already be fixed.  
I'd suggest running the script on the raspberry pi page in the docs, to get on the latest version of Node-RED and a newer version of nodejs (v6 is end-of-life in April [GitHub - nodejs/Release: Node.js Release Working Group](https://github.com/nodejs/Release#release-schedule))  
and then upgrade your added nodes following the instructions on the Raspberry Pi page in the docs

---

<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:** [29 January 2019 11:15 UTC](https://discourse.nodered.org/t/node-red-continually-fails-and-restarts/7360/3 "2019-01-29T11:15:56Z")

</div>

> [@maxv](#):
>
> 29 Jan 20:36:31 - [warn] [node-red-contrib-google-home-notify-volume-adjustable/google-notify] 'googlehome-notify' already registered by module node-red-contrib-google-home-notify

Also that suggests you have installed two different nodes that conflict: node-red-contrib-google-home-notify-volume-adjustable and node-red-contrib-google-home-notify. You should probably uninstall one of them.

---

<div class="post-metadata">

**Author:** ![maxv](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/maxv/32/5070_2.png) [@maxv](https://discourse.nodered.org/u/maxv)\
**Post date:** [29 January 2019 11:27 UTC](https://discourse.nodered.org/t/node-red-continually-fails-and-restarts/7360/4 "2019-01-29T11:27:10Z")

</div>

Thank you ukmoose and Colin for the suggestions.

I've updated as per the nodered raspberry pi doco to the latest versions however I still get the same errors.

Can I stop nodered from starting the Bigtimer node?

I upgraded Bigtimer to the latest version a few days ago.

I will correct that google home node error once I get nodered working correctly.

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [29 January 2019 11:43 UTC](https://discourse.nodered.org/t/node-red-continually-fails-and-restarts/7360/5 "2019-01-29T11:43:28Z")

</div>

> [@maxv](#):
>
> I upgraded Bigtimer to the latest version a few days ago.

Check your version number against the version listed on [flows.nodered.org](http://flows.nodered.org). if it isn't the same install it on the command line from within your .node-red directory.  
I'd also suggest that you add a comment on the big timer post on Pete's website.

---

<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:** [29 January 2019 11:52 UTC](https://discourse.nodered.org/t/node-red-continually-fails-and-restarts/7360/6 "2019-01-29T11:52:44Z")

</div>

> [@maxv](#):
>
> I will correct that google home node error once I get nodered working correctly.

If you definitely are using the latest version of bigtimer then your problem indicates a deficiency in that node as even if you give it bad data it should not crash node-red, so an issue should be raised against the node.  
However, once you have checked that you are using the latest then I suggest you sort out the google home error. If you have a problem that you do understand then fix that before worrying about the ones you don't understand, even if it appears to be unrelated. So many times in my career I have had similar issues and ignored the 'obvious' minor issues and concentrated on the more tricky ones, only to discover it was actually the apparently minor issue that was triggering the trickier problem. Perhaps, for example, the problem with the duplicate node is causing bad data to be generated which then confuses bigtimer.

---

<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:** [29 January 2019 11:54 UTC](https://discourse.nodered.org/t/node-red-continually-fails-and-restarts/7360/7 "2019-01-29T11:54:06Z")

</div>

> [@maxv](#):
>
> Can I stop nodered from starting the Bigtimer node?

After checking you have the latest version you could disconnect all the input wires to any bigtimer nodes you have. That would at least stop you passing in messages that may be confusing it.

---

<div class="post-metadata">

**Author:** ![maxv](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/maxv/32/5070_2.png) [@maxv](https://discourse.nodered.org/u/maxv)\
**Post date:** [29 January 2019 19:41 UTC](https://discourse.nodered.org/t/node-red-continually-fails-and-restarts/7360/8 "2019-01-29T19:41:39Z")

</div>

It isn't possible to check the Bigtimer node version or to remove the connected wiring as I need to access the Dashboard....NodeRed crashes every 10-20 seconds.

The same goes for correcting the dupe google home nodes.

It seems to me that a solution would be to backup the currently installed flows folder and settings file and to reinstall NodeRed.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [29 January 2019 20:13 UTC](https://discourse.nodered.org/t/node-red-continually-fails-and-restarts/7360/9 "2019-01-29T20:13:13Z")

</div>

no need to go that far.. you can either  
start node-red with new blank flow `node-red newflow.json` - then open the existing flow in a text editor - copy it to clipboard - then menu - import from clipboard... and then edit the flow to remove the bigtimer before deploying...

or - carefully manually edit your flow\_(somename).json file in your user directory (usually ~/.node-red) - preferably after backing it up... then search and remove the whole bigtimer node.

---

<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:** [29 January 2019 20:35 UTC](https://discourse.nodered.org/t/node-red-continually-fails-and-restarts/7360/10 "2019-01-29T20:35:03Z")

</div>

Look at the node's files in node\_modules/node-red-contrib-bigtimer to see what version it is

---

<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:** [29 January 2019 20:43 UTC](https://discourse.nodered.org/t/node-red-continually-fails-and-restarts/7360/11 "2019-01-29T20:43:00Z")

</div>

In fact the easiest way is  
`npm list node-red-contrib-bigtimer`

---

<div class="post-metadata">

**Author:** ![maxv](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/maxv/32/5070_2.png) [@maxv](https://discourse.nodered.org/u/maxv)\
**Post date:** [29 January 2019 20:52 UTC](https://discourse.nodered.org/t/node-red-continually-fails-and-restarts/7360/12 "2019-01-29T20:52:13Z")

</div>

I opened the file _flows\_node-red-prod.json_ in a text editor and I could see all of my flows.

I considered changing the field _"disabled":true_ in each flow which used the Bigtimer node however I ended up creating a new empty _flows\_node-red-prod.json_ file after renaming the old one and restarting NodeRed.

NodeRed restarted successfully with all my flows present - I expected to have no flows at all and then having to copy / paste the existing flows as suggested.

Problem solved but I can't understand why.

I expected no flows after starting with a new empty _flows\_node-red-prod.json_ .

---

<div class="post-metadata">

**Author:** ![maxv](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/maxv/32/5070_2.png) [@maxv](https://discourse.nodered.org/u/maxv)\
**Post date:** [29 January 2019 20:56 UTC](https://discourse.nodered.org/t/node-red-continually-fails-and-restarts/7360/13 "2019-01-29T20:56:41Z")

</div>

> [@Colin](#):
>
> npm list node-red-contrib-bigtimer

Thanks Colin - I was one version behind with Bigtimer.

---

<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:** [29 January 2019 21:42 UTC](https://discourse.nodered.org/t/node-red-continually-fails-and-restarts/7360/14 "2019-01-29T21:42:29Z")

</div>

> [@maxv](#):
>
> NodeRed restarted successfully with all my flows present - I expected to have no flows at all and then having to copy / paste the existing flows as suggested.

There are some circumstances under which node-red will automatically load the backup flows file that is saved each time you deploy. I wonder whether it did that. If so then you will have the file from before the last time you deployed it. If it now works ok that suggests that whatever you did at the last deploy caused the problem. Unless you have also done something else such as updating bigtimer at the same time.

---

<div class="post-metadata">

**Author:** ![rgerrans](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@rgerrans](https://discourse.nodered.org/u/rgerrans)\
**Post date:** [30 January 2019 05:13 UTC](https://discourse.nodered.org/t/node-red-continually-fails-and-restarts/7360/15 "2019-01-30T05:13:19Z")

</div>

I had the same issue after upgrading to the latest BigTimer. I just uninstalled it and then when Node-Red restarted, went to the Palette and reinstalled it.

---

<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 January 2019 09:22 UTC](https://discourse.nodered.org/t/node-red-continually-fails-and-restarts/7360/16 "2019-01-30T09:22:31Z")

</div>

That may suggest that upgrading the bigtimer node does not correctly handle upgrading the node settings, or something similar. Perhaps this should be reported to the author.

---

<div class="post-metadata">

**Author:** ![rgerrans](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@rgerrans](https://discourse.nodered.org/u/rgerrans)\
**Post date:** [30 January 2019 12:10 UTC](https://discourse.nodered.org/t/node-red-continually-fails-and-restarts/7360/17 "2019-01-30T12:10:30Z")

</div>

> [@Colin](#):
>
> That may suggest that upgrading the bigtimer node does not correctly handle upgrading the node settings, or something similar. Perhaps this should be reported to the author

@scargill Flagging this for you since it seems a number of us had issues with the latest version

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [23 March 2019 09:36 UTC](https://discourse.nodered.org/t/node-red-continually-fails-and-restarts/7360/18 "2019-03-23T09:36:43Z")

</div>

FYI: When a flow is causing NR to crash, I prefer to use `--safe` flag...

> <https://github.com/node-red/node-red/commit/d887ab126bf1a33730ea83cf79d884bc1bb54d25>

It leaves your flow(s) present and editable. Once you make your corrections and deploy, they start working again.
