# Join error with message complete

**URL:** <https://discourse.nodered.org/t/join-error-with-message-complete/23108>\
**Category:** General\
**Created:** [14 March 2020 16:58 UTC](https://discourse.nodered.org/t/join-error-with-message-complete/23108 "2020-03-14T16:58:13Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![albydnc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/albydnc/32/8878_2.png) [@albydnc](https://discourse.nodered.org/u/albydnc)\
**Post date:** [14 March 2020 16:58 UTC](https://discourse.nodered.org/t/join-error-with-message-complete/23108/1 "2020-03-14T16:58:13Z")

</div>

When trying to use the JOIN node by setting msg.complete, I get no output.  
here the console output

```auto
RangeError [ERR_OUT_OF_RANGE]: The value of "length" is out of range. It must be an integer. Received NaN
    at Function.concat (buffer.js:540:5)
    at completeSend (/usr/lib/node_modules/node-red/node_modules/@node-red/nodes/core/sequence/17-split.js:459:40)
    at JoinNode._inputCallback (/usr/lib/node_modules/node-red/node_modules/@node-red/nodes/core/sequence/17-split.js:667:21)
    at JoinNode.Node._emitInput (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:199:18)
    at Immediate._onImmediate (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:179:33)
    at processImmediate (internal/timers.js:439:21)

```

---

<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:** [14 March 2020 17:17 UTC](https://discourse.nodered.org/t/join-error-with-message-complete/23108/2 "2020-03-14T17:17:55Z")

</div>

Can you show us how you have configured the Join 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:** [14 March 2020 17:19 UTC](https://discourse.nodered.org/t/join-error-with-message-complete/23108/3 "2020-03-14T17:19:10Z")

</div>

Also stop node red and start it in a terminal and copy/paste the output here. That will show us what versions of tools you are using.

---

<div class="post-metadata">

**Author:** ![albydnc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/albydnc/32/8878_2.png) [@albydnc](https://discourse.nodered.org/u/albydnc)\
**Post date:** [14 March 2020 17:32 UTC](https://discourse.nodered.org/t/join-error-with-message-complete/23108/4 "2020-03-14T17:32:29Z")

</div>

```auto

Welcome to Node-RED
===================

14 Mar 18:30:52 - [info] Node-RED version: v1.0.3
14 Mar 18:30:52 - [info] Node.js version: v12.14.1
14 Mar 18:30:52 - [info] Linux 5.3.0-40-generic x64 LE
14 Mar 18:30:52 - [info] Loading palette nodes
14 Mar 18:30:52 - [info] Dashboard version 2.19.3 started at /ui
14 Mar 18:30:52 - [info] Settings file : /home/albertoperro/.node-red/settings.js
14 Mar 18:30:52 - [info] Context store : 'default' [module=memory]
14 Mar 18:30:52 - [info] User directory : /home/albertoperro/.node-red
14 Mar 18:30:52 - [warn] Projects disabled : editorTheme.projects.enabled=false
14 Mar 18:30:52 - [info] Flows file : /home/albertoperro/.node-red/flows_alberto-XPS.json
14 Mar 18:30:52 - [warn] 

```

Here the flow exported  
[flows (1).json](https://discourse.nodered.org/uploads/short-url/bmSshTM8ezr3kYO3ZrK0pkXu4iq.json) (7.2 KB)

---

<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:** [14 March 2020 17:46 UTC](https://discourse.nodered.org/t/join-error-with-message-complete/23108/5 "2020-03-14T17:46:20Z")

</div>

Please see [this post](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506) for how to share a flow in future, it is easier for us if you do it that way. Also you appear to have posted a flow with numerous nodes that are not relevant to the problem.  
I can't test your flow as I don't have the right inputs. Can you construct a mini-flow using inject nodes etc to simulate the data you are getting and show the problem with the join node?  
Also can you show the rest of the startup log please.

---

<div class="post-metadata">

**Author:** ![albydnc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/albydnc/32/8878_2.png) [@albydnc](https://discourse.nodered.org/u/albydnc)\
**Post date:** [14 March 2020 19:02 UTC](https://discourse.nodered.org/t/join-error-with-message-complete/23108/6 "2020-03-14T19:02:26Z")

</div>

Thank you for your suggestion: here a miniflow:  
A buffer is injected every second and it should be concatenated by the join node. I expect that when I inject the _complete_ I should get the big buffer in output. Instead I got no output and the console gives me the error above.

```auto
[{"id":"7dd2e40e.784e9c","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"8a845493.05c0e8","type":"inject","z":"7dd2e40e.784e9c","name":"BUFFER","topic":"","payload":"[82,73,127,127,128,127,128,127]","payloadType":"bin","repeat":"1","crontab":"","once":true,"onceDelay":0.1,"x":170,"y":80,"wires":[["b41b1253.2afb9"]]},{"id":"de36ad96.67c3a","type":"inject","z":"7dd2e40e.784e9c","name":"COMPLETE","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":170,"y":120,"wires":[["e6ff2d13.61945"]]},{"id":"b41b1253.2afb9","type":"join","z":"7dd2e40e.784e9c","name":"","mode":"custom","build":"buffer","property":"payload","propertyType":"msg","key":"topic","joiner":"[]","joinerType":"bin","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":570,"y":80,"wires":[["6327aa51.382ec4"]]},{"id":"e6ff2d13.61945","type":"change","z":"7dd2e40e.784e9c","name":"","rules":[{"t":"set","p":"complete","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":370,"y":120,"wires":[["b41b1253.2afb9"]]},{"id":"6327aa51.382ec4","type":"debug","z":"7dd2e40e.784e9c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":750,"y":80,"wires":[]}]

```

---

<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:** [14 March 2020 20:34 UTC](https://discourse.nodered.org/t/join-error-with-message-complete/23108/7 "2020-03-14T20:34:04Z")

</div>

Yes, you are quite right, there does seem to be something wrong.  
@dceejay is this a known problem? I can't see why this should not work. The issue seems to be triggered by the Join node being asked to create a buffer. The error appears in the log but not in the debug window, on sending `msg.complete`. If I change it so that it creates a String then it is ok.

**Edit** If asked to send the message after a number of parts received it is ok, also ok if the timeout mode is used.

**Further edit** I have checked that it still fails with node-red 1.0.4 and nodejs 12.16.1

---

<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:** [14 March 2020 21:24 UTC](https://discourse.nodered.org/t/join-error-with-message-complete/23108/8 "2020-03-14T21:24:54Z")

</div>

Please raise an issue with the above flow and info. Thanks

---

<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:** [14 March 2020 21:39 UTC](https://discourse.nodered.org/t/join-error-with-message-complete/23108/9 "2020-03-14T21:39:38Z")

</div>

Done. [https://github.com/node-red/node-red/issues/2505](https://github.com/node-red/node-red/issues/2505)

---

<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:** [14 March 2020 21:53 UTC](https://discourse.nodered.org/t/join-error-with-message-complete/23108/10 "2020-03-14T21:53:47Z")

</div>

@albydnc it has been pointed out in a response to the bug that when using msg.complete the payload passed is assumed to be part of the sequence to be joined, so you need to include a change node in the msg.complete stream to Delete msg.payload. Then it should be ok.

---

<div class="post-metadata">

**Author:** ![albydnc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/albydnc/32/8878_2.png) [@albydnc](https://discourse.nodered.org/u/albydnc)\
**Post date:** [14 March 2020 22:57 UTC](https://discourse.nodered.org/t/join-error-with-message-complete/23108/11 "2020-03-14T22:57:38Z")

</div>

Ok i did it as you suggested and it worked. I suggest to add this procedure in the documentation, since it wasn't clear.

Thanks for the help!

---

<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:** [13 May 2020 22:57 UTC](https://discourse.nodered.org/t/join-error-with-message-complete/23108/12 "2020-05-13T22:57:39Z")

</div>

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