opencomponents / get-started

🔰 ⚡️ 👟 Get started with OpenComponents in 3 simple steps
MIT License
46 stars 7 forks source link

Registry not started #16

Closed vukhanhtruong closed 5 years ago

vukhanhtruong commented 5 years ago

When deploying the OpenComponents registry to Heroku, and it says: "Registry not started: components_list_save". Here is the logs at Heroku

2019-01-16T05:37:44.141062+00:00 heroku[web.1]: Starting process with command `npm start`
2019-01-16T05:37:47.471755+00:00 app[web.1]: 
2019-01-16T05:37:47.471775+00:00 app[web.1]: > opencomponents-starter-kit@1.0.0 start /app
2019-01-16T05:37:47.471777+00:00 app[web.1]: > node server.js
2019-01-16T05:37:47.471778+00:00 app[web.1]: 
2019-01-16T05:37:52.976155+00:00 app[web.1]: Registry not started:  components_list_save
2019-01-16T05:37:53.012304+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2019-01-16T05:37:53.012937+00:00 app[web.1]: npm ERR! errno 1
2019-01-16T05:37:53.014596+00:00 app[web.1]: npm ERR! opencomponents-starter-kit@1.0.0 start: `node server.js`
2019-01-16T05:37:53.014830+00:00 app[web.1]: npm ERR! Exit status 1
2019-01-16T05:37:53.015189+00:00 app[web.1]: npm ERR! 
2019-01-16T05:37:53.015439+00:00 app[web.1]: npm ERR! Failed at the opencomponents-starter-kit@1.0.0 start script.
2019-01-16T05:37:53.015721+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-01-16T05:37:53.050018+00:00 app[web.1]: 
2019-01-16T05:37:53.055734+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2019-01-16T05:37:53.055968+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2019-01-16T05_37_53_017Z-debug.log
2019-01-16T05:37:53.171496+00:00 heroku[web.1]: State changed from starting to crashed
2019-01-16T05:37:53.150846+00:00 heroku[web.1]: Process exited with status 1

I switched to Now, and still no luck. This is the logs at Now:

