Base solution for your next web application
Open Closed

signalr and azure #1823


User avatar
0
joshyates created

SignalR works fine localhost, but when I deploy to azure and not change any code, signalr gives a 500 error.

Failed to load http://test.azurewebsites.net/signalr/negotiate?clientProtocol=1.5&connectionData=%5B%7B%22name%22%3A%22abpcommonhub%22%7D%2C%7B%22name%22%3A%22chathub%22%7D%5D&_=1476676211353
resource: the server responded with a status of 500 (Internal Server Error)
GET http://test.azurewebsites.net/signalr/negotiate?clientProtocol=1.5&connec…22abpcommonhub%22%7D%2C%7B%22name%22%3A%22chathub%22%7D%5D&_=1476676211360 500 (Internal Server Error)
layout-libs.min.js?v=iDqjC6KTvzCpsxu5nUJHDUqAYIf9Q5BAbRhBBiD1vvU:15

Any advice would be appreciated. Thanks.


6 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Did you deploy on a VM ? If so, you can check Logs.txt (under your iis site folder) for more error details. Otherwise you can check Azure's logs to see error details.

    It might be a configuration issue.

  • User Avatar
    0
    joshyates created

    I looked into the logs. The 500 error in my azure environment: D:\home\site\wwwroot\signalr\negotiate

    http://testsite:80/signalr/negotiate?clientProtocol=1.5&connectionData=%5B%7B%22name%22%3A%22abpcommonhub%22%7D%2C%7B%22name%22%3A%22chathub%22%7D%5D&_=1476798018491
    

    Does it have anything to do with ABP platform? I could not find anything in the ABP SignalR documentation about deployment.

    I have monitored my azure web app: <a class="postlink" href="https://azure.microsoft.com/en-us/documentation/articles/web-sites-enable-diagnostic-log/">https://azure.microsoft.com/en-us/docum ... ostic-log/</a>

    Copy the code below, paste in notepad and save as error.html to view:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml"> 
    <head> 
    <title>IIS Detailed Error - 500.0 - Internal Server Error</title> 
    <style type="text/css"> 
     
    </style> 
     
    </head> 
    <body> 
    <div id="content"> 
    <div class="content-container"> 
    <h3>HTTP Error 500.0 - Internal Server Error</h3> 
    <h4>The page cannot be displayed because an internal server error has occurred.</h4> 
    </div> 
    <div class="content-container"> 
    <fieldset><h4>Most likely causes:</h4> 
    <ul> 	<li>IIS received the request; however, an internal error occurred during the processing of the request. The root cause of this error depends on which module handles the request and what was happening in the worker process when this error occurred.</li> 	<li>IIS was not able to access the web.config file for the Web site or application. This can occur if the NTFS permissions are set incorrectly.</li> 	<li>IIS was not able to process configuration for the Web site or application.</li> 	<li>The authenticated user does not have permission to use this DLL.</li> 	<li>The request is mapped to a managed handler but the .NET Extensibility Feature is not installed.</li> </ul> 
    </fieldset> 
    </div> 
    <div class="content-container"> 
    <fieldset><h4>Things you can try:</h4> 
    <ul> 	<li>Ensure that the NTFS permissions for the web.config file are correct and allow access to the Web server's machine account.</li> 	<li>Check the event logs to see if any additional information was logged.</li> 	<li>Verify the permissions for the DLL.</li> 	<li>Install the .NET Extensibility feature if the request is mapped to a managed handler.</li> 	<li>Create a tracing rule to track failed requests for this HTTP status code. For more information about creating a tracing rule for failed requests, click <a href="http://go.microsoft.com/fwlink/?LinkID=66439">here</a>. </li> </ul> 
    </fieldset> 
    </div> 
     
    <div class="content-container"> 
    <fieldset><h4>Detailed Error Information:</h4> 
    <div id="details-left"> 
    <table border="0" cellpadding="0" cellspacing="0"> 
    <tr class="alt"><th>Module</th><td>&nbsp;&nbsp;&nbsp;AspNetCoreModule</td></tr> 
    <tr><th>Notification</th><td>&nbsp;&nbsp;&nbsp;ExecuteRequestHandler</td></tr> 
    <tr class="alt"><th>Handler</th><td>&nbsp;&nbsp;&nbsp;aspNetCore</td></tr> 
    <tr><th>Error Code</th><td>&nbsp;&nbsp;&nbsp;0x00000000</td></tr> 
     
    </table> 
    </div> 
    <div id="details-right"> 
    <table border="0" cellpadding="0" cellspacing="0"> 
    <tr class="alt"><th>Requested URL</th><td>&nbsp;&nbsp;&nbsp;http://testapp:80/signalr/negotiate?clientProtocol=1.5&amp;connectionData=%5B%7B%22name%22%3A%22abpcommonhub%22%7D%2C%7B%22name%22%3A%22chathub%22%7D%5D&amp;_=1476798018491</td></tr> 
    <tr><th>Physical Path</th><td>&nbsp;&nbsp;&nbsp;D:\home\site\wwwroot\signalr\negotiate</td></tr> 
    <tr class="alt"><th>Logon Method</th><td>&nbsp;&nbsp;&nbsp;Anonymous</td></tr> 
    <tr><th>Logon User</th><td>&nbsp;&nbsp;&nbsp;Anonymous</td></tr> 
     
    </table> 
    <div class="clear"></div> 
    </div> 
    </fieldset> 
    </div> 
     
    <div class="content-container"> 
    <fieldset><h4>More Information:</h4> 
    This error means that there was a problem while processing the request. The request was received by the Web server, but during processing a fatal error occurred, causing the 500 error. 
    <p><a href="http://go.microsoft.com/fwlink/?LinkID=62293&amp;IIS70Error=500,0,0x00000000,9200">View more information &raquo;</a></p> 
    <p>Microsoft Knowledge Base Articles:</p> 
      
     
    </fieldset> 
    </div> 
    </div> 
    </body> 
    </html>
    
  • User Avatar
    0
    joshyates created

    The 500 error is caused because of path location? SignalR is caught in a GET loop trying to connect, but is not targeting the correct path within Azure:

    http://testapp:80/signalr/negotiate?clientProtocol=1.5&connectionData=%5B%7B%22name%22%3A%22abpcommonhub%22%7D%2C%7B%22name%22%3A%22chathub%22%7D%5D&_=1476799379443
    
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    We haven't faced such a problem when deploying to azure. Your problem seems like a security or configuration issue.

    I have found this one when searching about your problem <a class="postlink" href="https://github.com/SignalR/SignalR/issues/3659#issuecomment-247773451">https://github.com/SignalR/SignalR/issu ... -247773451</a> Can you try to do that ?

  • User Avatar
    0
    joshyates created

    Should the url be my server url? <a class="postlink" href="http://www.website.com:80/signalr/">http://www.website.com:80/signalr/</a> instead of <a class="postlink" href="http://website:80/signalr/">http://website:80/signalr/</a>

    I took a screenshot of my trace in my Azure environment:

  • User Avatar
    0
    joshyates created

    Logs from azure server:

    ERROR 2016-10-21 12:42:21,610 [28   ] e.Diagnostics.ExceptionHandlerMiddleware - An unhandled exception has occurred: The data protection operation was unsuccessful. This may have been caused by not having the user profile loaded for the current thread's user context, which may be the case when the thread is impersonating.
    System.Security.Cryptography.CryptographicException: The data protection operation was unsuccessful. This may have been caused by not having the user profile loaded for the current thread's user context, which may be the case when the thread is impersonating.
       at System.Security.Cryptography.ProtectedData.Protect(Byte[] userData, Byte[] optionalEntropy, DataProtectionScope scope)
       at System.Security.Cryptography.DpapiDataProtector.ProviderProtect(Byte[] userData)
       at Microsoft.AspNet.SignalR.Infrastructure.DataProtectionProviderProtectedData.Protect(String data, String purpose)
       at Microsoft.AspNet.SignalR.PersistentConnection.ProcessNegotiationRequest(HostContext context)
       at Microsoft.AspNet.SignalR.PersistentConnection.ProcessRequest(HostContext context)
       at Microsoft.Owin.Mapping.MapMiddleware.<Invoke>d__0.MoveNext()