Good point @perumalkuk. I just checked it out with pm2 monit
and pm2 log
and it looks like my app is restarting itself all the time.
I also linked my app to this website a few weeks ago https://app.keymetrics.io/ but didn’t check it out till now and when I saw it… well… I’ve got more than 350.00 restarts 0_0
Anyway, the logs show this:
PM2 | 2017-05-07 10:34:27: Starting execution sequence in -cluster mode- for app name:recipic id:1
PM2 | 2017-05-07 10:34:27: App name:recipic id:1 online
1|recipic | at Module._compile (module.js:571:32)
1|recipic | at Object.Module._extensions..js (module.js:580:10)
1|recipic | at Module.load (module.js:488:32)
1|recipic | at tryModuleLoad (module.js:447:12) code: 'MODULE_NOT_FOUND' }
1|recipic | { Error: Cannot find module '../build/Release/bson'
1|recipic | at Function.Module._resolveFilename (module.js:470:15)
1|recipic | at Function.Module._load (module.js:418:25)
1|recipic | at Function._load (/usr/lib/node_modules/pm2/node_modules/pmx/lib/transaction.js:91:21)
1|recipic | at Module.require (module.js:498:17)
1|recipic | at require (internal/module.js:20:19)
1|recipic | at Object.<anonymous> (/home/recipic/apps/recipic/bundle/programs/server/npm/node_modules/meteor/cfs_gridfs/node_modules/mongodb/node_modules/bson/ext/index.js:15:10)
1|recipic | at Module._compile (module.js:571:32)
1|recipic | at Object.Module._extensions..js (module.js:580:10)
1|recipic | at Module.load (module.js:488:32)
1|recipic | at tryModuleLoad (module.js:447:12) code: 'MODULE_NOT_FOUND' }
1|recipic | meteor npm install --save bcrypt
1|recipic |
1|recipic | in the root directory of your application.
1|recipic | js-bson: Failed to load c++ bson extension, using pure JS version
1|recipic | Error: bind EADDRINUSE 0.0.0.0:3000
1|recipic | at Object.exports._errnoException (util.js:1050:11)
1|recipic | at exports._exceptionWithHostPort (util.js:1073:20)
1|recipic | at listenOnMasterHandle (net.js:1336:16)
1|recipic | at rr (internal/cluster/child.js:111:12)
1|recipic | at Worker.send (internal/cluster/child.js:78:7)
1|recipic | at process.onInternalMessage (internal/cluster/utils.js:42:8)
1|recipic | at emitTwo (events.js:111:20)
1|recipic | at process.emit (events.js:194:7)
1|recipic | at process.nextTick (internal/child_process.js:766:12)
1|recipic | at _combinedTickCallback (internal/process/next_tick.js:73:7)
[STREAMING] Now streaming realtime logs for [all] processes
1|recipic | Note: you are using a pure-JavaScript implementation of bcrypt.
1|recipic | While this implementation will work correctly, it is known to be
1|recipic | approximately three times slower than the native implementation.
1|recipic | In order to use the native implementation instead, run
1|recipic | meteor npm install --save bcrypt
1|recipic | in the root directory of your application.
I get meteor npm install --save bcrypt
also when I run my app locally so it’s not too relevant. I’ve got this on my CI process as well but it doesn’t install properly.
Maybe the issue is more related with Error: Cannot find module '../build/Release/bson'
but I don’t get this issue running my app locally (makes sense because it’s not a deployed version).
Thanks for confirming @philcruz. As long as I know it shouldn’t be any different deploying locally than from a CI. In fact there could be more problem on local if you connection is not good enough as I faced before with MUP
.
Anyway, I tried with a better connection and I pushed my app to the server as expected but with same result.
My YAML file is quite similar to the one you posted, the only difference is the deploy command, which on that one is meteor npm run deploy
. I understand it’s running pm2-meteor deploy
through the package.json with that command. Otherwise I don’t understand why he install pm2-meteor on the pipeline.
About you question is answered above.
Hi @orloff.
/.pm2 doesn’t exist on my server, at least not on my /etc folder. But I understand it should be similar to the one posted on this answer, right?
Thanks guys for your help!
I think the deploy is a pain in the $%! and I’m documenting all of this to make this process much easier for everyone including server set up. Hope with all your help this can be accomplished. 