Error: Unhandled Rejection in Promise!


#1

After the last sync of ghost content, I got the following error: “Unhandled Rejection in Promise”.

Im running Botpress 10.35 with Postgres instance.

Track back:

09:57:23 - error: Unhandled Rejection in Promise:  Promise {,
  <rejected> TypeError: Cannot read property 'links' of null,
    at /usr/share/botpress/node_modules/botpress/src/dialog/provider.js:44:25,
    at Generator.next (<anonymous>),
    at step (/usr/share/botpress/node_modules/botpress/lib/dialog/provider.js:33:202),
    at /usr/share/botpress/node_modules/botpress/lib/dialog/provider.js:33:383,
    at tryCatcher (/usr/share/botpress/node_modules/bluebird/js/release/util.js:16:23),
    at Promise._settlePromiseFromHandler (/usr/share/botpress/node_modules/bluebird/js/release/promise.js:512:31),
    at Promise._settlePromise (/usr/share/botpress/node_modules/bluebird/js/release/promise.js:569:18),
    at Promise._settlePromise0 (/usr/share/botpress/node_modules/bluebird/js/release/promise.js:614:10),
    at Promise._settlePromises (/usr/share/botpress/node_modules/bluebird/js/release/promise.js:693:18),
    at Promise._fulfill (/usr/share/botpress/node_modules/bluebird/js/release/promise.js:638:18),
    at MappingPromiseArray.PromiseArray._resolve (/usr/share/botpress/node_modules/bluebird/js/release/promise_array.js:126:19),
    at MappingPromiseArray._promiseFulfilled (/usr/share/botpress/node_modules/bluebird/js/release/map.js:101:18),
    at Promise._settlePromise (/usr/share/botpress/node_modules/bluebird/js/release/promise.js:574:26),
    at Promise._settlePromise0 (/usr/share/botpress/node_modules/bluebird/js/release/promise.js:614:10),
    at Promise._settlePromises (/usr/share/botpress/node_modules/bluebird/js/release/promise.js:693:18),
    at Async._drainQueue (/usr/share/botpress/node_modules/bluebird/js/release/async.js:133:16) } Reason: ,
{ message: 'Cannot read property \'links\' of null',,
  stack: 'TypeError: Cannot read property \'links\' of null\n    at /usr/share/botpress/node_modules/botpress/src/dialog/provider.js:44:25\n    at Generator.next (<anonymous>)\n    at step (/usr/share/botpress/node_modules/botpress/lib/dialog/provider.js:33:202)\n    at /usr/share/botpress/node_modules/botpress/lib/dialog/provider.js:33:383\n    at tryCatcher (/usr/share/botpress/node_modules/bluebird/js/release/util.js:16:23)\n    at Promise._settlePromiseFromHandler (/usr/share/botpress/node_modules/bluebird/js/release/promise.js:512:31)\n    at Promise._settlePromise (/usr/share/botpress/node_modules/bluebird/js/release/promise.js:569:18)\n    at Promise._settlePromise0 (/usr/share/botpress/node_modules/bluebird/js/release/promise.js:614:10)\n    at Promise._settlePromises (/usr/share/botpress/node_modules/bluebird/js/release/promise.js:693:18)\n    at Promise._fulfill (/usr/share/botpress/node_modules/bluebird/js/release/promise.js:638:18)\n    at MappingPromiseArray.PromiseArray._resolve (/usr/share/botpress/node_modules/bluebird/js/release/promise_array.js:126:19)\n    at MappingPromiseArray._promiseFulfilled (/usr/share/botpress/node_modules/bluebird/js/release/map.js:101:18)\n    at Promise._settlePromise (/usr/share/botpress/node_modules/bluebird/js/release/promise.js:574:26)\n    at Promise._settlePromise0 (/usr/share/botpress/node_modules/bluebird/js/release/promise.js:614:10)\n    at Promise._settlePromises (/usr/share/botpress/node_modules/bluebird/js/release/promise.js:693:18)\n    at Async._drainQueue (/usr/share/botpress/node_modules/bluebird/js/release/async.js:133:16)' }

#2

@eugene or @alex can you help?


#3

Ok! I figured out what happened. Ghost content went out of sync. Actually this is a re-occurring issue. for some reason when ever I am adding/removing/editing content and not sync it for sometime the flows links gets messed up Not sure if that is unique to my setup. I will keep you posted if I was able to get steps to recreate the issue.


#4

Same problem here. How did you solve it? (Botpress 10.35.1 - postgres)


#5

In my experience, this issue always showed up when ghost content tracking gets out of sync. Why it gets out of sync? Every-time this happened to me it was after me doing lots of changes to a flow(s) i.e. adding and removing content or nodes without saving in-between actions. How I solve it? You have to trace back your changes to the last known working version and find the problem. How to avoid this? Do your content and flow development work on a dev node where ghost content is deactivated.

Hope this helps! Cheers