# Value out of range

**URL:** <https://discourse.nodered.org/t/value-out-of-range/75876>\
**Category:** General\
**Tags:** function-node\
**Created:** [28 February 2023 15:01 UTC](https://discourse.nodered.org/t/value-out-of-range/75876 "2023-02-28T15:01:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gopinath.m](https://avatars.discourse-cdn.com/v4/letter/g/97f17d/32.png) [@gopinath.m](https://discourse.nodered.org/u/gopinath.m)\
**Post date:** [28 February 2023 15:01 UTC](https://discourse.nodered.org/t/value-out-of-range/75876/1 "2023-02-28T15:01:21Z")

</div>

Hi I am receiving some messages from azure cloud and converting them into JSON Object .but sometimes i am getting below error,can anyone guide me how to solve this issue.  
[error] RangeError: The value of "value" is out of range. It must be \>= 0 and \<= 255. Received -19  
at new NodeError (node:internal/errors:371:5)  
at writeU\_Int8 (node:internal/buffer:738:11)  
at Buffer.writeUInt8 (node:internal/buffer:748:10)  
at BufferBuilder.appendUInt8 (C:\Users\Admin.node-red\node\_modules\buffer-builder\buffer-builder.js:44:15)  
at Object.encoder [as encode] (C:\Users\Admin.node-red\node\_modules\amqp10\lib\types.js:390:61)  
at Object.encoder [as encode] (C:\Users\Admin.node-red\node\_modules\amqp10\lib\types.js:429:17)  
at Codec.encode (C:\Users\Admin.node-red\node\_modules\amqp10\lib\codec.js:174:20)  
at Codec.\_encodeObject (C:\Users\Admin.node-red\node\_modules\amqp10\lib\codec.js:232:48)  
at Codec.encode (C:\Users\Admin.node-red\node\_modules\amqp10\lib\codec.js:181:32)  
at Object.listBuilder [as encode] (C:\Users\Admin.node-red\node\_modules\amqp10\lib\types.js:112:43)  
at Codec.encode (C:\Users\Admin.node-red\node\_modules\amqp10\lib\codec.js:174:20)  
at Codec.\_encodeObject (C:\Users\Admin.node-red\node\_modules\amqp10\lib\codec.js:232:48)  
at Codec.encode (C:\Users\Admin.node-red\node\_modules\amqp10\lib\codec.js:181:32)  
at Codec.\_encodeObject (C:\Users\Admin.node-red\node\_modules\amqp10\lib\codec.js:219:10)  
at Codec.encode (C:\Users\Admin.node-red\node\_modules\amqp10\lib\codec.js:181:32)  
at Object.frames.writeFrame (C:\Users\Admin.node-red\node\_modules\amqp10\lib\frames.js:46:11)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/5/15c5963ffdf768312c9aa41c5df026e83fc629ca.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/f/4f1a3ca004a7c938443d0605f816bd67aa3339ab.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/d/2dde7ed9c2d616a05845aad02c2e0b7ece56b409.png)

---

<div class="post-metadata">

**Author:** ![gopinath.m](https://avatars.discourse-cdn.com/v4/letter/g/97f17d/32.png) [@gopinath.m](https://discourse.nodered.org/u/gopinath.m)\
**Post date:** [1 March 2023 12:30 UTC](https://discourse.nodered.org/t/value-out-of-range/75876/2 "2023-03-01T12:30:31Z")

</div>

i have got some idea from the below link i have stringified (Serialized) the incoming message and then parsed (deserialized) it again ,looks that had solved a problem for somebody .i am going to try this.

> <https://github.com/amqp/rhea/issues/168>
>
> \### Background
> We implement request/response communication pattern via AMQP and… use Qpid (C++ version) as the amqp broker. We ported our applications from amqp10 to rhea because when we moved from node 8 to node 10, we started getting buffer write errors (very similar to the one I'm about to show you).
> 
> We create our receiver queues via the same connection using the QMF2 framework (which is probably not relevant, because the error only occurs on sender connections, for which the queue is created by other services).
> 
> \### Description
> The errors we have encountered with rhea only start showing up after the application has run for a while (in this case a day on a low traffic test server). These errors start with the number 256 and start counting up from there (281 in the example).
> We have only observed this error occurring when we are \*sending\* to an already existing queue.
> 
> \### Example
> \`\`\`
> \[RangeError \[ERR\_OUT\_OF\_RANGE\]\] "The value of "value" is out of range. It must be \>= 0 and \<= 255. Received 281" RangeError \[ERR\_OUT\_OF\_RANGE\]: The value of "value" is out of range. It must be \>= 0 and \<= 255. Received 281
> at writeU\_Int8 (internal/buffer.js:559:11)
> at Buffer.writeUInt8 (internal/buffer.js:569:10)
> at types.Writer.write\_uint (/app/node\_modules/rhea/lib/types.js:725:28)
> at types.Writer.write\_variable\_width (/app/node\_modules/rhea/lib/types.js:751:10)
> at types.Writer.write\_value (/app/node\_modules/rhea/lib/types.js:789:14)
> at types.Writer.write (/app/node\_modules/rhea/lib/types.js:779:14)
> at types.Writer.write\_compound (/app/node\_modules/rhea/lib/types.js:814:18)
> at types.Writer.write\_value (/app/node\_modules/rhea/lib/types.js:791:14)
> at types.Writer.write (/app/node\_modules/rhea/lib/types.js:779:14)
> at types.Writer.write\_compound (/app/node\_modules/rhea/lib/types.js:814:18)
> \`\`\`
> \### Further observations
> Because the number always counts up, we think that the number being written might be a counter of some sorts? We use a correlationId consisting of a string (ULID-identifier), so it cant be that. All other information being non-counting, the only other number we send ourselves is the userId number, which is always the same on this environment, and is always observed to be in the tens not in the hunderds (and counting up).
> 
> If you need any further information, please tell us.

---

<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:** [30 April 2023 12:31 UTC](https://discourse.nodered.org/t/value-out-of-range/75876/3 "2023-04-30T12:31:29Z")

</div>

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