generator-angular-fullstack icon indicating copy to clipboard operation
generator-angular-fullstack copied to clipboard

Deploy to Openshift failure

Open romfret opened this issue 10 years ago • 9 comments

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 [email protected]
remote: npm info postuninstall [email protected]
remote: npm info preuninstall [email protected]
remote: npm info uninstall [email protected]
remote: npm info postuninstall [email protected]
remote: npm info preuninstall [email protected]
remote: npm info uninstall [email protected]
remote: npm info postuninstall [email protected]
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://[email protected]/~/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://[email protected]/~/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

romfret avatar Jun 19 '16 16:06 romfret

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

Awk34 avatar Jun 20 '16 03:06 Awk34

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).

Koslun avatar Jun 20 '16 11:06 Koslun

Solution is :

  • upgrade Node.js
  • execute rhc set-env NODE_ENV=production --app myapp

romfret avatar Jun 20 '16 17:06 romfret

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

Awk34 avatar Jun 20 '16 17:06 Awk34

@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

aabm00 avatar Jun 28 '16 20:06 aabm00

@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.

Koslun avatar Jun 28 '16 22:06 Koslun

@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

aabm00 avatar Jun 29 '16 04:06 aabm00

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.

Koslun avatar Jun 30 '16 11:06 Koslun

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

Digender avatar Nov 29 '16 19:11 Digender