Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web Sockets Streamed over Https, multiple errors #470

Closed
StephenBonikowsky opened this issue Oct 26, 2015 · 11 comments
Closed

Web Sockets Streamed over Https, multiple errors #470

StephenBonikowsky opened this issue Oct 26, 2015 · 11 comments
Assignees
Labels
bug This is a product bug.
Milestone

Comments

@StephenBonikowsky
Copy link
Member

The test case...
WebSocketHttpsDuplexBinaryStreamed located...
C:\OSS\wcf\src\System.Private.ServiceModel\tests\Scenarios\Extensibility\WebSockets\WebSocketTests.cs

Is failing with two issues, the first one throws a "System.PlatformNotSupportedException : Channel shape not supported" from...
C:\OSS\wcf\src\System.Private.ServiceModel\src\System\ServiceModel\Channels\HttpsChannelFactory.cs
Line 78.
Replace with...
return (TChannel)(object)new ClientWebSocketTransportDuplexSessionChannel((HttpChannelFactory)(object)this, this.ClientWebSocketFactory, address, via, this.WebSocketBufferPool);

Next exception is...
System.ArgumentException occurred
Message=Empty string is not a valid subprotocol value. Please use "null" to specify no value.
Parameter name: subProtocol
ParamName=subProtocol
Source=System.Net.WebSockets.Client
StackTrace:
at System.Net.WebSockets.WebSocketValidate.ValidateSubprotocol(String subProtocol)

From...
C:\OSS\wcf\src\System.Private.ServiceModel\src\System\ServiceModel\Channels\CoreClrClientWebSocketFactory.cs
Line 19

@StephenBonikowsky StephenBonikowsky added the bug This is a product bug. label Oct 26, 2015
@roncain
Copy link
Contributor

roncain commented Oct 27, 2015

Looks like PR #472 is addressing the HttpChannelFactory part of this. Thanks @StephenBonikowsky .

StephenBonikowsky added a commit to StephenBonikowsky/wcf that referenced this issue Oct 27, 2015
* Opened Issue dotnet#468 for test case WebSocketHttpRequestReplyBinaryStreamed and WebSocketHttpDuplexBinaryStreamed.
* Opened Issue dotnet#470 for test case     public static void WebSocketHttpsDuplexBinaryStreamed.
* These tests run and pass on desktop using the Bridge.
* These tests are a partial fix of issue 384
* Placing these tests in a new folder called "Extensibility" based on the logic used for locating previously released WCF Samples.
* Opened issue 425 to move other WebSocket tests to this location
* The new Contracts include operations not used by current set of tests, leaving as is because forthcoming tests will use these operations.
* Removed and sorted using statements wherever I saw that it needed it.
* Incorporated feedback from initial commit
@zhenlan zhenlan added this to the 2015.10 milestone Oct 27, 2015
@zhenlan zhenlan assigned mconnew and unassigned roncain Oct 27, 2015
@zhenlan zhenlan modified the milestones: 2015.11, 2015.10 Nov 3, 2015
@mconnew
Copy link
Member

mconnew commented Nov 5, 2015

The current problem is ClientWebSocket is throwing an exception on the connect call with an error saying it was unable to connect to the remote host.

@roncain
Copy link
Contributor

roncain commented Nov 5, 2015

Thanks @mconnew. What is the next step? Are you preparing a PR with a fix?

@mconnew
Copy link
Member

mconnew commented Nov 10, 2015

Secure websockets streaming tests are failing because of a bug in WebSockets. See dotnet/corefx#4429

@zhenlan zhenlan modified the milestones: 2015.11&12, 2016.01 Dec 15, 2015
@zhenlan zhenlan modified the milestones: 2016.01, 2016.02 Feb 2, 2016
@zhenlan zhenlan modified the milestones: 2016.02, 2016.03 Mar 1, 2016
@zhenlan zhenlan modified the milestones: 1.0.0-rtm, 2016.03 Mar 29, 2016
@zhenlan zhenlan modified the milestones: 1.1.0, 1.0.0-rtm May 21, 2016
@mconnew
Copy link
Member

mconnew commented Aug 1, 2016

These tests are passing.

@mconnew mconnew closed this as completed Aug 1, 2016
@roncain
Copy link
Contributor

roncain commented Sep 1, 2016

