crownstone / crownstone-cloud

Crownstone Cloud Service. Particular parts of Crownstone data (depending on user preferences) can be stored online. This makes it possible to remotely control devices, share your presence with friends, or store energy consumption over time.
https://cloud.crownstone.rocks/
Apache License 2.0
4 stars 6 forks source link

Deployment is failing #3

Closed mrquincle closed 3 years ago

mrquincle commented 7 years ago

There is some dependency problem in strong-mesh-client.

remote: Compressing source files... done.        
remote: Building source:        
remote: 
remote: -----> Node.js app detected        
remote: -----> Requested node range:  6.6.0        
remote: -----> Resolved node version: 6.6.0        
remote: -----> Downloading and installing node        
remote: -----> Restoring node_modules from cache        
remote: -----> Installing StrongLoop dependencies        
remote: /tmp/build_52f4194afa13e6b7a077196a18992790/vendor/node/bin/slc -> /tmp/build_52f4194afa13e6b7a077196a18992790/vendor/node/lib/node_modules/strongloop/bin/slc.js        
remote: /tmp/build_52f4194afa13e6b7a077196a18992790/vendor/node/bin/lb-ng -> /tmp/build_52f4194afa13e6b7a077196a18992790/vendor/node/lib/node_modules/strongloop/node_modules/loopback-sdk-angular-cli/bin/lb-ng.js        
remote: 
remote: > heapdump@0.3.7 install /tmp/build_52f4194afa13e6b7a077196a18992790/vendor/node/lib/node_modules/strongloop/node_modules/heapdump        
remote: > node-gyp rebuild        
remote: 
remote: make: Entering directory `/tmp/build_52f4194afa13e6b7a077196a18992790/vendor/node/lib/node_modules/strongloop/node_modules/heapdump/build'        
remote:   CXX(target) Release/obj.target/addon/src/heapdump.o        
remote:   SOLINK_MODULE(target) Release/obj.target/addon.node        
remote:   COPY Release/addon.node        
remote: make: Leaving directory `/tmp/build_52f4194afa13e6b7a077196a18992790/vendor/node/lib/node_modules/strongloop/node_modules/heapdump/build'        
remote: 
remote: > modern-syslog@1.1.4 install /tmp/build_52f4194afa13e6b7a077196a18992790/vendor/node/lib/node_modules/strongloop/node_modules/modern-syslog        
remote: > node-gyp rebuild        
remote: 
remote: make: Entering directory `/tmp/build_52f4194afa13e6b7a077196a18992790/vendor/node/lib/node_modules/strongloop/node_modules/modern-syslog/build'        
remote:   CXX(target) Release/obj.target/core/core.o        
remote:   SOLINK_MODULE(target) Release/obj.target/core.node        
remote:   COPY Release/core.node        
remote: make: Leaving directory `/tmp/build_52f4194afa13e6b7a077196a18992790/vendor/node/lib/node_modules/strongloop/node_modules/modern-syslog/build'        
remote: 
remote: > sqlite3@3.1.4 install /tmp/build_52f4194afa13e6b7a077196a18992790/vendor/node/lib/node_modules/strongloop/node_modules/sqlite3        
remote: > node-pre-gyp install --fallback-to-build        
remote: 
remote: [sqlite3] Success: "/tmp/build_52f4194afa13e6b7a077196a18992790/vendor/node/lib/node_modules/strongloop/node_modules/sqlite3/lib/binding/node-v48-linux-x64/node_sqlite3.node" is installed via remote        
remote: 
remote: > strong-agent@2.1.2 install /tmp/build_52f4194afa13e6b7a077196a18992790/vendor/node/lib/node_modules/strongloop/node_modules/strong-agent        
remote: > node-gyp rebuild || exit 0        
remote: 
remote: make: Entering directory `/tmp/build_52f4194afa13e6b7a077196a18992790/vendor/node/lib/node_modules/strongloop/node_modules/strong-agent/build'        
remote:   CXX(target) Release/obj.target/strong-agent/src/strong-agent.o        
remote:   SOLINK_MODULE(target) Release/obj.target/strong-agent.node        
remote:   COPY Release/strong-agent.node        
remote: make: Leaving directory `/tmp/build_52f4194afa13e6b7a077196a18992790/vendor/node/lib/node_modules/strongloop/node_modules/strong-agent/build'        
remote: 
remote: > ws@0.4.32 install /tmp/build_52f4194afa13e6b7a077196a18992790/vendor/node/lib/node_modules/strongloop/node_modules/node-inspector/node_modules/ws        
remote: > (node-gyp rebuild 2> builderror.log) || (exit 0)        
remote: 
remote: make: Entering directory `/tmp/build_52f4194afa13e6b7a077196a18992790/vendor/node/lib/node_modules/strongloop/node_modules/node-inspector/node_modules/ws/build'        
remote:   CXX(target) Release/obj.target/bufferutil/src/bufferutil.o        
remote: make: Leaving directory `/tmp/build_52f4194afa13e6b7a077196a18992790/vendor/node/lib/node_modules/strongloop/node_modules/node-inspector/node_modules/ws/build'        
remote: 
remote: > utf-8-validate@1.2.2 install /tmp/build_52f4194afa13e6b7a077196a18992790/vendor/node/lib/node_modules/strongloop/node_modules/utf-8-validate        
remote: > node-gyp rebuild        
remote: 
remote: make: Entering directory `/tmp/build_52f4194afa13e6b7a077196a18992790/vendor/node/lib/node_modules/strongloop/node_modules/utf-8-validate/build'        
remote:   CXX(target) Release/obj.target/validation/src/validation.o        
remote:   SOLINK_MODULE(target) Release/obj.target/validation.node        
remote:   COPY Release/validation.node        
remote: make: Leaving directory `/tmp/build_52f4194afa13e6b7a077196a18992790/vendor/node/lib/node_modules/strongloop/node_modules/utf-8-validate/build'        
remote: 
remote: > bufferutil@1.2.1 install /tmp/build_52f4194afa13e6b7a077196a18992790/vendor/node/lib/node_modules/strongloop/node_modules/ws/node_modules/bufferutil        
remote: > node-gyp rebuild        
remote: 
remote: make: Entering directory `/tmp/build_52f4194afa13e6b7a077196a18992790/vendor/node/lib/node_modules/strongloop/node_modules/ws/node_modules/bufferutil/build'        
remote:   CXX(target) Release/obj.target/bufferutil/src/bufferutil.o        
remote:   SOLINK_MODULE(target) Release/obj.target/bufferutil.node        
remote:   COPY Release/bufferutil.node        
remote: make: Leaving directory `/tmp/build_52f4194afa13e6b7a077196a18992790/vendor/node/lib/node_modules/strongloop/node_modules/ws/node_modules/bufferutil/build'        
remote: 
remote: > strong-mesh-client@1.6.3 install /tmp/build_52f4194afa13e6b7a077196a18992790/vendor/node/lib/node_modules/strongloop/node_modules/strong-mesh-client        
remote: > node proxy/build-client.js        
remote: 
remote: unable to generate browser bundle: Cannot find module 'regenerator' from '/tmp/build_52f4194afa13e6b7a077196a18992790/vendor/node/lib/node_modules/strongloop/node_modules/ajv/lib'        
remote: /tmp/build_52f4194afa13e6b7a077196a18992790/vendor/node/lib        
remote: └── (empty)        
remote: 
remote: npm ERR! Linux 3.13.0-110-generic        
remote: npm ERR! argv "/tmp/build_52f4194afa13e6b7a077196a18992790/vendor/node/bin/node" "/tmp/build_52f4194afa13e6b7a077196a18992790/vendor/node/bin/npm" "install" "-g" "strongloop"        
remote: npm ERR! node v6.6.0        
remote: npm ERR! npm  v3.10.3        
remote: npm ERR! code ELIFECYCLE        
remote: 
remote: npm ERR! strong-mesh-client@1.6.3 install: `node proxy/build-client.js`        
remote: npm ERR! Exit status 1        
remote: npm ERR!         
remote: npm ERR! Failed at the strong-mesh-client@1.6.3 install script 'node proxy/build-client.js'.        
remote: npm ERR! Make sure you have the latest version of node.js and npm installed.        
remote: npm ERR! If you do, this is most likely a problem with the strong-mesh-client package,        
remote: npm ERR! not with npm itself.        
remote: npm ERR! Tell the author that this fails on your system:        
remote: npm ERR!     node proxy/build-client.js        
remote: npm ERR! You can get information on how to open an issue for this project with:        
remote: npm ERR!     npm bugs strong-mesh-client        
remote: npm ERR! Or if that isn't available, you can get their info via:        
remote: npm ERR!     npm owner ls strong-mesh-client        
remote: npm ERR! There is likely additional logging output above.     
AlexDM0 commented 7 years ago

