Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sails Server restarts very frequently on DB calls to Postgres DB. #6821

Open
bharatkakkar opened this issue Jul 23, 2019 · 3 comments
Open
Labels
node version issue orm Related to models, datastores, orm config, Waterline, sails-hook-orm, etc. postgresql Issue only occurs when using PostgreSQL try this out please

Comments

@bharatkakkar
Copy link

Node version: 10.15.3
Sails version (sails): ~0.12.13
ORM hook version (sails-hook-orm):
Sockets hook version (sails-hook-sockets):
Organics hook version (sails-hook-organics):
Grunt hook version (sails-hook-grunt):
Uploads hook version (sails-hook-uploads):
DB adapter & version (e.g. sails-mysql@5.55.5):
"sails-postgresql": "~0.11.3"
Skipper adapter & version (e.g. skipper-s3@5.55.5):


I get these errors very frequently when using Node 10, and Sails server restarts every now and then.
my application works well with Node 8, with no issues of server restart.

[34mdebug: [39m-------------------------------------------------------
[34mdebug: [39m-------------------------------------------------------
[34mdebug: [39mEnvironment : development
[34mdebug: [39mPort        : 8080
[34mdebug: [39m:: Tue Jul 23 2019 20:50:20 GMT+0000 (Coordinated Universal Time)
[37m[39m
[32minfo: [39mTo see your app, visit http://localhost:8080
[37m[39m
[32minfo: [39mTo shut down Sails, press <CTRL> + C at any time.
[32minfo: [39m
[32minfo: [39mServer lifted in `/home/vcap/app`
[32minfo: [39m                   ,'  |'  \
[32minfo: [39m                .-'.-==|/_--'
[32minfo: [39m                `--'-------' 
[32minfo: [39m   v0.12.14            |\
[32minfo: [39m                      /|.\
[32minfo: [39m                     / || \
[32minfo: [39m   __---___--___---___--___---___--___
[32minfo: [39m ____---___--___---___--___---___--___-__
[32minfo: [39m   Sails              <|    .-..-.
[32minfo: [39m
[32minfo: [39m               .-..-.
[32minfo: [39m
Initializing isso module
Starting health monitoring of container
Downloaded droplet (64.1M)
Cell f4149496-46f5-49e3-8607-513c579d5d91 successfully destroyed container for instance cba2aa51-0759-4513-6cd5-1587
Downloading droplet...
Cell c72ae9f0-37c6-4fb2-a442-005a4c9a80e3 successfully created container for instance 8aef0860-deeb-41f4-58a8-3804
Cell c72ae9f0-37c6-4fb2-a442-005a4c9a80e3 creating container for instance 8aef0860-deeb-41f4-58a8-3804
Cell f4149496-46f5-49e3-8607-513c579d5d91 destroying container for instance cba2aa51-0759-4513-6cd5-1587
Cell f4149496-46f5-49e3-8607-513c579d5d91 stopping instance cba2aa51-0759-4513-6cd5-1587
Exit status 0
Exit status 1
      ^
    at Connection.EventEmitter.emit (domain.js:441:20)
    at TLSSocket.EventEmitter.emit (domain.js:441:20)
    at TLSWrap.onStreamRead (internal/stream_base_commons.js:111:27)
Emitted 'error' event at:
    at Client.<anonymous> (/home/vcap/deps/0/node_modules/sails-postgresql/node_modules/pg/lib/pool.js:39:20)
    at Client.EventEmitter.emit (domain.js:441:20)
    at Connection.<anonymous> (/home/vcap/deps/0/node_modules/sails-postgresql/node_modules/pg/lib/client.js:174:19)
    at TLSSocket.<anonymous> (/home/vcap/deps/0/node_modules/sails-postgresql/node_modules/pg/lib/connection.js:94:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
events.js:174
Error: read ECONNRESET
    at Object.emit (events.js:189:13)
    at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
      throw er; // Unhandled 'error' event
    at Object.EventEmitter.emit (domain.js:441:20)
    at Client.emit (events.js:189:13)
    at Connection.emit (events.js:189:13)
    at TLSSocket.emit (events.js:189:13)
    at emitErrorNT (internal/streams/destroy.js:82:8)
@sailsbot
Copy link

@bharatkakkar Thanks for posting! We'll take a look as soon as possible.

In the mean time, there are a few ways you can help speed things along:

  • look for a workaround. (Even if it's just temporary, sharing your solution can save someone else a lot of time and effort.)
  • tell us why this issue is important to you and your team. What are you trying to accomplish? (Submissions with a little bit of human context tend to be easier to understand and faster to resolve.)
  • make sure you've provided clear instructions on how to reproduce the bug from a clean install.
  • double-check that you've provided all of the requested version and dependency information. (Some of this info might seem irrelevant at first, like which database adapter you're using, but we ask that you include it anyway. Oftentimes an issue is caused by a confluence of unexpected factors, and it can save everybody a ton of time to know all the details up front.)
  • read the code of conduct.
  • if appropriate, ask your business to sponsor your issue. (Open source is our passion, and our core maintainers volunteer many of their nights and weekends working on Sails. But you only get so many nights and weekends in life, and stuff gets done a lot faster when you can work on it during normal daylight hours.)
  • let us know if you are using a 3rd party plugin; whether that's a database adapter, a non-standard view engine, or any other dependency maintained by someone other than our core team. (Besides the name of the 3rd party package, it helps to include the exact version you're using. If you're unsure, check out this list of all the core packages we maintain.)

Please remember: never post in a public forum if you believe you've found a genuine security vulnerability. Instead, disclose it responsibly.

For help with questions about Sails, click here.

@bharatkakkar bharatkakkar changed the title Emitted 'error' event at: at Client.<anonymous> (/home/vcap/deps/0/node_modules/sails-postgresql/node_modules/pg/lib/pool.js:39:20) Sails Server restarts very frequently on DB calls to Postgres DB. Jul 23, 2019
@johnabrams7 johnabrams7 added orm Related to models, datastores, orm config, Waterline, sails-hook-orm, etc. postgresql Issue only occurs when using PostgreSQL node version issue labels Jul 25, 2019
@johnabrams7
Copy link
Contributor

johnabrams7 commented Aug 5, 2019

Hey @bharatkakkar - thanks for bringing this to our attention. If feasible, could you share a repo of this intermittent problem with us for further investigation? Also the latest sails v0.12x was from about 2 years ago while Node v10 was a little over a year ago so this may be related to compatibility. In the meantime, it may be worthwhile to try the latest 0.12x variant Sails 0.12.14.

@johnabrams7 johnabrams7 added the repro please Could you reproduce this in a repository for us? label Aug 5, 2019
@bharatkakkar
Copy link
Author

Sorry I can't share the code with you, but I'll try Sails 0.12.14.
Thanks for the reply.

@sailsbot sailsbot removed the repro please Could you reproduce this in a repository for us? label Aug 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
node version issue orm Related to models, datastores, orm config, Waterline, sails-hook-orm, etc. postgresql Issue only occurs when using PostgreSQL try this out please
Development

No branches or pull requests

3 participants