cloudboost icon indicating copy to clipboard operation
cloudboost copied to clipboard

getting error TypeError: Cannot read property 'timestamp' of null

Open ahmedroofi opened this issue 7 years ago • 4 comments

TypeError: Cannot read property 'timestamp' of null at /home/vagrant/apps/cloudboost/database-connect/realTime.js:131:66 at /home/vagrant/apps/cloudboost/helpers/socketQuery.js:18:17 at tryCatcher (/home/vagrant/apps/cloudboost/node_modules/bluebird/js/main/util.js:26:23) at Promise.successAdapter (/home/vagrant/apps/cloudboost/node_modules/bluebird/js/main/nodeify.js:23:30) at Promise._settlePromiseAt (/home/vagrant/apps/cloudboost/node_modules/bluebird/js/main/promise.js:582:21) at Promise._settlePromises (/home/vagrant/apps/cloudboost/node_modules/bluebird/js/main/promise.js:700:14) at Async._drainQueue (/home/vagrant/apps/cloudboost/node_modules/bluebird/js/main/async.js:123:16) at Async._drainQueues (/home/vagrant/apps/cloudboost/node_modules/bluebird/js/main/async.js:133:10) at Immediate.Async.drainQueues (/home/vagrant/apps/cloudboost/node_modules/bluebird/js/main/async.js:15:14) at runCallback (timers.js:773:18) at tryOnImmediate (timers.js:734:5) at processImmediate [as _immediateCallback] (timers.js:711:5) Mon, 22 Jan 2018 14:06:36 GMT body-parser deprecated undefined extended: provide extended option at server.js:86:27

Getting this error on cloudboost, which restarts the cloudboost server and all sockets connections are lost

ahmedroofi avatar Jan 22 '18 14:01 ahmedroofi

What causes this?

nawazdhandala avatar Jan 22 '18 15:01 nawazdhandala

facing the same issue

PratikG9 avatar Jun 11 '18 09:06 PratikG9

Hi @PratikG9 please could you provide the code snippet that is causing this error? That will be real helpful, thanks.

sauban avatar Jun 11 '18 20:06 sauban

Here is the architecture diagram of our cloudboost development server,

screen shot 2018-07-03 at 7 42 48 pm

To diagnose the issue we've added logs in /database-connect/realTime.js file at line 131.


18|Locatio | REDIS CLIENT SOCKETDATA :  null
18|Locatio | REDIS CLIENT SOCKETDATA :  {"query":{"tableName":"Streams","query":{"$include":[],"$includeList":[],"_id":"5BDJUx60"},"select":{},"sort":{},"skip":0,"limit":10},"timestamp":"3MnjziOJ","eventType":"updated"}
18|Locatio | REDIS CLIENT SOCKETDATA :  null
18|Locatio | REAL CLIENT SOCKETDATA :  null

from the above logs it is cleared that socketData is null. due to this we're getting exceptions shown below,

TypeError: Cannot read property 'timestamp' of null at /home/vagrant/apps/cloudboost/database-connect/realTime.js:131:66 at /home/vagrant/apps/cloudboost/helpers/socketQuery.js:18:17 at tryCatcher (/home/vagrant/apps/cloudboost/node_modules/bluebird/js/main/util.js:26:23) at Promise.successAdapter (/home/vagrant/apps/cloudboost/node_modules/bluebird/js/main/nodeify.js:23:30) at Promise._settlePromiseAt (/home/vagrant/apps/cloudboost/node_modules/bluebird/js/main/promise.js:582:21) at Promise._settlePromises (/home/vagrant/apps/cloudboost/node_modules/bluebird/js/main/promise.js:700:14) at Async._drainQueue (/home/vagrant/apps/cloudboost/node_modules/bluebird/js/main/async.js:123:16) at Async._drainQueues (/home/vagrant/apps/cloudboost/node_modules/bluebird/js/main/async.js:133:10) at Immediate.Async.drainQueues (/home/vagrant/apps/cloudboost/node_modules/bluebird/js/main/async.js:15:14) at runCallback (timers.js:773:18) at tryOnImmediate (timers.js:734:5)

@sauban , @nawazdhandala
I think it's due to two different cloudboost instances on the same machine using the same redis server

please comment

PratikG9 avatar Jul 03 '18 14:07 PratikG9