Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1059144 - [origin_cartridge_89] force_npm_deploy doesn't work when add hot_deploy and force_npm_deploy at the same time
Summary: [origin_cartridge_89] force_npm_deploy doesn't work when add hot_deploy and f...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Image
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Michal Fojtik
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-01-29 09:45 UTC by Yan Du
Modified: 2015-05-15 00:37 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-02-26 19:10:42 UTC


Attachments (Terms of Use)

Description Yan Du 2014-01-29 09:45:12 UTC
Description of problem:
Create a nodejs app and add hot_deploy and force_npm_deploy, then git push. hot_deploy marker still works, and the force_npm_marker doestn't take effect.

remote: npm info ok 
remote: Preparing build for deployment
remote: Deployment id is 70a27429
remote: Activating deployment
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://52e8af542f67b39b54000047@n10a-111.dev.rhcloud.com/~/git/n10a.git


Version-Release number of selected component (if applicable):
devenv_4295



How reproducible:
Always


Steps to Reproduce:

1. Create a nodejs app
2. Add force_npm_deploy and hot_deploy marker, git push
#touch .openshift/markers/hot_deploy 
#touch .openshift/markers/force_npm_deploy
#git add .; git commit -amp; git push
3. ssh into app and check the npm process


Actual results:
2. hot_deploy marker still works (supervisor keep the same PID)
3. There is no npm process running


Expected results:
hot_deploy marker is not supported when force_npm_marker present. After push, should exit a npm process in app.


Additional info:

If add force_npm_marker and push first, then add hot_deploy marker separately and push, the force_npm_marker works
eg: 
1. Create nodejs app
2. Add force_npm_marker and git push
3. Add hot_deploy marker and git push

Comment 1 Michal Fojtik 2014-01-29 09:56:06 UTC
Yan Du:

If you have force_npm_deploy marker in place, the application will not start as the hot_deploy is not supported when using force_npm_deploy (as described in Trello). There is an error message informing users about that:

remote: Not starting cartridge nodejs because hot deploy is enabled

Also this behavior is documented. To fix this you need to remove the force_npm_marker first.

Actual results:
2. hot_deploy marker still works (supervisor keep the same PID)

^ Do you mean the supervisor is running? It should not.

Comment 2 Michal Fojtik 2014-01-29 14:09:14 UTC
Yan Du:

After speaking with other guys, we will change this to show warning instead of preventing the application start.

Comment 3 openshift-github-bot 2014-01-30 16:08:44 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/32a1152a4ce2bc9883dacd7b6d8ea04741c5867c
Bug 1059144 - Refactored nodejs control script

* Moved functions into util file to make debugging easier
* Kill 'node' processes when 'use_npm' instead of killing 'npm'

Comment 4 Yan Du 2014-02-07 08:28:47 UTC
Test on devenv_4341, 

when add npm_marker and hot_deploy maker at the same  time to the app, will get the warning "hot_deploy currently is disabled due to use_npm is present", the npm process runnning instead of supervisor after ssh into app.

remote: Preparing build for deployment
remote: Deployment id is 46c6c7f8
remote: Activating deployment
remote: Not starting cartridge nodejs because hot deploy is enabled
remote: 
remote: *** WARNING: hot_deploy currently is disabled due to use_npm is present.
remote: 
remote: Stopping NodeJS cartridge
remote: Starting NodeJS cartridge
remote: *** NodeJS supervisor is disabled due to .openshift/markers/use_npm
remote: *** Starting application using: npm start -d
remote: 
remote: DEBUG: Running node-supervisor with
remote: DEBUG:   program 'server.js'
remote: DEBUG:   --watch '.'
remote: DEBUG:   --ignore 'undefined'
remote: DEBUG:   --extensions 'node|js|coffee'
remote: DEBUG:   --exec 'node'
remote: 
remote: DEBUG: Starting child process with 'node server.js'
remote: DEBUG: Watching directory '/var/lib/openshift/52f48bfeb377785bb6000007/app-root/runtime/repo' for changes.
remote: Warning: express.createServer() is deprecated, express
remote: applications no longer inherit from http.Server,
remote: please use:
remote: 
remote:   var express = require("express");
remote:   var app = express();
remote: 
remote: Fri Feb 07 2014 02:32:36 GMT-0500 (EST): Node server started on 127.1.250.1:8080 ...
remote: DEBUG: crashing child
remote: Fri Feb 07 2014 02:37:31 GMT-0500 (EST): Received SIGTERM - terminating sample app ...
remote: Fri Feb 07 2014 02:37:31 GMT-0500 (EST): Node server stopped.
remote: DEBUG: Starting child process with 'node server.js'
remote: Warning: express.createServer() is deprecated, express
remote: applications no longer inherit from http.Server,
remote: please use:
remote: 
remote:   var express = require("express");
remote:   var app = express();
remote: 
remote: Fri Feb 07 2014 02:37:31 GMT-0500 (EST): Node server started on 127.1.250.1:8080 ...
remote: DEBUG: Sending SIGTERM to child...
remote: Fri Feb 07 2014 02:37:54 GMT-0500 (EST): Received SIGTERM - terminating sample app ...
remote: Fri Feb 07 2014 02:37:54 GMT-0500 (EST): Node server stopped.
remote: Fri Feb 07 2014 02:37:54 GMT-0500 (EST): Stopped Node application 'n10'
remote: Fri Feb 07 2014 02:37:54 GMT-0500 (EST): Starting application 'n10' ...
remote: npm info it worked if it ends with ok
remote: npm info using npm@1.2.17
remote: npm info using node@v0.10.5
remote: npm info prestart OpenShift-Sample-App@1.0.0
remote: npm info start OpenShift-Sample-App@1.0.0
remote: 
remote: > OpenShift-Sample-App@1.0.0 start /var/lib/openshift/52f48bfeb377785bb6000007/app-root/runtime/repo
remote: > node server.js
remote: 
remote: Warning: express.createServer() is deprecated, express
remote: applications no longer inherit from http.Server,
remote: please use:
remote: 
remote:   var express = require("express");
remote:   var app = express();
remote: 
remote: Fri Feb 07 2014 02:37:55 GMT-0500 (EST): Node server started on 127.1.250.1:8080 ...
remote: -------------------------
remote: Git Post-Receive Result: success
remote: Activation status: success
remote: Deployment completed with status: success

Move bug to verified.


Note You need to log in before you can comment on or make changes to this bug.