stayhard / Seq.App.HipChat

An app for Seq (http://getseq.net) that forwards messages to HipChat.
MIT License
5 stars 8 forks source link

The extension stopped working after upgrading HipChat server to 2.0.7 #6

Closed bratfizyk closed 7 years ago

bratfizyk commented 7 years ago

Now it kills whole Seq with the following error message:

2016-11-15 10:50:08.614 +00:00 [Fatal] Unhandled exception in the main AppDomain (terminating: True): "System.Net.Http.HttpRequestException"
System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
   at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)
   at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
   --- End of inner exception stack trace ---
   at System.Net.TlsStream.EndWrite(IAsyncResult asyncResult)
   at System.Net.ConnectStream.WriteHeadersCallback(IAsyncResult ar)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult, TransportContext& context)
   at System.Net.Http.HttpClientHandler.GetRequestStreamCallback(IAsyncResult ar)
   --- End of inner exception stack trace ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at Seq.App.HipChat.HipChatReactor.<On>d__26.MoveNext() in F:\Users\Kristoffer\Projects\GitHub\Seq.App.HipChat\Seq.App.HipChat\HipChatReactor.cs:line 99

I've had a chat with HipChat team, and here's what they said:

I know we have External nonBOSH XMPP ports disabled in HipChat Server 2.0.7 but I don't think this is related.

I have read a bit of the integration code and I see this part from HipChatReactor.cs is triggering the notification:

Unable to find source-code formatter for language: cs. Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml                 var response = await client.PostAsJsonAsync(                     string.Format("room/{0}/notification?auth_token={1}", RoomId, Token),                     body);

Trying to do something about it. Everything works fine when posting messages using POSTman. Moreover after the HipChat upgrade to 2.0.7 I can't use PowerShell to send notifications to HipChat either, but TeamCity works just fine.

bratfizyk commented 7 years ago

Update: it's because TLS. The following code: ServicePointManager.SecurityProtocol <- SecurityProtocolType.Tls12

Needs to be added in order to make everything work again. HipChat team has changed this recently.

kristofferlindvall commented 7 years ago

This should be fixed in the just published version 1.1.1