I use Nest,js with https://github.com/RemoteMetering/geteventstore-promise for an e-commerce site. It had been working fine for the first couple of months and recently up until now we’ve got strange behaviour from ES. Sometimes we see an error that would stop us from receiving events from ES, which I will show more below, or connection dropped then we have to restart the system to get it working, but soon it would happen again.
The first few times it happened at the time of creating order, we decided to reduce data in the stream and we saw that we have not got the error there anymore. Now we are facing the issue with payment. After we have got the payment confirmed, we would create maximum of 5 events of similar data as below:
The error I received is:
(node:18) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 7)
(node:18) UnhandledPromiseRejectionWarning: TypeError: Cannot read property ‘error’ of undefined
at VolatileSubscriptionOperation. (/usr/src/app/dist/src/event-store/event-store.js:101:25)
at Generator.next ()
at new Promise ()
at __awaiter (/usr/src/app/dist/src/event-store/event-store.js:16:12)
at VolatileSubscriptionOperation.onDropped [as _subscriptionDropped] (/usr/src/app/dist/src/event-store/event-store.js:100:16)
at VolatileSubscriptionOperation.module.exports.SubscriptionOperation._executeActions (/usr/src/app/node_modules/node-eventstore-client/lib/dist.js:3890:15)
at processImmediate (internal/timers.js:439:21)
Could it be caused by the size of payload and the amount of events are too much? I didn’t think it would be the problem, but I don’t know what else could cause this issue.
Edited: tried upgrading but didn’t solve the problem.
We also receive out of mem error, but I’m not sure if it’s related to above error message.I’m using Digitalocean 2vCPU 2GB RAM. Should I upgrade it or could I switch to 1vCPU 3 GB RAM? Would it be wise to do so or do you think if I can solve the problem above it would also solve this problem as well?