# Value out of range stopping node red?

**URL:** https://discourse.nodered.org/t/value-out-of-range-stopping-node-red/16632
**Category:** General
**Created:** [12 October 2019 17:35 UTC](https://discourse.nodered.org/t/value-out-of-range-stopping-node-red/16632 "2019-10-12T17:35:18Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Matt](https://avatars.discourse-cdn.com/v4/letter/m/a6a055/32.png) [@Matt](https://discourse.nodered.org/u/Matt)
#### Post date: [12 October 2019 17:35 UTC](https://discourse.nodered.org/t/value-out-of-range-stopping-node-red/16632/1 "2019-10-12T17:35:18Z")

</div>

After a power outage i have lost the service of node red. if i SSH into the Pi that is running node red and entering:

```
   node red --safe

```

i can briefly load the UI and deploy a change then the connection fails after a couple of seconds.

Please review what terminal reports each and every time:

pi@raspberrypi:~ $ node-red --safe  
12 Oct 18:21:38 - [info]

# Welcome to Node-RED

12 Oct 18:21:38 - [info] Node-RED version: v0.20.8  
12 Oct 18:21:38 - [info] Node.js version: v10.15.2  
12 Oct 18:21:38 - [info] Linux 4.19.66-v7+ arm LE  
12 Oct 18:21:43 - [info] Loading palette nodes  
12 Oct 18:21:49 - [info] Dashboard version 2.15.5 started at /ui  
12 Oct 18:21:51 - [info] Settings file : /home/pi/.node-red/settings.js  
12 Oct 18:21:51 - [info] Context store : 'default' [module=memory]  
12 Oct 18:21:51 - [info] User directory : /home/pi/.node-red  
12 Oct 18:21:51 - [warn] Projects disabled : editorTheme.projects.enabled=false  
12 Oct 18:21:51 - [info] Flows file : /home/pi/.node-red/flows\_raspberrypi.json  
12 Oct 18:21:51 - [info] Server now running at [http://127.0.0.1:1880/](http://127.0.0.1:1880/)  
12 Oct 18:21:51 - [warn]

* * *

Your flow credentials file is encrypted using a system-generated key.

If the system-generated key is lost for any reason, your credentials  
file will not be recoverable, you will have to delete it and re-enter  
your credentials.

## You should set your own key using the 'credentialSecret' option in your settings file. Node-RED will then re-encrypt your credentials file using your chosen key the next time you deploy a change.

12 Oct 18:21:51 - [info] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
12 Oct 18:21:51 - [info] Flows stopped in safe mode. Deploy to start.  
12 Oct 18:21:51 - [info] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
12 Oct 18:22:57 - [info] Stopping flows  
12 Oct 18:22:57 - [info] Stopped flows  
12 Oct 18:22:57 - [info] Starting flows  
12 Oct 18:22:57 - [info] Started flows  
12 Oct 18:22:58 - [info] [udp in:RPi4B+] udp listener at 0.0.0.0:2000  
12 Oct 18:22:58 - [info] [mqtt-broker:3f3328d6.a42f38] Connected to broker: mqtt://localhost:1883  
12 Oct 18:22:59 - [red] Uncaught Exception:  
12 Oct 18:22:59 - RangeError [ERR\_OUT\_OF\_RANGE]: The value of "value" is out of range. It must be \>= -32768 and \<= 32767. Received 65436  
at checkInt (internal/buffer.js:35:11)  
at writeU\_Int16BE (internal/buffer.js:653:3)  
at Buffer.writeInt16BE (internal/buffer.js:715:10)  
at bufferizeS7Item (/home/pi/.node-red/node\_modules/nodes7/nodeS7.js:1995:25)  
at NodeS7.prepareWritePacket (/home/pi/.node-red/node\_modules/nodes7/nodeS7.js:671:3)  
at NodeS7.writeItems (/home/pi/.node-red/node\_modules/nodes7/nodeS7.js:461:7)  
at writeNext (/home/pi/.node-red/node\_modules/node-red-contrib-s7/red/s7.js:239:28)  
at NodeS7.onWritten [as writeDoneCallback] (/home/pi/.node-red/node\_modules/node-red-contrib-s7/red/s7.js:223:13)  
at NodeS7.writeResponse (/home/pi/.node-red/node\_modules/nodes7/nodeS7.js:1291:8)  
at NodeS7.onResponse (/home/pi/.node-red/node\_modules/nodes7/nodeS7.js:1201:10)  
at Socket. (/home/pi/.node-red/node\_modules/nodes7/nodeS7.js:396:20)  
at Socket.emit (events.js:189:13)  
at addChunk (\_stream\_readable.js:284:12)  
at readableAddChunk (\_stream\_readable.js:265:11)  
at Socket.Readable.push (\_stream\_readable.js:220:10)  
at TCP.onStreamRead [as onread] (internal/stream\_base\_commons.js:94:17)

Is there a way of viewing what is causing my problem?

Matt

---

<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: [12 October 2019 17:48 UTC](https://discourse.nodered.org/t/value-out-of-range-stopping-node-red/16632/2 "2019-10-12T17:48:30Z")

</div>

What makes you think it isn't what is included in the error message?

> [@Matt](#):
>
> RangeError [ERR\_OUT\_OF\_RANGE]: The value of "value" is out of range. It must be \>= -32768 and \<= 32767. Received 65436

In node `node-red-contrib-s7`

You should open an issue on GitHub with the nodes author as it should handle the error and not cause node-red to crash

---

<div class="post-metadata">

### Author: ![Matt](https://avatars.discourse-cdn.com/v4/letter/m/a6a055/32.png) [@Matt](https://discourse.nodered.org/u/Matt)
#### Post date: [12 October 2019 18:14 UTC](https://discourse.nodered.org/t/value-out-of-range-stopping-node-red/16632/3 "2019-10-12T18:14:46Z")

</div>

Thank you ukmoose,

I thought it was something more serious, i was looking for something called 'value'

i found a word in my PLC that contained 16 1's which is indeed out of range. i didn't know Node RED would respond in this way.

Namaste,

Matt

---

<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: [12 October 2019 18:37 UTC](https://discourse.nodered.org/t/value-out-of-range-stopping-node-red/16632/4 "2019-10-12T18:37:08Z")

</div>

> [@Matt](#):
>
> i didn't know Node RED would respond in this way.

Just to be clear, this is not the fault of node-red, the contrib s7 node hasn't handled an exception (hence the UNHANDLED EXCEPTION) in the log.

You should definitely raise an issue on GitHub so the author can fix it for the benefit everyone.

As a temporary workaround...  
I'm not familiar with that node or how you set it up (so conjecture from this point forward...). Is there a data type option? I ask because if so, then set the type to unsigned int so that it doesn't overflow (UINT is 0 to 65535).

---

<div class="post-metadata">

### Author: ![Matt](https://avatars.discourse-cdn.com/v4/letter/m/a6a055/32.png) [@Matt](https://discourse.nodered.org/u/Matt)
#### Post date: [12 October 2019 19:11 UTC](https://discourse.nodered.org/t/value-out-of-range-stopping-node-red/16632/5 "2019-10-12T19:11:36Z")

</div>

Hi Steve,

deffo a INT/SINT issue on my part.

I'm looking out for where to set data types.

i may look at the TRUNCATE function in Step7 to prevent this happening again. my influxDB database now has rogue data ruining my trends, i hope i can delete the bad data somehow, is this even possible?

I had a fuse blow last night after a leak above my boiler, a pH sensor ModBusTCP Arduino had hung with an input register of 65535

I have learned a bit more today thank you
