angular-fullstack / generator-angular-fullstack

Yeoman generator for an Angular app with an Express server
https://awk34.gitbook.io/generator-angular-fullstack
6.13k stars 1.24k forks source link

Deploy to Openshift failure #1991

Open romfret opened 8 years ago

romfret commented 8 years ago

I cannot deploy the app on Openshift. Here is the Openshift configuration : node.js 0.10 + MongoDB 2.4. Steps to reproduce are below. I cannot figure out what is wrong.

~ > mkdir myApp
~ > cd myApp
myApp > yo angular-fullstack

Parameters : Babel HTML Sass ngRoute Bootstrap : Yes UI Bootstrap : yes Mongoose Authentication bolierplate : Yes oAuth : Google / Facebook / Twitter Socket.io : Yes Gulp Mocha + Chai + Sinon Expect

myApp > yo angular-fullstack:openshift
myApp > gulp build
myApp > cd ..
~ > mkDir tempDir
~ > cd tempDir

Cloning new Openshift Git : tempDir > git clone ssh://...

Copy and paste "node_modules", ".git" and ".openshift" in "myApp/dist" directory

Pushing new files to Openshift:

myApp/dist > git add .
myApp/dist > git commit -m "first commit"
myApp/dist > git push

Logs of Openshift :

remote: npm info uninstall gulp-sass@2.3.2
remote: npm info postuninstall gulp-sass@2.3.2
remote: npm info preuninstall gulp-node-inspector@0.1.0
remote: npm info uninstall gulp-node-inspector@0.1.0
remote: npm info postuninstall gulp-node-inspector@0.1.0
remote: npm info preuninstall gulp-jscs@3.0.2
remote: npm info uninstall gulp-jscs@3.0.2
remote: npm info postuninstall gulp-jscs@3.0.2
remote: npm ERR! not ok code 0
remote: An error occurred executing 'gear postreceive' (exit code: 47)
remote: Error message: CLIENT_ERROR: Failed to execute: 'control build' for /var/lib/openshift/5766acb92d5271e7b100020e/nodejs
remote: 
remote: For more details about the problem, try running the command again with the '--trace' option.
To ssh://5766acb92d5271e7b100020e@alpha-myapp.rhcloud.com/~/git/alpha.git/
   e260e74..e507168  master -> master

Restart the cartridge in Openshift Web console and check logs :

myApp > rhc tail myapp

Error: Cannot find module 'socket.io'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/var/lib/openshift/5766acb92d5271e7b100020e/app-root/runtime/repo/server/app.js:47:16)
    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 Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:929:3
DEBUG: Program node server/app.js exited with code 8
DEBUG: Starting child process with 'node server/app.js'
module.js:340

Pushing 2 times some new content (a simple space is added to package.json to detect a modification). Logs of last push :

myApp/dist > git push

remote: rsync: mkstemp "/var/lib/openshift/5766acb92d5271e7b100020e/app-deployments/2016-06-19_12-10-45.310/repo/server/.routes.js.RVQvkq" failed: Disk quota exceeded (122)
remote: rsync: mkstemp "/var/lib/openshift/5766acb92d5271e7b100020e/app-deployments/2016-06-19_12-10-45.310/repo/server/.routes.js.map.fBYoXo" failed: Disk quota exceeded (122)
remote: rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1039) [sender=3.0.6]
remote: 
remote: For more details about the problem, try running the command again with the '--trace' option.
To ssh://5766acb92d5271e7b100020e@alpha-myapp.rhcloud.com/~/git/alpha.git/
   47c3ac1..754d48f  master -> master

Is there any great solution tu publish on Openshift please ?

Thank you.

Item Answer
generator-angular-fullstack Trunk of 19/06/2016
Node 0.10
Item Answer
Transpiler Babel
Markup HTML
CSS SCSS
Router ngRoute
Build Tool Gulp
Client Tests Mocha
DB MongoDB
Auth Y
Awk34 commented 8 years ago

We don't really support such old Node versions. Please try upgrading. More info can be found in the openshift subgenerator docs.

Koslun commented 8 years ago

Unless you have some very specific use-case I would also really recommend upgrading MongoDB to 3.0 or 3.2 to use the storage engine wired tiger (default in 3.2).

romfret commented 8 years ago

Solution is :

Awk34 commented 8 years ago

@romfret do we need to add anything to the doc? If so, please make a PR :]

aabm00 commented 8 years ago

@Koslun I am using Openshift but it is stuck in the mongodb version 2.4. I have been watching to update the version to 3.X, but the only way I have found is this custom cartridge: icflorescu/openshift-cartridge-mongodb but I am not sure to use it

Some advise about the way to update MongoDB in openshift to version 3.2?

Thanks

Koslun commented 8 years ago

@aabm00 Sorry, no experience with openshift so have no advice on how to setup openshift. Can only say that I would consider it time well spent to get node 4.X.X and MongoDB 3.X if you are looking to speed up your server or database respectively. While you might also need older versions of libraries to actually get your stack to work.

aabm00 commented 8 years ago

@Koslun Thanks for your answer. Probably you know another hostings providers that gives the posibility to work with node 4.X.X and MongoDB 3.X. I'll apreciate some advises.

Thanks

Koslun commented 8 years ago

Well this generator also supports Heroku. Which does support both node 4.x.x and MongoDB 3.X.X. Can also recommend IBM Bluemix which is based on Cloudfoundry if you want to try to get that setup. Think either could work pretty well, especially if you don't regard yourself as an expert or think you have the time to either become one or get one. However not sure how well they stack up to each other in regards to pricing or features.

Personally use a slightly more advanced setup using VPS with a EC2 instance at AWS, which is similar to what digital ocean offers: https://www.digitalocean.com/pricing/. But though radically cheaper it requires a whole lot more effort to get to an equal footing of either Heroku or IBM Bluemix. Depends a lot on the demands you have on your setup. You can pretty much pay your way to most features with Heroku or IBM Bluemix but probably just as well setup them up locally and on an VPS.

Digender commented 7 years ago

Actually the issue must be with SASS as I guess Openshift does not directly support it. Read theexample from here)

Also node version supported is low on The Mean Cartridge