# CoAP in Node-RED "Error:getaddrinfo ENOTFOUND" (node-red-contrib-coap)

**URL:** <https://discourse.nodered.org/t/coap-in-node-red-error-getaddrinfo-enotfound-node-red-contrib-coap/61232>\
**Category:** General\
**Created:** [13 April 2022 11:22 UTC](https://discourse.nodered.org/t/coap-in-node-red-error-getaddrinfo-enotfound-node-red-contrib-coap/61232 "2022-04-13T11:22:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lOcszp](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/locszp/32/60051_2.png) [@lOcszp](https://discourse.nodered.org/u/lOcszp)\
**Post date:** [13 April 2022 11:22 UTC](https://discourse.nodered.org/t/coap-in-node-red-error-getaddrinfo-enotfound-node-red-contrib-coap/61232/1 "2022-04-13T11:22:48Z")

</div>

So, I want do an application for my university IOT project and I decided to use node-red, but I'm having some issues specifically with the protocol CoAP in node-red and I don't know the cause.  
The problem is that, I can't connect to my server with the request node from (node-red-contrib-coap) and this doesn't make sense to me because (node-red-contrib-coap) it's based on Matteo Collina's [node-coap] for node.js and with Matteo Collina's [node-coap] I used an identical script, but of course for node.js and I can connect normally to my server and receive a response, even with a python application I can do the same, so I really don't know why this is only happening on node-red (node-red-contrib-coap) ...

The error:  
"13 Apr 06:40:04 - [info] [coap request:coapAC09] TypeError: The "chunk" argument must be one of type string or Buffer. Received type number  
13 Apr 06:40:04 - [info] [coap request:coapAC09] client error  
13 Apr 06:40:04 - [info] [coap request:coapAC09] Error: getaddrinfo ENOTFOUND [bbbb::12:4b00:2f4:ac09]  
13 Apr 06:44:11 - [info] [coap request:coapAC09] Error: No reply in 247s"

The request node configuration:  
 ![WhatsApp Image 2022-04-13 at 08.07.57](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/a/0a2c348b113e6c49dbe111bf31e0500c86077069.jpeg)

 ![WhatsApp Image 2022-04-13 at 08.05.55](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/a/ca824abbed13ae02d3c04e3fb40bddd72693784f.jpeg)

The script in node.js (works fine):

```auto
const coap = require('coap')
const req = coap.request({hostname:'bbbb::12:4b00:2f4:ac09', pathname:'/d'})
//const req = coap.request('coap://[bbbb::12:4b00:2f4:ac09]/d') this works as well

req.on('response', (res) => {
  res.pipe(process.stdout)
})

req.end()

```

---

<div class="post-metadata">

**Author:** ![JKRhb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jkrhb/32/59472_2.png) [@JKRhb](https://discourse.nodered.org/u/JKRhb)\
**Post date:** [16 April 2022 22:00 UTC](https://discourse.nodered.org/t/coap-in-node-red-error-getaddrinfo-enotfound-node-red-contrib-coap/61232/2 "2022-04-16T22:00:34Z")

</div>

Hi @lOcszp, thanks again for reporting this issue! Version 0.7.3 should have fixed the issue, have you been able to try it out, yet? 🙂

---

<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:** [15 June 2022 22:01 UTC](https://discourse.nodered.org/t/coap-in-node-red-error-getaddrinfo-enotfound-node-red-contrib-coap/61232/3 "2022-06-15T22:01:09Z")

</div>

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