strongloop-archive / strong-gateway

DEPRECATED | Our new gateway product is available at https://github.com/strongloop/microgateway.
Other
112 stars 46 forks source link

cannot run strong-gateway #42

Closed altsang closed 9 years ago

altsang commented 9 years ago
  1. cloned strong-gateway
  2. npm install
  3. slc arc
  4. create a new pipeline
  5. add default rate limit policy to pipeline
  6. slc run in strong-gateway
Belldandy:strong-gateway altsang$ slc run
INFO strong-agent v2.0.14 profiling app 'strong-gateway' pid '43065'
INFO strong-agent[43065] started profiling agent
INFO supervisor reporting metrics to `internal:`
supervisor running without clustering (unsupervised)

/Users/altsang/Dropbox/workspace/strong-gateway/server/policy-middleware.js:77
    entries.forEach(registerMiddleware);
            ^
TypeError: Cannot call method 'forEach' of null
    at transpilePoliciesToMiddleware (/Users/altsang/Dropbox/workspace/strong-gateway/server/policy-middleware.js:77:13)
    at Object.<anonymous> (/Users/altsang/Dropbox/workspace/strong-gateway/server/middleware.local.js:4:54)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at Module.module.__proto__.require (/Users/altsang/.nvm/v0.10.35/lib/node_modules/strongloop/node_modules/strong-supervisor/node_modules/strong-agent/lib/agent.js:183:42)
    at require (module.js:380:17)
    at /Users/altsang/Dropbox/workspace/strong-gateway/node_modules/loopback-boot/lib/config-loader.js:120:18

another error trying from fresh cloned repo..

Belldandy:strong-gateway altsang$ slc run
INFO strong-agent v2.0.14 profiling app 'strong-gateway' pid '43170'
INFO strong-agent[43170] started profiling agent
INFO supervisor reporting metrics to `internal:`
supervisor running without clustering (unsupervised)

/Users/altsang/Dropbox/workspace/strong-gateway/node_modules/loopback-boot/lib/config-loader.js:173
      throw new Error('Cannot apply ' + fileName + ': ' + err);
            ^
Error: Cannot apply /Users/altsang/Dropbox/workspace/strong-gateway/server/middleware.local.js: The middleware "strong-express-metrics" in phase "initial:before"is not defined in the main config.
    at mergeMiddlewareConfig (/Users/altsang/Dropbox/workspace/strong-gateway/node_modules/loopback-boot/lib/config-loader.js:173:13)
    at mergeConfigurations (/Users/altsang/Dropbox/workspace/strong-gateway/node_modules/loopback-boot/lib/config-loader.js:138:5)
    at loadNamed (/Users/altsang/Dropbox/workspace/strong-gateway/node_modules/loopback-boot/lib/config-loader.js:76:16)
    at Object.ConfigLoader.loadMiddleware (/Users/altsang/Dropbox/workspace/strong-gateway/node_modules/loopback-boot/lib/config-loader.js:46:10)
    at compile (/Users/altsang/Dropbox/workspace/strong-gateway/node_modules/loopback-boot/lib/compiler.js:54:18)
    at bootLoopBackApp (/Users/altsang/Dropbox/workspace/strong-gateway/node_modules/loopback-boot/index.js:139:22)
    at Object.<anonymous> (/Users/altsang/Dropbox/workspace/strong-gateway/server/server.js:17:1)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
sidewaiise commented 8 years ago

Was this issue resolved? Seems I'm getting a similar error:

The middleware "./middleware/tlsredirect" in phase "initial:before"is not defined in the main config.

I am trying to call middleware 'tlsredirect.js' while in production environment only. This error causes my server to crash and not deploy.

I also note that in the documentation, there is no reference to middleware.production.json, but for every other config file there is a comparison between master config file and environment-specific config file. (https://docs.strongloop.com/display/public/LB/Environment-specific+configuration)

Any help would be appreciated.

Thanks.

vanthome commented 8 years ago

@sidewaiise having the same issue. Could you resolve it?