Reopening this issue because this test does not pass for me when I run locally self-hosted. I set PSEXEC_PATH to the folder for psexec.exe, set IncludeTestsWithIssues=true, and run all OuterLoops. Note that Issue(470) is still applied to this test so it is not being run by CI or Helix. It is possible a later version of the packages we're using may fix this. I was running with beta-24322-03 for CoreFx when I saw this. If later packages do fix it please remove the Issue attribute from the test.

Stack trace is:

            WebSocketTests.WebSocket_Https_Duplex_TextStreamed [FAIL]
               System.TimeoutException : This request operation sent to wss://localhost:8084//WebSocketHttpsDuplexTextStreamed.svc//WebSocketHttpsDuplexTextStreamedResource did not receive a reply within the configured timeout (00:00:59.9990033).  The time allotted to this operation may have been a portion of a longer timeout.  This may be because the service is still processing the operation or because the service was unable to send a reply message.  Please consider increasing the operation timeout (by casting the channel/proxy to IContextChannel and setting the OperationTimeout property) and ensure that the service is able to connect to the client.
         ---ETW Trace for Test WebSocketTests.WebSocket_Https_Duplex_TextStreamed Begins---
         WebSocketTests.WebSocket_Https_Duplex_TextStreamed: ChannelFactory created .
         WebSocketTests.WebSocket_Https_Duplex_TextStreamed: ServiceChannelCall started.
         WebSocketTests.WebSocket_Https_Duplex_TextStreamed: Client request serialization started.
         WebSocketTests.WebSocket_Https_Duplex_TextStreamed: Client completed serialization of the request message.
         WebSocketTests.WebSocket_Https_Duplex_TextStreamed: ServiceChannel Open Start.
         WebSocketTests.WebSocket_Https_Duplex_TextStreamed: WebSocket connection request to 'wss://localhost:8084//WebSocketHttpsDuplexTextStreamed.svc//WebSocketHttpsDuplexTextStreamedResource' send start.
         WebSocketTests.WebSocket_Https_Duplex_TextStreamed: Creating the client WebSocket with a factory of type 'System.ServiceModel.Channels.CoreClrClientWebSocketFactory'.
         WebSocketTests.WebSocket_Https_Duplex_TextStreamed: Pool allocating 16384 Bytes.
         WebSocketTests.WebSocket_Https_Duplex_TextStreamed: WebSocketId:48858004 read start.
         WebSocketTests.WebSocket_Https_Duplex_TextStreamed: WebSocketId:48858004 connection request sent.
         WebSocketTests.WebSocket_Https_Duplex_TextStreamed: ChannelHandlerId:19385132 - Message receive loop started.
         WebSocketTests.WebSocket_Https_Duplex_TextStreamed: ServiceChannel Open Stop.
         WebSocketTests.WebSocket_Https_Duplex_TextStreamed: TextMessageEncoder started encoding the message.
         WebSocketTests.WebSocket_Https_Duplex_TextStreamed: WebSocketId:48858004 writing '402' bytes to ''.
         WebSocketTests.WebSocket_Https_Duplex_TextStreamed: WebSocketId:48858004 asynchronous write stop.
         WebSocketTests.WebSocket_Https_Duplex_TextStreamed: WebSocketId:48858004 writing '193' bytes to ''.
         WebSocketTests.WebSocket_Https_Duplex_TextStreamed: WebSocketId:48858004 asynchronous write stop.
         WebSocketTests.WebSocket_Https_Duplex_TextStreamed: A streamed message was written by the encoder.
         WebSocketTests.WebSocket_Https_Duplex_TextStreamed: WebSocketId:48858004 writing '0' bytes to ''.
         WebSocketTests.WebSocket_Https_Duplex_TextStreamed: WebSocketId:48858004 asynchronous write stop.
         WebSocketTests.WebSocket_Https_Duplex_TextStreamed: The transport sent a message to 'wss://localhost:8084//WebSocketHttpsDuplexTextStreamed.svc//WebSocketHttpsDuplexTextStreamedResource'.
         WebSocketTests.WebSocket_Https_Duplex_TextStreamed: TextMessageEncoder started decoding the message.
         WebSocketTests.WebSocket_Https_Duplex_TextStreamed: WebSocketId:48858004 read start.
         WebSocketTests.WebSocket_Https_Duplex_TextStreamed: Throwing an exception. Source: System.ServiceModel 4.0.0.0. Exception details: System.TimeoutException: This request operation sent to wss://localhost:8084//WebSocketHttpsDuplexTextStreamed.svc//WebSocketHttpsDuplexTextStreamedResource did not receive a reply within the configured timeout (00:00:59.9990033).  The time allotted to this operation may have been a portion of a longer timeout.  This may be because the service is still processing the operation or because the service was unable to send a reply message.  Please consider increasing the operation timeout (by casting the channel/proxy to IContextChannel and setting the OperationTimeout property) and ensure that the service is able to connect to the client.
         WebSocketTests.WebSocket_Https_Duplex_TextStreamed: WebSocketId:48858004 sending close output message to 'NormalClosure' with close status 'wss://localhost:8084//WebSocketHttpsDuplexTextStreamed.svc//WebSocketHttpsDuplexTextStreamedResource'.
         WebSocketTests.WebSocket_Https_Duplex_TextStreamed: Throwing an exception. Source: System.ServiceModel 4.0.0.0. Exception details: System.TimeoutException: Receive timed out after 00:00:59.9989965. The time allotted to this operation may have been a portion of a longer timeout. ---> System.TimeoutException: Cannot claim lock within the allotted timeout of 00:00:59.9989965. The time allotted to this operation may have been a portion of a longer timeout.
            --- End of inner exception stack trace ---
         WebSocketTests.WebSocket_Https_Duplex_TextStreamed: WebSocketId:48858004 connection is aborted.
         ---ETW Trace for Test WebSocketTests.WebSocket_Https_Duplex_TextStreamed Ends---

               Stack Trace:
                  c:\OSS\wcf\src\System.Private.ServiceModel\src\System\ServiceModel\Dispatcher\DuplexChannelBinder.cs(771,0): at System.ServiceModel.Dispatcher.DuplexChannelBinder.SyncDuplexRequest.WaitForReply(TimeSpan timeout)
                  c:\OSS\wcf\src\System.Private.ServiceModel\src\System\ServiceModel\Dispatcher\DuplexChannelBinder.cs(524,0): at System.ServiceModel.Dispatcher.DuplexChannelBinder.Request(Message message, TimeSpan timeout)
                  c:\OSS\wcf\src\System.Private.ServiceModel\src\System\ServiceModel\Channels\ServiceChannel.cs(765,0): at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
                  c:\OSS\wcf\src\System.Private.ServiceModel\src\System\ServiceModel\Channels\ServiceChannel.cs(722,0): at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
                  c:\OSS\wcf\src\System.Private.ServiceModel\src\System\ServiceModel\Channels\ServiceChannelProxy.cs(369,0): at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(MethodCall methodCall, ProxyOperationRuntime operation)
                  c:\OSS\wcf\src\System.Private.ServiceModel\src\System\ServiceModel\Channels\ServiceChannelProxy.cs(141,0): at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(MethodInfo targetMethod, Object[] args)
                  --- End of stack trace from previous location where exception was thrown ---
                     at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
                     at System.Reflection.DispatchProxyGenerator.Invoke(Object[] args)
                     at generatedProxy_1.DownloadStream()
                  c:\OSS\wcf\src\System.Private.ServiceModel\tests\Scenarios\Extensibility\WebSockets\WebSocketTests.4.1.0.cs(330,0): at WebSocketTests.WebSocket_Https_Duplex_TextStreamed()
         Finished:    Extensibility.WebSockets.Tests

@roncain roncain reopened this Sep 1, 2016
@mconnew
Copy link
Member

mconnew commented Sep 12, 2016

I have confirmed this is a reliable reproducible instance of dotnet/corefx#4429

@roncain
Copy link
Contributor

roncain commented Sep 13, 2016

Thanks @mconnew -- it looks like https://github.com/dotnet/corefx/issues/4429 is slotted to be fixed in 1.2

@zhenlan
Copy link
Member

zhenlan commented Sep 22, 2016

@mconnew please check if the corefx fix is included in 1.1 branch.

@zhenlan
Copy link
Member

zhenlan commented Oct 4, 2016

@mconnew has ported the fix made in corefx already make in 1.1. The remaining task is to re-enable the tests that are disabled by this issue.

@StephenBonikowsky
Copy link
Member Author

Seems to be working now. Closing.

@zhenlan zhenlan modified the milestones: 2.0.0, 2016.10 May 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This is a product bug.
Projects
None yet
Development

No branches or pull requests

4 participants