01/16 12:00 PM (2h)
Emitting directory /tmp/3bff81f5/user/node_modules/oc/src/components/oc-client/_package as _package
01/16 12:00 PM (2h)
ncc: Module directory "/tmp/3bff81f5/user/node_modules/chokidar/lib" attempted to require "fsevents" but could not be resolved, assuming external.
01/16 12:00 PM (2h)
ncc: Module directory "/tmp/3bff81f5/user/node_modules/ws/lib" attempted to require "bufferutil" but could not be resolved, assuming external.
01/16 12:00 PM (2h)
ncc: Module directory "/tmp/3bff81f5/user/node_modules/ws/lib" attempted to require "utf-8-validate" but could not be resolved, assuming external.
01/16 12:00 PM (2h)
patching https://api-sfo1.zeit.co/v2/now/deployments/dpl_LmhovZVJEp6EVFfACphtHL55use1/builds/bld_4q5s2xrf7 with {"readyState":"ERROR","errorCode":"BUILD_FAILED_2"}
01/16 12:00 PM (2h)
{ Error: Hash: b98f21caa5925cbfc3e9
Version: webpack 4.27.0
Time: 14061ms
Built at: 2019-01-16 05:00:46
                Asset       Size  Chunks  Chunk Names
_package/package.json  688 bytes          
   _package/server.js   1.08 KiB          
 _package/template.js   1.38 KiB          
           error.html  276 bytes          
             index.js   8.48 MiB       0  main
    oc-client.min.map   13.2 KiB          
         package.json   3.22 KiB          
            style.css  602 bytes          
             xdg-open   25.2 KiB          
Entrypoint main = index.js
   [2] external "path" 42 bytes {0} [built]
   [3] /tmp/3bff81f5/user/node_modules/lodash/lodash.js 527 KiB {0} [built]
   [5] external "fs" 42 bytes {0} [built]
  [19] /tmp/3bff81f5/user/node_modules/async/dist/async.js 181 KiB {0} [built]
  [27] external "http" 42 bytes {0} [built]
  [55] /tmp/3bff81f5/user/node_modules/oc/src/registry/domain/validators/index.js 1.14 KiB {0} [built]
  [64] /tmp/3bff81f5/user/node_modules/colors/safe.js 248 bytes {0} [built]
  [77] /tmp/3bff81f5/user/node_modules/oc/src/registry/domain/events-handler.js 659 bytes {0} [built]
 [151] /tmp/3bff81f5/user/node_modules/oc/src/index.js 166 bytes {0} [built]
 [270] /tmp/3bff81f5/user/node_modules/oc-client/index.js 35 bytes {0} [built]
 [326] /tmp/3bff81f5/user/server.js 1.09 KiB {0} [built]
 [327] /tmp/3bff81f5/user/node_modules/dotenv/lib/main.js 2.63 KiB {0} [built]
 [328] /tmp/3bff81f5/user/node_modules/oc/src/cli/programmatic-api.js 896 bytes {0} [built]
 [329] /tmp/3bff81f5/user/node_modules/oc/src/cli/domain/local.js 2.04 KiB {0} [built]
[1328] /tmp/3bff81f5/user/node_modules/oc/src/registry/index.js 2.93 KiB {0} [built]
    + 1509 hidden modules

WARNING in /tmp/3bff81f5/user/node_modules/handlebars/node_modules/source-map/lib/source-map/source-map-consumer.js 8:45-52
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
 @ /tmp/3bff81f5/user/node_modules/handlebars/node_modules/source-map/lib/source-map.js
 @ /tmp/3bff81f5/user/node_modules/handlebars/dist/cjs/handlebars/compiler/code-gen.js
 @ /tmp/3bff81f5/user/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js
 @ /tmp/3bff81f5/user/node_modules/handlebars/dist/cjs/handlebars.js
 @ /tmp/3bff81f5/user/node_modules/handlebars/lib/index.js
 @ /tmp/3bff81f5/user/node_modules/oc-template-handlebars/lib/render.js
 @ /tmp/3bff81f5/user/node_modules/oc-template-handlebars/index.js
 @ /tmp/3bff81f5/user/node_modules/oc-client/src/sanitiser.js
 @ /tmp/3bff81f5/user/node_modules/oc-client/src/components-renderer.js
 @ /tmp/3bff81f5/user/node_modules/oc-client/src/index.js
 @ /tmp/3bff81f5/user/node_modules/oc-client/index.js
 @ /tmp/3bff81f5/user/node_modules/oc/src/index.js
 @ /tmp/3bff81f5/user/server.js

WARNING in /tmp/3bff81f5/user/node_modules/handlebars/node_modules/source-map/lib/source-map/source-node.js 8:45-52
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
 @ /tmp/3bff81f5/user/node_modules/handlebars/node_modules/source-map/lib/source-map.js
 @ /tmp/3bff81f5/user/node_modules/handlebars/dist/cjs/handlebars/compiler/code-gen.js
 @ /tmp/3bff81f5/user/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js
 @ /tmp/3bff81f5/user/node_modules/handlebars/dist/cjs/handlebars.js
 @ /tmp/3bff81f5/user/node_modules/handlebars/lib/index.js
 @ /tmp/3bff81f5/user/node_modules/oc-template-handlebars/lib/render.js
 @ /tmp/3bff81f5/user/node_modules/oc-template-handlebars/index.js
 @ /tmp/3bff81f5/user/node_modules/oc-client/src/sanitiser.js
 @ /tmp/3bff81f5/user/node_modules/oc-client/src/components-renderer.js
 @ /tmp/3bff81f5/user/node_modules/oc-client/src/index.js
 @ /tmp/3bff81f5/user/node_modules/oc-client/index.js
 @ /tmp/3bff81f5/user/node_modules/oc/src/index.js
 @ /tmp/3bff81f5/user/server.js

WARNING in /tmp/3bff81f5/user/node_modules/handlebars/node_modules/source-map/lib/source-map/source-map-generator.js 8:45-52
Critical dependency: require function is used in a

Please help me out. Thank you very much.

matteofigus commented 5 years ago

Hi @vukhanhtruong - it sounds like a storage adapter issue (the list of the components can't be fetched). If you are using S3, can you check the IAM policy has list, read and write access?

samzhao commented 5 years ago

I run into the same issue. I think @matteofigus is right. If you wanna see the exact error you get, you can go into your node_modules, find the file under oc/src/registry/domain/components-cache/index.js and add a console.log(saveErr) above line 68. After that you can just do npm start locally to see the actual error.

Edit: here's the link to the file for reference: https://github.com/opencomponents/oc/blob/bd5bc06b4c42a9588177f92ced1ab5f1084a1189/src/registry/domain/components-cache/index.js#L68

vukhanhtruong commented 5 years ago

Thanks guys.