json singh
json singh

Reputation: 305

sh: line 1: 5751 Segmentation fault sequelize db:migrate (Node.js + Sequelize + Postgresql)

Running sequelize db:migrate gives segmentation fault in elastic beanstalk.

-------------------------------------
/var/log/nodejs/nodejs.log
-------------------------------------
> sequelize db:migrate && node server.js


[4mSequelize CLI [Node: 10.16.0, CLI: 5.4.0, ORM: 5.8.7][24m

Loaded configuration file "sequelize/config/config.js".
Using environment "production".
sh: line 1: 10118 Segmentation fault      sequelize db:migrate
npm ERR! code ELIFECYCLE
npm ERR! errno 139
npm ERR! [email protected] start: `sequelize db:migrate && node server.js`
npm ERR! Exit status 139
npm ERR! 
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

> [email protected] start /var/app/current
> sequelize db:migrate && node server.js
-------------------------------------

Upvotes: 0

Views: 510

Answers (1)

json singh
json singh

Reputation: 305

The problem was related to the package pg-native. Switching pg solved the issue.

// Sequelize config
 production: {
    ...
    // or don't set this value.
    native: false,
    ...
  },

The problem also seems to with node version. Supposedly it doesn't work with node 10 (Need more clarification). Sources:

https://github.com/brianc/node-pg-native/issues/71

https://github.com/brianc/node-pg-native/issues/70

Upvotes: 1

Related Questions