Skip to content
This repository has been archived by the owner on Feb 25, 2020. It is now read-only.

Error: Invalid CoAP version #69

Open
robin13 opened this issue Mar 1, 2016 · 5 comments
Open

Error: Invalid CoAP version #69

robin13 opened this issue Mar 1, 2016 · 5 comments

Comments

@robin13
Copy link

robin13 commented Mar 1, 2016

I get errors like this:

Connection from: ::ffff:10.10.10.88, connId: 166
CryptoStream transform error TypeError: Cannot read property 'length' of null
CryptoStream transform error TypeError: Cannot read property 'length' of null
on ready { coreID: '3e0023000747343232363230',
  ip: '::ffff:10.10.10.88',
  product_id: 6,
  firmware_version: 65535,
  cache_key: '_165' }
Core online!
CryptoStream transform error TypeError: Cannot read property 'length' of null
Coap Error: Error: Invalid CoAP version. Expected 1, got: 0
routeMessage got a NULL coap message  { coreID: '3e0023000747343232363230' }
CryptoStream transform error TypeError: Cannot read property 'length' of null
CryptoStream transform error Error: error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt
Coap Error: Error: Unknown message code: 58
routeMessage got a NULL coap message  { coreID: '3e0023000747343232363230' }

I think this error CryptoStream transform error TypeError: Cannot read property 'length' of null is related to this PR but probably not merged yet.

I wonder about this one too though: Coap Error: Error: Invalid CoAP version. Expected 1, got: 0 - I see that a lot, and sometimes got: 2 or got: 3.

Any ideas?

@dmiddlecamp
Copy link
Contributor

Hi @robin13 ,

Thanks for the ping! Yes I suspect they are related, it's a problem with the crypto library and newer versions of node. Sorry we haven't fixed this yet, everyone has been crazy busy, but changing node version or applying that patch to the local server should fix it.

Thanks,
David

@robin13
Copy link
Author

robin13 commented Mar 2, 2016

Yes - applying the patch works.

There is still the odd output:

onSocketData called, but no data sent.
routeMessage got a NULL coap message  { coreID: '3e0023000747343232363230' }

But I am now getting publish events streaming. :)

@chuank
Copy link

chuank commented Mar 18, 2016

@robin13, @dmiddlecamp,

Reporting similar issues with the NULL CoAP message on my local setup running Node 4.2.6 LTS, including the patch from particle-iot/spark-protocol#14.

Also isolated this issue a bit further: this error shows up when a Photon is made to publish to the local cloud. Every time a publish is executed, the breathing cyan blinks and the server logs the 'NULL CoAP' error, before returning to breathing cyan right after. The publish event does make it through, but due to this error, there's a bit of a lag waiting for the Photon to recover the connection to the cloud. @robin do you notice your Photons blinking cyan when it publishes?

I tried using curl to manually publish the same event to the local cloud, and that works fine without error.

Screencap of my server log with a Photon repeatedly publishing and triggering the error on the server:
image

Apologies for not being able to help beyond merely posting details of the errors; I just don't have the ability nor resources to dive into this. I'm just hoping that someone will be able to corroborate my findings and help to get to the bottom of this.

edit: similar, earlier discussion also referenced here #61 but I think this current issue is more specific to the NULL CoAP message.

@chuank
Copy link

chuank commented Mar 28, 2016

@robin13 when your device(s) publish an event, do you notice it disconnecting briefly (blinking cyan) right after, before reconnecting?

Also, what version of node are you using?

@chuank
Copy link

chuank commented Jun 1, 2016

lbt pushed a commit to lbt/spark-server that referenced this issue Feb 28, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants