[SOLVED] Not starting cartridge nodejs because hot deploy is enabled
Hello
I have created an application through the Yeoman generator Angular-fullstack.
I have followed the steps here to update the node version from 0.10.25 to 0.12.4 and pushed the application to Openshift and get this log:
D:\003_IOT\WS_IOT\iotfs>grunt buildcontrol:openshift
Running "buildcontrol:openshift" (buildcontrol) task
Committing changes to master.
warning: LF will be replaced by CRLF in server/config/environment/production.js.
The file will have its original line endings in your working directory.
[master 99a0ace] Built iotfs from commit (unavailable) on branch (unavailable)
1 file changed, 2 insertions(+)
warning: LF will be replaced by CRLF in server/config/environment/production.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in server/config/environment/production.js.
The file will have its original line endings in your working directory.
Pushing master to openshift
remote: Not stopping cartridge nodejs because hot deploy is enabled
remote: Syncing git content to other proxy gears
remote: Saving away previously installed Node modules
remote: Building git ref 'master', commit 99a0ace
remote:
remote: - Checking to see if Node.js version 0.12.4 is installed ...
remote: - Downloading and extracting http://nodejs.org/dist/v0.12.4 /node-v0.12.4 -linux-x64.tar.g
z ...
remote: % Total % Received % Xferd Average Speed Time Time Time Current
remote: Dload Upload Total Spent Left Speed
remote:
remote: 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
remote: 162 162 162 162 0 0 41012 0 --:--:-- --:--:-- --:--:-- 158k
remote:
remote: gzip: stdin: not in gzip format
remote: tar: Child returned status 1
remote: tar: Error is not recoverable: exiting now
remote: - Done installing Node.js version 0.12.4
remote: Building NodeJS cartridge
remote: - PATH set to include custom node version (0.12.4 ) from
remote: /var/lib/openshift/5586ae7ee0b8cd444a000118/app-root/data//node-v0.12.4-linux-x64/bin
remote: PATH = /var/lib/openshift/5586ae7ee0b8cd444a000118/app-root/data//node-v0.12.4-linux-x64
/bin:/var/lib/openshift/5586ae7ee0b8cd444a000118/app-root/runtime/repo/node_modules/.bin:/var/lib/op
enshift/5586ae7ee0b8cd444a000118//.node_modules/.bin:/opt/rh/nodejs010/root/usr/bin:/var/lib/openshi
ft/5586ae7ee0b8cd444a000118/haproxy/usr/bin:/opt/rh/mongodb24/root/usr/bin:/bin:/usr/bin:/usr/sbin
remote: - Installing dependencies w/ new version of npm ...
remote:
remote: npm info it worked if it ends with ok
remote: npm info using [email protected]
remote: npm info using [email protected]
remote: npm info preinstall [email protected]
remote: npm WARN package.json [email protected] No description
remote: npm info addNameTag [ 'passport-facebook', 'latest' ]
remote: npm info addNameTag [ 'passport-twitter', 'latest' ]
remote: npm info addNameTag [ 'passport-google-oauth', 'latest' ]
remote: npm info trying registry request attempt 1 at 11:24:53
remote: npm http GET https://registry.npmjs.org/passport-twitter
remote: npm info trying registry request attempt 1 at 11:24:53
remote: npm http GET https://registry.npmjs.org/passport-facebook
remote: npm info trying registry request attempt 1 at 11:24:53
remote: npm http GET https://registry.npmjs.org/passport-google-oauth
remote: npm http 304 https://registry.npmjs.org/passport-facebook
remote: npm http 304 https://registry.npmjs.org/passport-google-oauth
remote: npm info already installed [email protected]
remote: npm info already installed [email protected]
remote: npm http 304 https://registry.npmjs.org/passport-twitter
remote: npm info already installed [email protected]
remote: npm info build /var/lib/openshift/5586ae7ee0b8cd444a000118/app-root/runtime/repo
remote: npm info linkStuff [email protected]
remote: npm info install [email protected]
remote: npm info postinstall [email protected]
remote: npm info prepublish [email protected]
remote: npm info ok
remote: Preparing build for deployment
remote: Deployment id is 8d8c521b
remote: Activating deployment
remote: Not starting cartridge haproxy because hot deploy is enabled
remote: - Checking to see if Node.js version 0.12.4 is installed ...
remote: - Downloading and extracting http://nodejs.org/dist/v0.12.4 /node-v0.12.4 -linux-x64.tar.g
z ...
remote: % Total % Received % Xferd Average Speed Time Time Time Current
remote: Dload Upload Total Spent Left Speed
remote:
remote: 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
remote: 162 162 162 162 0 0 979 0 --:--:-- --:--:-- --:--:-- 1006
remote:
remote: gzip: stdin: not in gzip format
remote: tar: Child returned status 1
remote: tar: Error is not recoverable: exiting now
remote: - Done installing Node.js version 0.12.4
remote: Not starting cartridge nodejs because hot deploy is enabled
remote: -------------------------
remote: Git Post-Receive Result: success
remote: Activation status: success
remote: Deployment completed with status: success
To ssh://[email protected]/~/git/iotfs.git/
2e886f0..99a0ace master -> master
Done, without errors.
Execution Time (2015-06-22 15:24:29 UTC)
buildcontrol:openshift 37.4s ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 100%
Total 37.6s
It looks like the node cartridge has been deployed but not started because of hot deploy is enabled.
How can I made the node cartridge to start?
thanks
Hi
I have disabled the hot deploy, deleting this file .openshift/makers/hot_deploy
The log resulting is this:
D:\003_IOT\WS_IOT\iotfs>grunt buildcontrol:openshift
Running "buildcontrol:openshift" (buildcontrol) task
Committing changes to master.
[master c70cc96] Built iotfs from commit (unavailable) on branch (unavailable)
1 file changed, 0 insertions(+), 0 deletions(-)
delete mode 100644 .openshift/markers/hot_deploy
Pushing master to openshift
remote:
remote: - pre_stop_nodejs: Adding Node.js version 0.12.4 binaries to path
remote: - PATH set to include custom node version (0.12.4 ) from
remote: /var/lib/openshift/5586ae7ee0b8cd444a000118/app-root/data//node-v0.12.4-linux-x64/bin
remote: PATH = /var/lib/openshift/5586ae7ee0b8cd444a000118/app-root/data//node-v0.12.4-linux-x64
/bin:/var/lib/openshift/5586ae7ee0b8cd444a000118/app-root/runtime/repo/node_modules/.bin:/var/lib/op
enshift/5586ae7ee0b8cd444a000118//.node_modules/.bin:/opt/rh/nodejs010/root/usr/bin:/var/lib/openshi
ft/5586ae7ee0b8cd444a000118/haproxy/usr/bin:/opt/rh/mongodb24/root/usr/bin:/bin:/usr/bin:/usr/sbin
remote: Stopping NodeJS cartridge
remote: Thu Jun 25 2015 07:00:55 GMT-0400 (EDT): Stopping application 'iotfs' ...
remote: Thu Jun 25 2015 07:00:56 GMT-0400 (EDT): Stopped Node application 'iotfs'
remote: Syncing git content to other proxy gears
remote: Saving away previously installed Node modules
remote: Building git ref 'master', commit c70cc96
remote:
remote: - Checking to see if Node.js version 0.12.4 is installed ...
remote: - Downloading and extracting http://nodejs.org/dist/v0.12.4 /node-v0.12.4 -linux-x64.tar.g
z ...
remote: % Total % Received % Xferd Average Speed Time Time Time Current
remote: Dload Upload Total Spent Left Speed
remote:
remote: 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
remote: 162 162 162 162 0 0 17631 0 --:--:-- --:--:-- --:--:-- 81000
remote:
remote: gzip: stdin: not in gzip format
remote: tar: Child returned status 1
remote: tar: Error is not recoverable: exiting now
remote: - Done installing Node.js version 0.12.4
remote: Building NodeJS cartridge
remote: - PATH set to include custom node version (0.12.4 ) from
remote: /var/lib/openshift/5586ae7ee0b8cd444a000118/app-root/data//node-v0.12.4-linux-x64/bin
remote: PATH = /var/lib/openshift/5586ae7ee0b8cd444a000118/app-root/data//node-v0.12.4-linux-x64
/bin:/var/lib/openshift/5586ae7ee0b8cd444a000118/app-root/runtime/repo/node_modules/.bin:/var/lib/op
enshift/5586ae7ee0b8cd444a000118//.node_modules/.bin:/opt/rh/nodejs010/root/usr/bin:/var/lib/openshi
ft/5586ae7ee0b8cd444a000118/haproxy/usr/bin:/opt/rh/mongodb24/root/usr/bin:/bin:/usr/bin:/usr/sbin
remote: - Installing dependencies w/ new version of npm ...
remote:
remote: npm info it worked if it ends with ok
remote: npm info using [email protected]
remote: npm info using [email protected]
remote: npm info preinstall [email protected]
remote: npm WARN package.json [email protected] No description
remote: npm info addNameTag [ 'passport-facebook', 'latest' ]
remote: npm info addNameTag [ 'passport-google-oauth', 'latest' ]
remote: npm info addNameTag [ 'passport-twitter', 'latest' ]
remote: npm info trying registry request attempt 1 at 07:01:12
remote: npm http GET https://registry.npmjs.org/passport-facebook
remote: npm info trying registry request attempt 1 at 07:01:12
remote: npm http GET https://registry.npmjs.org/passport-twitter
remote: npm info trying registry request attempt 1 at 07:01:12
remote: npm http GET https://registry.npmjs.org/passport-google-oauth
remote: npm http 304 https://registry.npmjs.org/passport-twitter
remote: npm http 304 https://registry.npmjs.org/passport-facebook
remote: npm http 304 https://registry.npmjs.org/passport-google-oauth
remote: npm info already installed [email protected]
remote: npm info already installed [email protected]
remote: npm info already installed [email protected]
remote: npm info build /var/lib/openshift/5586ae7ee0b8cd444a000118/app-root/runtime/repo
remote: npm info linkStuff [email protected]
remote: npm info install [email protected]
remote: npm info postinstall [email protected]
remote: npm info prepublish [email protected]
remote: npm info ok
remote: Preparing build for deployment
remote: Deployment id is de5114cc
remote: Activating deployment
remote: HAProxy already running
remote: HAProxy instance is started
remote: - Checking to see if Node.js version 0.12.4 is installed ...
remote: - Downloading and extracting http://nodejs.org/dist/v0.12.4 /node-v0.12.4 -linux-x64.tar.g
z ...
remote: % Total % Received % Xferd Average Speed Time Time Time Current
remote: Dload Upload Total Spent Left Speed
remote:
remote: 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
remote: 162 162 162 162 0 0 6328 0 --:--:-- --:--:-- --:--:-- 7363
remote:
remote: gzip: stdin: not in gzip format
remote: tar: Child returned status 1
remote: tar: Error is not recoverable: exiting now
remote: - Done installing Node.js version 0.12.4
remote:
remote: - pre_start_nodejs: Adding Node.js version 0.12.4 binaries to path
remote: - PATH set to include custom node version (0.12.4 ) from
remote: /var/lib/openshift/5586ae7ee0b8cd444a000118/app-root/data//node-v0.12.4-linux-x64/bin
remote: PATH = /var/lib/openshift/5586ae7ee0b8cd444a000118/app-root/data//node-v0.12.4-linux-x64
/bin:/var/lib/openshift/5586ae7ee0b8cd444a000118/app-root/runtime/repo/node_modules/.bin:/var/lib/op
enshift/5586ae7ee0b8cd444a000118//.node_modules/.bin:/opt/rh/nodejs010/root/usr/bin:/var/lib/openshi
ft/5586ae7ee0b8cd444a000118/haproxy/usr/bin:/opt/rh/mongodb24/root/usr/bin:/bin:/usr/bin:/usr/sbin
remote: Starting NodeJS cartridge
remote: Thu Jun 25 2015 07:01:27 GMT-0400 (EDT): Starting application 'iotfs' ...
remote: -------------------------
remote: Git Post-Receive Result: success
remote: Activation status: success
remote: Deployment completed with status: success
To ssh://[email protected]/~/git/iotfs.git/
99a0ace..c70cc96 master -> master
Done, without errors.
Execution Time (2015-06-25 11:00:37 UTC)
buildcontrol:openshift 58.7s ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 100%
Total 58.9s
This time it looks that the node cartridge has been started but when I check the node version I get it is 0.10.25 and not 0.12.4
To get the version I did by SSH
[iotfs-onfoco.rhcloud.com 5586ae7ee0b8cd786a000118]\> node -v
v0.10.25
And in the /env
Version: v0.10.25
Env: {
OPENSHIFT_HAPROXY_PORT: 8080
MANPATH: /opt/rh/nodejs010/root/usr/share/man:/opt/rh/v8314/root/usr/share/man::
OPENSHIFT_SECRET_TOKEN: t9ZOaAGjv0fO5ISI34xvd9BJCkxRHgEDeoNKpdRHf47oeUwnDp3t64idtEFYjK-xle-trCMPfzumyz3PvnYxOGTN4g2hm4XXXXXXXXXXXXXXXXXXXXXXXXXXXXXp
OPENSHIFT_HAPROXY_DIR: /var/lib/openshift/5586ae7ee0b8cd444a145218/haproxy/
OPENSHIFT_HAPROXY_PROXY_GEAR_TTL: 3
.....
I don't know what isn't working. Some ideas?
Thanks
Hi.
This time I have tried the example palinode, following the steps to check if it was something related with the yeoman application, but I got the same result the version didn't upgrade to 0.12.4 it remained as 0.10.25
The log:
D:\003_IOT\WS_IOT\palinode\palinode>echo 0.12.4 >> .openshift/markers/NODEJS_VERSION
D:\003_IOT\WS_IOT\palinode\palinode>git commit . -m "use Node version 0.12.4"
[master 4efb626] use Node version 0.12.4
1 file changed, 1 insertion(+)
D:\003_IOT\WS_IOT\palinode\palinode>git push
warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use:
git config --global push.default matching
To squelch this message and adopt the new behavior now, use:
git config --global push.default simple
When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.
In Git 2.0, Git will default to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.
See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)
Counting objects: 9, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 482 bytes | 0 bytes/s, done.
Total 5 (delta 3), reused 0 (delta 0)
remote:
remote: - pre_stop_nodejs: Adding Node.js version 0.12.0 binaries to path
remote: - PATH set to include custom node version (0.12.0 ) from
remote: /var/lib/openshift/558c28ff500446f15e00000a/app-root/data//node-v0.12.0-linux-x64/bin
remote: PATH = /var/lib/openshift/558c28ff500446f15e00000a/app-root/data//node-v0.12.0-linux-x64
/bin:/var/lib/openshift/558c28ff500446f15e00000a/app-root/runtime/repo/node_modules/.bin:/var/lib/op
enshift/558c28ff500446f15e00000a//.node_modules/.bin:/opt/rh/nodejs010/root/usr/bin:/bin:/usr/bin:/u
sr/sbin
remote: Stopping NodeJS cartridge
remote: Thu Jun 25 2015 13:45:34 GMT-0400 (EDT): Stopping application 'palinode' ...
remote: Thu Jun 25 2015 13:45:34 GMT-0400 (EDT): Stopped Node application 'palinode'
remote: Saving away previously installed Node modules
remote: Building git ref 'master', commit 4efb626
remote:
remote: - Checking to see if Node.js version 0.12.4 is installed ...
remote: - Downloading and extracting http://nodejs.org/dist/v0.12.4 /node-v0.12.4 -linux-x64.tar.g
z ...
remote: % Total % Received % Xferd Average Speed Time Time Time Current
remote: Dload Upload Total Spent Left Speed
remote: 162 162 162 162 0 0 24915 0 --:--:-- --:--:-- --:--:-- 81000
remote:
remote: gzip: stdin: not in gzip format
remote: tar: Child returned status 1
remote: tar: Error is not recoverable: exiting now
remote: - Done installing Node.js version 0.12.4
remote: Building NodeJS cartridge
remote: - PATH set to include custom node version (0.12.4 ) from
remote: /var/lib/openshift/558c28ff500446f15e00000a/app-root/data//node-v0.12.4-linux-x64/bin
remote: PATH = /var/lib/openshift/558c28ff500446f15e00000a/app-root/data//node-v0.12.4-linux-x64
/bin:/var/lib/openshift/558c28ff500446f15e00000a/app-root/runtime/repo/node_modules/.bin:/var/lib/op
enshift/558c28ff500446f15e00000a//.node_modules/.bin:/opt/rh/nodejs010/root/usr/bin:/bin:/usr/bin:/u
sr/sbin
remote: - Installing dependencies w/ new version of npm ...
remote:
remote: npm info it worked if it ends with ok
remote: npm info using [email protected]
remote: npm info using [email protected]
remote: npm info preinstall [email protected]
remote: npm info build /var/lib/openshift/558c28ff500446f15e00000a/app-root/runtime/repo
remote: npm info linkStuff [email protected]
remote: npm info install [email protected]
remote: npm info postinstall [email protected]
remote: npm info prepublish [email protected]
remote: npm info ok
remote: Preparing build for deployment
remote: Deployment id is 5a82389f
remote: Activating deployment
remote: - Checking to see if Node.js version 0.12.4 is installed ...
remote: - Downloading and extracting http://nodejs.org/dist/v0.12.4 /node-v0.12.4 -linux-x64.tar.g
z ...
remote: % Total % Received % Xferd Average Speed Time Time Time Current
remote: Dload Upload Total Spent Left Speed
remote: 162 162 162 162 0 0 7565 0 --:--:-- --:--:-- --:--:-- 10800
remote:
remote: gzip: stdin: not in gzip format
remote: tar: Child returned status 1
remote: tar: Error is not recoverable: exiting now
remote: - Done installing Node.js version 0.12.4
remote:
remote: - pre_start_nodejs: Adding Node.js version 0.12.4 binaries to path
remote: - PATH set to include custom node version (0.12.4 ) from
remote: /var/lib/openshift/558c28ff500446f15e00000a/app-root/data//node-v0.12.4-linux-x64/bin
remote: PATH = /var/lib/openshift/558c28ff500446f15e00000a/app-root/data//node-v0.12.4-linux-x64
/bin:/var/lib/openshift/558c28ff500446f15e00000a/app-root/runtime/repo/node_modules/.bin:/var/lib/op
enshift/558c28ff500446f15e00000a//.node_modules/.bin:/opt/rh/nodejs010/root/usr/bin:/bin:/usr/bin:/u
sr/sbin
remote: Starting NodeJS cartridge
remote: Thu Jun 25 2015 13:45:40 GMT-0400 (EDT): Starting application 'palinode' ...
remote:
remote: - Using Node.js version 0.12.4 , checking app URI ...
remote: - test URI = http://palinode-onfoco.rhcloud.com/env
remote: - Version from test URI = Version: v0.10.25
remote:
remote: -------------------------
remote: Git Post-Receive Result: success
remote: Activation status: success
remote: Deployment completed with status: success
To ssh://[email protected]/~/git/palinode.git/
177069f..4efb626 master -> master
D:\003_IOT\WS_IOT\palinode\palinode>
So now I'm totally lost, and I don't know if the new version is installed and the information returned is wrong or simply it isn't installed.
And in the log we can see clearly the version that is installed and the test of the version, and they are different
remote: - Using Node.js version 0.12.4 , checking app URI ... remote: - test URI = http://palinode-onfoco.rhcloud.com/env remote: - Version from test URI = Version: v0.10.25
I've chacked the version with /env and the SSH and get the same information 0.10.25
Thanks
Hi
I think I found what the problem is.
The problem comes when I change the version with the echo command, like that:
echo 0.12.4 >> .openshift/markers/NODEJS_VERSION
If I simply edit the file with a text editor and change the default 0.12.2 version to 0.12.4 it works fine.
:+1:
Hmm, ok - wonder if the echo 0.12.4 >> .openshift/markers/NODEJS_VERSION behaves differently on windows.
Can you please pastebin http://pastebin.com/ contents of the .openshift/markers/NODEJS_VERSION file before and after the command is run.
Thanks.
Thanks for your answer.
The link is here:
I take this opportunity to ask you a last question.
As I explained, finally I get the 0.12.4 node version working. To accomplish it I had to deactivate the hot_deploy mode (deleting the hot_deploy file inside .openshift/makers). After upgrade node, I created the hot_deploy file again, and deployed it, I checked via SSH if the node version remains 0.12.4, and yes the version was 0.12.4 even though in the log says: Not starting cartridge nodejs because hot deploy is enabled
I thought that the new node version was downloaded via npm and placed in the node_modules (without deleting the default version) and then when the application started the path was changed to run this new version, but, because of the message in the log Not starting cartridge nodejs because hot deploy is enabled it looks that would have to start the default version 0.10.25 because the new cartridge is not started.
So probably I misunderstood something and the new version overwrites the default version and that's the way I can activate hot_deploy and the new node version 0.12.4 is running
Am I right?
Thanks
Aah, ok - thanks for the info - that clarifies things. I misunderstood - I thought the echo was not working on windows. Looks like that one is fine.
You are correct - it looks like OpenShift is not starting the cartridge on hot deploy mode - guess as per the intention to not restart but do a hot deploy. And as a result, the original node.js version remains in place/running and the new one is not installed. Since you are combining the 2 pieces - install a new node.js version + hot deployment in 1 git commit, the new version is never activated since the old version continues to run. The workaround here is as you found - to turn off hot deploy and git push to install the new version and then activate the hot deployment in a subsequent git push.
Thanks.
Thanks for clarify, and sharing your work.
Hi. And thanks for this sample. Great job!
I need to have version 0.12.2 of nodejs installed for my app. I follow your instructions to the letter but rhc is still taking nodejs v0.10.25. I don't know why!!
BTW, I am using the free plan, do you think this might be the reason I can't change nodejs version ?
For my experience, I recomend you to try with the example first and when it works for you try with your own application. If you are using windows edit the .openshift/markers/NODEJS_VERSION version with an editor avoiding the echo function.
@aabm00 :+1:
So, @manekinekko the free plan shouldn't matter and I just followed these instructions: https://github.com/ramr/nodejs-custom-version-openshift#steps-to-get-a-custom-nodejs-version-running-on-openshift
and it works absolutely fine for me. Can you please give that a try. As @aabm00 mentioned, try the example first and then use it with your application.
Please reopen this if its still an issue. Thanks.