I just deployed a MVC web app to my windows server 2012. It has Windows 8 and IIS v8 installed. The application uses SignalR, and I would like to use websockets, but it gives errors.
In every browser (chrome ff, ie) the error is the same:
"NetworkError: 500 Internal Server Error - https://domain.com/signalr/connect?transport=webSockets&connectionToken=wiiR333%2BkbKu0Ex2SPZLE9W9X6eAm5lBssbjXbqCvl0QpjAiGtHkn1xiIQHYGi3O4DDLIv7whTahVb8Ll5kfwjnrzaZaDYCApWj5aWm6d1cZzxH89K%2BouHziBH7dCt9I&connectionData=%5B%7B%22name%22%3A%22charthub%22%7D%5D&tid=8"
The detailed error message would be:
Exception information:
Exception type: InvalidOperationException
Exception message: Not a valid web socket request.
at Microsoft.AspNet.SignalR.Transports.WebSocketTransport.AcceptWebSocketRequest(Func`2 callback)
at Microsoft.AspNet.SignalR.PersistentConnection.ProcessRequest(HostContext context)
at Microsoft.AspNet.SignalR.Hubs.HubDispatcher.ProcessRequest(HostContext context)
at Microsoft.AspNet.SignalR.PersistentConnection.ProcessRequest(IDictionary`2 environment)
at Microsoft.Owin.Mapping.MapMiddleware.<Invoke>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContext.EndFinalWork(IAsyncResult ar)
at System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
I asked in the SignalR Jabbr chat what the error would be and they told me something is blocking the connections. I checked, and both TCP port 80 and port 443 are listening.
The IIS trust level is Full (internal) and we're not using loadbalancing. The Websockets protocol is installed.
What could be wrong?
Related
I have a Xamarin iOS app that connects to an API (written by me). Sometimes I suffer from a problem where the Simulators (running on Windows 10) will not connect to the API. Whereas the same code runs fine on an iPhone connected to the MAC on my network.
It throws the following exception:
{System.Net.Http.HttpRequestException: An SSL error has occurred and a secure connection to the server cannot be made.
---> Foundation.NSErrorException: Error Domain=NSURLErrorDomain Code=-1200
"An SSL error has occurred and a secure connection to the server cannot be made."
UserInfo={NSErrorFailingURLStringKey=https://api.staging.MyApp.com/api/v1/LogOn/,
NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?,
_kCFStreamErrorDomainKey=3,
_NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <61E93B00-972D-4DF1-BA39-0141116988C2>.<1>,
_NSURLErrorRelatedURLSessionTaskErrorKey=(\n "LocalDataTask <61E93B00-972D-4DF1-BA39-0141116988C2>.<1>"\n),
NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made.,
NSErrorFailingURLKey=https://api.staging.MyApp.com/api/v1/LogOn/,
NSUnderlyingError=0x600001cac840 {Error Domain=kCFErrorDomainCFNetwork Code=-1200 "(null)" UserInfo={_kCFStreamPropertySSLClientCertificateState=0,
_kCFNetworkCFStreamSSLErrorOriginalValue=-9816,
_kCFStreamErrorDomainKey=3,
_kCFStreamErrorCodeKey=-9816}},
_kCFStreamErrorCodeKey=-9816}\n
--- End of inner exception stack trace ---\n
at System.Net.Http.NSUrlSessionHandler.SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) [0x001d4] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.18.2.1/src/Xamarin.iOS/Foundation/NSUrlSessionHandler.cs:523 \n
at System.Net.Http.HttpClient.FinishSendAsyncBuffered (System.Threading.Tasks.Task`1[TResult] sendTask,
System.Net.Http.HttpRequestMessage request, System.Threading.CancellationTokenSource cts,
System.Boolean disposeCts) [0x0017e] in
/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/external/corefx/src/System.Net.Http/src/System/Net/Http/HttpClient.cs:506 \n at MyApp.Mobile.Api.LogOnUser (MyApp.Mobile.VM.LogOnVM vm) [0x000b2] in D:\Projects\MyAppCore\MyApp.Mobile\MyApp.Mobile\Api.cs:114 }
Just to repeat, the VERY SAME code is running on the physical iphone (and android emulators/phone) perfectly.
Any ideas as to why are appreciated. Thanks.
Following the information Jason provided, I decided to reboot the MAC. And voila! All working again.
I think it may be caused by me starting up 'ExpressVPN' on the PC. I noticed when that is running, the Android won't connect either. However, when I stop it, the Android is OK. But I suspect the Apple never works again until the MAC is rebooted. Not 100% sure that is the reason, but I hope this will help others.
OK - It was NOT the VPN. But rebooting the MAC seems to fix the issue every time.
I am trying to connect from CRM Plugin to External SOAP API. It gives me error.
I am using Isolation Mode as None.
When I connect the same API using Console APP it works fine. I executed the Console APP from Server and it connects and responds Fine.
I googled a bit got some leads but probably I lack capability to understand/ pinpoint the issue.
Code Snippet below
WebRequest request = WebRequest.Create("URL");
request.Method = "GET";
//request.Credentials = new NetworkCredential("USERNAME", "PASSWORD");
WebResponse response = request.GetResponse();
HttpWebResponse webresponse = (HttpWebResponse)response;
if (webresponse.StatusCode == HttpStatusCode.OK)
{
tracing.Trace($" Resposne is correct i.e OK");
}
When I debug using Plugin Registration Tool, Tool breaks up and exits.
Error from Tracing:
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.GetResponse()
Reason why it was not working:
Customer (OnPrem) uses Proxy to connect to Web.
When I was running Console App on server it was running on my Logged on context (outside CRM) i.e. user who logged on Server.
However, When I tried to call website from CRM may it be from Isolation Mode = None OR Sandbox, The services that runs under specific user did not have proxy added to them.
For Example running plugin under Isolation Mode = NONE i.e. directly under the context of APPPool Service "crmtestappserv" did not have proxy and even using mere Internet Explored under the context of same user was not able to open google.com unless proxies were Added.
Steps Taken to Solve the issue: In our plugin Code, when we make an HTTP request we add proxy to the request. This solved our issue.
I having problem on Umbraco 7.7.6 basically server call itself for tasks/publishing/keepalive details:
http://issues.umbraco.org/issue/U4-5391
the problem is that server admin is not allowing external access to internet from webserver so that means http://(domain)/umbraco is not reachable and Umbraco is throwing following error in log file.
2017--06 13:42:45,673 [P3048/D15/T45] ERROR Umbraco.Web.Scheduling.KeepAlive – Failed (at “http://(domain)/umbraco”).
System.Threading.Tasks.TaskCanceledException: A task was canceled.
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Umbraco.Web.Scheduling.KeepAlive.<PerformRunAsync>d__4.MoveNext()
how can I mitigate the issue without giving outbound connection to internet from server?
I am deploying a test rig as per the directions from http://msdn.microsoft.com/en-us/library/windowsazure/hh674491.aspx with the controller and agents hosted on windows azure. I have followed all the directions properly and my VS client is able to see the controller and agents. However when i execute a load test, the test remains in an pending state and I see the below error in the Controller's eventlog. My problem is similar to one found at: http://social.msdn.microsoft.com/Forums/en-US/windowsazureconnectivity/thread/4040619f-5667-4445-804a-84f37d823c9f/. Please help!
(QTController.exe, PID 692, Thread 11) ControllerDeployment.DoDeployment: System.Net.Sockets.SocketException (0x80004005): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond [xxx:xxx:xxxx:xxx:xxxx:xxxx:xxxx:220]:6915
Server stack trace:
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
at System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket(EndPoint ipEndPoint)
at System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket()
at System.Runtime.Remoting.Channels.SocketCache.GetSocket(String machinePortAndSid, Boolean openNew)
at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.SendRequestWithRetry(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream)
at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream)
at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage msg)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Microsoft.VisualStudio.TestTools.Common.FileCopyService.get_DeploymentFlags()
at Microsoft.VisualStudio.TestTools.Controller.ControllerExecution.b__6(FileCopyService fileCopyService)
at Microsoft.VisualStudio.TestTools.Execution.RemoteObjectContainer1.InvokeAsRemoteUser(Action1 invoke)
at Microsoft.VisualStudio.TestTools.Controller.ControllerExecution.DoDeployment()
Based on the error message it looks like the controller is not able to talk to the agent. Have you set up a connect group as mentioned below:
"http://msdn.microsoft.com/en-us/library/windowsazure/hh674497.aspx"
Creating a Connect Group
The Connect feature of Azure allows you to create a Virtual Private Network. Members of the group can include on-premise computers as well as Azure role instances. For the Load Test solution, the Connect group allows communication between the test controller and the agents.
Attempted this as well, and couldn't get it to work. Ended up having to move the Controller into Azure as well.
I followed the documentation as far as what ports the agent needed, and opened those up in the Azure firewall. However, after doing a network capture, IIRC it also used some dynamic ports that weren't going to work to open up.
So I found that I had to move Visual Studio, the Load Agent Controller, and the Load Agents themselves all into Azure to utilize this in the cloud.
I have developed a webservice using WCF and secured it using NTLM over SSL. I am able to connect successfully using from a visual Studio 2008 form or Web Project. The problem I am having is when creating a smart device project and deploying it on the device.
when I call the service, from client side I get the error: Web Exception
on the server site, when i check the Event Log I get the following Error:
**Sender Information: System.ServiceModel.Activation.HostedHttpRequestAsyncResult/7491627
Exception: System.Web.HttpException (0x80004005): There was no channel actively listening at 'https://mymachine:9011/FrontEndWS/MeterReadingService.svc/$metadata'. This is often caused by an incorrect address URI. Ensure that the address to which the message is sent matches an address on which a service is listening. --->
System.ServiceModel.EndpointNotFoundException: There was no channel actively listening at 'https://mymachine:9011/FrontEndWS/MeterReadingService.svc/$metadata'. This is often caused by an incorrect address URI. Ensure that the address to which the message is sent matches an address on which a service is listening.
at System.ServiceModel.Activation.HostedHttpTransportManager.HttpContextReceived(HostedHttpRequestAsyncResult result)
at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.HandleRequest()
at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest()
at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result)**
Process Name: w3wp
Process ID: 2828
Cannot figure out why this is happening from mobile devices but works fine from a PC.