ECONNRESET with postgres and sequelize in nodejs

Asked

Viewed 190 times

0

Good we are using nodejs v10.13.0 together with him the sequelize 4.42.0 to communicate with our bank postgres 9.2, our server is in AZURE it has 8GB of HAM, 2 CPU and is Centos 7. In the bank we are using the 2 approach schemas, And actually there will be more, we thought that maybe there could be a problem there, but we don’t know that for sure. So we’re having various connection problems, in a few moments and in a few querys the sequelize report an error in the log.

(Ode:22240) Unhandledpromiserejectionwarning: Sequelizedatabaseerror: read ECONNRESET Warning.js:18 At query.formatError (c: Users ax10415 projects Aperam.mes.tubos node_modules sequelize lib dialects postgres query.js:363:16) at query.catch.err (c: Users ax10415 projects at tryCatcher (c: Users ax10415 projects Aperam.mes.tubos node_modules Bluebird js release util.js:16:23) At Promise. _settlePromiseFromHandler (c: Users ax10415 projects Aperam.mes.tubos node_modules Bluebird js release Promise.js:512:31) At Promise. _settlePromise (c: Users ax10415 projects Aperam.mes.tubos node_modules Bluebird js release Promise.js:569:18) At Promise. _settlePromise0 (c: Users ax10415 projects Aperam.mes.tubos node_modules Bluebird js release Promise.js:614:10) At Promise. _settlePromises (c: Users ax10415 projects Aperam.mes.tubos node_modules Bluebird js release Promise.js:690:18) at _drainQueStep (c: Users ax10415 projects Aperam.mes.tubos node_modules Bluebird js release async.js:138:12) at _drainQueue (c: Users ax10415 projects Aperam.mes.tubos node_modules Bluebird js release async.js:131:9) At async. _drainQueues (c: Users ax10415 projects Aperam.mes.tubos node_modules Bluebird js release async.js:147:5) At immediate.Async.drainQueues [as _onImmediate] (c: Users ax10415 projects Aperam.mes.tubos node_modules Bluebird js release async.js:17:14) at runCallback (timers.js:705:18) tryOnImmediate (timers.js:676:5) processImmediate (timers.js:658:5) (Ode:22240) Unhandledpromiserejectionwarning: Unhandled Promise rejection. This error either originated by Throwing Inside of an async Function without a catch block, or by rejecting a Promise which was not handled with . (catch). (rejection id: 10)

We already tried to make some updates to the configuration file according to the site Pgtune

# DB Version: 9.2
# OS Type: linux
# DB Type: web
# Total Memory (RAM): 8 GB
# CPUs num: 2
# Data Storage: ssd

max_connections = 200
shared_buffers = 2GB
effective_cache_size = 6GB
maintenance_work_mem = 512MB
checkpoint_completion_target = 0.7
wal_buffers = 16MB
default_statistics_target = 100
random_page_cost = 1.1
effective_io_concurrency = 200
work_mem = 10485kB
checkpoint_segments = 32

When we made these settings the first interesting problem happened, he complained of the kernel shmmax studying we find that the PGTune informs that we need to change so we apply the changes in the file /etc/sysctl.conf adding lines

kernel.shmmax=4294967296
kernel.shmall=1048576

In addition we tried to increase the server capacity from 4GB to 8GB but we also had no success. Anyway we are not understanding what is the problem, the error message is not clear (at least for me).

  • puts the code q t by releasing the error inside a Try catch and prints the err in the catch to see the same thing he says

  • It actually makes the same mistake as the question. Something funny happened, previously 4 developers were connected on the same basis but making this connection was giving econreset, after that we started to work locally, and everything is stabilized, we are not having problems regarding this anymore, however we could not debug the error, if someone has some eminent solution still yes can add.

  • vcs are sure they are with access to external base without being the local? may be permission problem. Are using any vpn in the bank?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.