Is this with the version that is currently in master?

mrquincle commented 7 years ago

Yes, and it wasn't the case yesterday.

And we're not the only one: https://github.com/strongloop/strong-mesh-client/issues/53

mrquincle commented 7 years ago

Locally I'm using nvm to reproduce the same problem.

nvm install 6.6.0
nvm use 6.6.0
npm install -g strongloop

The dependencies it complains about: js-beautify, nodent, regenerator. All accidentally in ajv, but only in devDependencies which don't seem to come through if used as part of package.json.

mrquincle commented 7 years ago

Feel free to reproduce by this simple package.json file:

{                                                                                                                       
  "name": "Test",                                                                                                       
  "version": "1.1.0",                                                                                                   
  "main": "server/server.js",                                                                                           
  "license": "(LGPL-3.0 OR Apache-2.0 OR MIT)",                                                                         
  "dependencies": {                                                                                                     
    "strong-mesh-client": "*"                                                                                           
  },                                                                                                                    
  "devDependencies": {                                                                                                  
  },                                                                                                                    
  "repository": {                                                                                                       
    "type": "",                                                                                                         
    "url": ""                                                                                                           
  },                                                                                                                    
  "description": "Crownstone",                                                                                          
  "engines": {                                                                                                          
    "node": "6.6.0"                                                                                                     
  }                                                                                                                     
} 

