Description of problem: When creating an app,idle this app,then access page via websocket, it's failed to wake up this app to start and get 503 error for page. Version-Release number of selected component (if applicable): fork_ami_origin_runtime_232_834 How reproducible: always Steps to Reproduce: 1. Create a fork_ami instance 2. Log into site at https://devenv/app/console 3. Create an AeroGear app named "caerosocket" 4. SSH into this instance and idle this app oo-admin-ctl-gears idlegear 5239165978550ce0ab000002 5. Access this app page via browser http://caerosocket-cdm.dev.rhcloud.com:8000/simplepush/info https://caerosocket-cdm.dev.rhcloud.com:8443/simplepush/info 6. Check the status of app rhc app show caerosocket --state Actual results: at Step 5: return 503 page at Step 6: Cartridge aerogear-aerogear-push-0.8.0, mysql-5.1 is idle Expected results: Idled app should be waken up via websocket request. Additional info:
Feature enabled in https://github.com/openshift/origin-server/pull/3677
For testing you require a websocket enabled server and client... Add dependency to package.json: : . "dependencies": { "ws" : ">0.4.30" }, Replace server.js to support web sockets: var host = process.env.OPENSHIFT_NODEJS_IP; var port = process.env.OPENSHIFT_NODEJS_PORT || 8080; var WebSocketServer = require('ws').Server, wss = new WebSocketServer({host: host, port: port}); wss.on('connection', function(ws) { ws.on('message', function(message) { console.log('received: %s', message); }); ws.send('something'); }); For a client: wscat -c ws://node001-honcenet.dev.rhcloud.com:8000/ -p 8 Every message you type, should be logged in /var/lib/openshift/<uuid>/nodejs/logs/node.log.
Merged onto master by https://github.com/openshift/origin-server/pull/3688
It's fixed, verified on devenv_3817, please refer to the following results: 1. Create a nodejs app rhc app create nod1 nodejs-0.6 2. Replace server.js to support web sockets: var host = process.env.OPENSHIFT_NODEJS_IP; var port = process.env.OPENSHIFT_NODEJS_PORT || 8080; var WebSocketServer = require('ws').Server, wss = new WebSocketServer({host: host, port: port}); wss.on('connection', function(ws) { ws.on('message', function(message) { console.log('received: %s', message); }); ws.send('something'); }); 3. Add dependency to package.json: : . "dependencies": { "ws" : ">0.4.30" }, 4. Push the changes 5. SSH into instance and idle this app oo-admin-ctl-gears idlegear 52415129b723cc8c72000039 6. Access this app via websocket wscat -c wss://nod1-cdm.dev.rhcloud.com:8443/ -p 8 or wscat -c ws://nod1-cdm.dev.rhcloud.com:8000/ -p 8 7. Check the state of this app # rhc app show -a nod1 --state Cartridge nodejs-0.6 is started