moscajs / mosca

MQTT broker as a module
mosca.io
3.2k stars 508 forks source link

TypeError: Cannot read property 'toString' of undefined #652

Closed nachten closed 7 years ago

nachten commented 7 years ago

Getting the following error when I wanted to put my application in production environment: TypeError: Cannot read property 'toString' of undefined at emitReadable (/XXXXX/XXXXX/node_modules/reduplexer/node_modules/readable-stream/lib/_stream_readable.js:444:5)

On development I don't have this problem ...

My development environment is as macbook running node version 6.11.0, mosca 2.5.1 My production environment is a ubuntu server 16.04 LTS node version 6.11.0, mosca 2.5.1

I'm getting the error when I receive a lot of messages in a very small period of time +/- 200 message in 0 - 100 ms ?

mcollina commented 7 years ago

Can you upload a script for us to replicate? It's hard to debug it in this way.

nachten commented 7 years ago

Thank you for replying @mcollina I'm working on a development environment in ubuntu, so I can try to reproduce the problem in ubuntu server 16.04 ... only problem is that it's hard for me to create a realistic situation as I have more than 300 to 400 devices connected to this messagebus ...

I've already created a simple console application which forwards all message from source to target (development) but this doesn't give me any errors ... which made me think that the problem lays in the device clients which are connected ... (mosquitto) does this give you a better insight of my problem ?

mcollina commented 7 years ago

@nachten not really. In order to see if I fixed this issue, I need a way to reproduce.

nachten commented 7 years ago

Alright I will do my best in trying to reproduce this problem in development for you so I can share it with you.

nachten commented 7 years ago

@mcollina if you have any helpful suggestions for me on how to reproduce this problem for you then please let me know .... The problem is that i'm migrating my mqtt broker from mosquitto to mosca ... so for me now the only problem to reproduce this problem in development is to redirect my DNS to my development UBUNTU setup ... I can not due to security reasons give you access to this ... :(

I know this is not very helpfull ..., but i'm almost sure it has something to do with the clients connected to the mosca broker .. because i've build some stress testing scripts and everything keeps working like a charm ...

nachten commented 7 years ago

Now that i configured the ascoltatore with Redis everything is working like a charm ...