I still haven't found the right tool to quickly get the dependencies out. npm ls shows only local dependencies. How do I quickly trace why strong-mesh-client is included in the first place?

AlexDM0 commented 7 years ago

It is included because in the heroku settings it is listed as a build package. That triggers an npm install -g strongloop which i find really scary since any update to strongloop would be automatically included.

AlexDM0 commented 7 years ago

By the way, this is why we would like to use yarn. Exactly to avoid this.

mrquincle commented 7 years ago

Do we actually use any strongloop functionality? Maybe loopback will be sufficient. Currently the build is failing (https://github.com/strongloop/strong-mesh-client/issues/53) because of some dependencies on strong-mesh-client, namely js-beautify, nodent, and regenerator that are pulled in through ajv.

If we e.g. only want the cluster and restart functionality it should be enough to add strong-supervisor as a dep (http://stackoverflow.com/questions/32150014/how-to-use-strongloop-pm-on-heroku-for-loopback-based-nodejs-applications) and remove the buildpack at https://dashboard.heroku.com/apps/crownstone-cloud/settings, and have web: ./node_modules/.bin/sl-run server/server.js rather than web: slc run in Procfile.

mrquincle commented 7 years ago

I haven't done it yet, because I assume removing the buildpack will apply to both development and production.

AlexDM0 commented 7 years ago

I tend to agree, though I'm not that up to speed with the cloud processes. I'd prefer everything we use to be in package.json to avoid things like this.

Given that everything runs locally without the strongloop cli I don't think its mission critical.

The buildpack is individually configured per heroku app, dev and production are different apps (in different groups).

mrquincle commented 7 years ago

Okay, done for development. Deployment is now much faster. :-)

AlexDM0 commented 7 years ago

Cool :) we'll need to see what exactly is missing now. It could be that the packages that are running on production require it still.