strongloop / strong-pm

deployer for node applications
http://strong-pm.io
Other
1k stars 71 forks source link

`slc ctl log-dump` crashes pm #207

Closed piscisaureus closed 9 years ago

piscisaureus commented 9 years ago

Sometimes, hit or miss. Trace:

TypeError: Cannot read property 'child' of null
  at Driver.dumpInstanceLog (/home/bert/x/node_modules/strong-pm/lib/drivers/direct/index.js:117:46)
  at Server.dumpInstanceLog (/home/bert/x/node_modules/strong-pm/lib/server.js:186:23)
  at logDump (/home/bert/x/node_modules/strong-pm/lib/ctl.js:142:20)
  at onCtlRequest (/home/bert/x/node_modules/strong-pm/lib/ctl.js:52:13)
  at ServiceManager.prototype.onApiRequest (/home/bert/x/node_modules/strong-pm/lib/service-manager.js:201:16)
  at ServiceManager.prototype.onCtlRequest (/home/bert/x/node_modules/strong-pm/lib/service-manager.js:195:8)
  at processAction (/home/bert/x/node_modules/strong-pm/node_modules/strong-mesh-models/server/models/instance-action.js:37:43)
  at /home/bert/x/node_modules/strong-pm/node_modules/strong-mesh-models/server/models/instance-action.js:22:11
  at /home/bert/x/node_modules/strong-pm/node_modules/strong-mesh-models/node_modules/loopback-datasource-juggler/lib/relation-definition.js:1418:11
  at /home/bert/x/node_modules/strong-pm/node_modules/strong-mesh-models/node_modules/loopback-datasource-juggler/lib/dao.js:1352:5
  at allCb (/home/bert/x/node_modules/strong-pm/node_modules/strong-mesh-models/node_modules/loopback-datasource-juggler/lib/dao.js:1291:7)
  at /home/bert/x/node_modules/strong-pm/node_modules/strong-mesh-models/node_modules/loopback-datasource-juggler/lib/connectors/memory.js:371:7
  at /home/bert/x/node_modules/strong-pm/node_modules/strong-mesh-models/node_modules/loopback/node_modules/continuation-local-storage/node_modules/async-listener/glue.js:188:31
  at /home/bert/x/node_modules/strong-pm/node_modules/strong-mesh-models/node_modules/loopback/node_modules/continuation-local-storage/node_modules/async-listener/glue.js:188:31
  at process._tickDomainCallback (node.js:492:13)
  at process.<anonymous> (/home/bert/x/node_modules/strong-pm/node_modules/strong-mesh-models/node_modules/loopback/node_modules/continuation-local-storage/node_modules/async-listener/index.js:18:15)
rmg commented 9 years ago

Looks like https://github.com/strongloop/strong-pm/commit/fbde6443be400c8ba59d79a150d917a15e1e47fb#diff-b44554d6c8172cb760b6aa6ccb317906R113 has a typo in it.

Should probably be:

var child = current ? !!container.current.child : undefined;

Instead of:

var child = container ? !!container.current.child : undefined;
piscisaureus commented 9 years ago

This was apparently fixed in https://github.com/strongloop/strong-pm/commit/e0a51b7da1a5f8df2c8d0a8b63c7517dcf7ca153