Bug 1034134 - openshift-node-web-proxy doesn't pass protocol specified by client on websockets requests
Summary: openshift-node-web-proxy doesn't pass protocol specified by client on websock...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Containers
Version: 2.0.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: ---
Assignee: Jason DeTiberus
QA Contact: libra bugs
URL:
Whiteboard:
Depends On: 1031986
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-11-25 10:19 UTC by Johnny Liu
Modified: 2017-03-08 17:35 UTC (History)
3 users (show)

Fixed In Version: nodejs010-nodejs-ws-0.4.25-8.el6op
Doc Type: Bug Fix
Doc Text:
Clone Of: 1031986
Environment:
Last Closed: 2013-12-16 09:11:14 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Johnny Liu 2013-11-25 10:19:18 UTC
This issue also happened with 2.0/2013-11-22.1

+++ This bug was initially created as a clone of Bug #1031986 +++

Description of problem:
Fail to access websocket of app, but could access it by internal IP. Seem like openshift-node-web-proxy doesn't pass protocol specified by client to app's node process.

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

How reproducible:
Always

Steps to Reproduce:
1.Create nodejs-0.10 app.
2.Use attachment to replace server.js
3.Add "websocket" to package.json
  "dependencies": {
    "websocket": ">= 1.0.7"
  },
4. Then git push
5. On client, access websocket of your app.


Actual results:
# node client.js ws://nodejs010app-jialiu.dev.rhcloud.com:8000/
Connecting to ws://nodejs010app-jialiu.dev.rhcloud.com:8000/
WebSocket client connected
echo-protocol Connection Closed

Seen from app's log, get the following error:
<--snip-->
! requestedProtocols should be 'echo-protocol'
! requestedProtocols is: 
Failed to accept connection: Error: Specified protocol was not requested by the client.
<--snip-->

Seem like openshift-node-web-proxy doesn't pass protocol specified by client to app's node process.


Expected results:
Websocket should be accessed successfully.

Additional info:
Succeed to access app's websokect via internal IP directly.

# node client.js ws://127.1.244.1:8080/

--- Additional comment from Johnny Liu on 2013-11-19 06:41:16 EST ---

Looks like this is a regression bug, because BZ#1002070 is using the same test stips and it is fixed in devenv-stage_471

--- Additional comment from Johnny Liu on 2013-11-20 01:13:44 EST ---



--- Additional comment from Johnny Liu on 2013-11-20 01:14:19 EST ---



--- Additional comment from Mrunal Patel on 2013-11-21 13:04:45 EST ---

We need to port our patches to nodejs-ws to nodejs010-nodejs-ws.

--- Additional comment from Mrunal Patel on 2013-11-21 19:54:12 EST ---

Waiting for nodejs010-nodejs-ws-0.4.25-8.el6oso to be available in devenv/stg.

--- Additional comment from Mrunal Patel on 2013-11-22 19:22:02 EST ---

https://github.com/openshift/origin-server/pull/4234

--- Additional comment from chunchen on 2013-11-24 21:57:35 EST ---

It's reproduced, checked on devenv_4067, the nodejs010-nodejs-ws version is 0.4.25-8.el6oso.x86_64. Please refer to the following results:

1.Create nodejs-0.10 app
rhc app create cndjs10 nodejs-0.10
2.Use the attachment to replace server.js and add client.js
3.Add "websocket" to package.json
  "dependencies": {
    "websocket": ">= 1.0.7"
  },
4. Push the changes
git add .; git commit -amp; git push
5. SSH into this app and access websocket
rhc ssh cndjs10
cd ~/app-root/runtime/repo

\> node client.js ws://cndjs10-cdm.dev.rhcloud.com:8000/
Connecting to ws://cndjs10-cdm.dev.rhcloud.com:8000/
WebSocket client connected
echo-protocol Connection Closed

--- Additional comment from Johnny Liu on 2013-11-25 03:47:17 EST ---

Verified this bug against devenv_4067, and PASS.

# rpm -qa|grep nodejs010-nodejs-ws
nodejs010-nodejs-ws-0.4.25-8.el6oso.x86_64

[jialiu@jialiu-pc1 nodejs010app]$ node client.js ws://nodejs010app-jialiu.dev.rhcloud.com:8000/
Connecting to ws://nodejs010app-jialiu.dev.rhcloud.com:8000/
WebSocket client connected
Received: '8833312'
Received: '13763515'
Received: '14992830'
Received: '6033139'
Received: '14016768'
Received: '6773515'
Received: '1969944'

App log:
Mon Nov 25 2013 03:10:49 GMT-0500 (EST) Server is listening on port 8080
! requestedProtocols should be 'echo-protocol'
! requestedProtocols is: echo-protocol
Mon Nov 25 2013 03:11:16 GMT-0500 (EST) Connection accepted.
Received Message: 10356115
Received Message: 16628742
Received Message: 1098512
Received Message: 13707152
Received Message: 521087
Received Message: 795350
Mon Nov 25 2013 03:11:22 GMT-0500 (EST) Peer 127.1.244.1 disconnected.


About the failure in comment 7, actually it is another issue, file BZ#1034077 for more details.

Comment 4 Nan Wei 2013-11-27 05:47:44 UTC
OpenShift Enterprise puddle: 2013-11-26.1


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