forked from tjanczuk/iisnode
-
Notifications
You must be signed in to change notification settings - Fork 99
Open
Description
I'm working on the Botbuilder framework using the NODEjs SDK and i have the current setup for directline conversations
- A nodejs web UI which is a chat interface for the bot
- A nodejs bot logic server
Both these servers are hosted in an azure web app (windows server 2016) with an IIS-node webserver
Currently the server containing the bot logic has the below routes (using the restify framework)
server.post('/receiveMessage', connector.listen());
server.post('/beginSpecialDialog', function(req,res,next){
var _body = req.body;
logger("info", "server", "/beginSpecialDialog triggered", null, {"conversationId": _body._directlineAddress.conversation.id})
if(_body._directlineAddress.secret !== config.BOT.DIRECTLINE_SECRET){
logger("warn", "server", "directline credentials do not match", null, {"conversationId": _body._directlineAddress.conversation.id, "secretSent":_body._directlineAddress.secret, "err":err});
res.send(401);
}
bot.beginDialog(_body._directlineAddress, _body._dialogId, _body._specialParams, function(err){
if(err){
logger("warn", "server", "error occured on starting main dialog from url", null, {"conversationId": _body._directlineAddress.conversation.id, "err":err});
res.send(400, {"err": err.stack });
}
else{
res.send(200);
}
});
});
The /beginSpecialDialog is initiated by the webUI server whenever we need to convey the bot to start a special Dialog for the webUI browser.
However , sometimes (1 in every 10 requests or so) - this route isnt being processed by the bot server. I get a 5xx response from the bot server with the below details
</head>
<body>
<div id="content">
<div class="content-container">
<h3>HTTP Error 500.1013 - 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> iisnode</td></tr>
<tr><th>Notification</th><td> ExecuteRequestHandler</td></tr>
<tr class="alt"><th>Handler</th><td> iisnode</td></tr>
<tr><th>Error Code</th><td> 0x0000006d</td></tr>
</table>
</div>
<div id="details-right">
<table border="0" cellpadding="0" cellspacing="0">
<tr class="alt"><th>Requested URL</th><td> https://test-bot-website:80/server.js</td></tr>
<tr><th>Physical Path</th><td> D:\home\site\wwwroot\server.js</td></tr>
<tr class="alt"><th>Logon Method</th><td> Anonymous</td></tr>
<tr><th>Logon User</th><td> 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&IIS70Error=500,1013,0x0000006d,14393">View more information »</a></p>
<p>Microsoft Knowledge Base Articles:</p>
</fieldset>
</div>
</div>
</body>
</html>
heres the log from the IIS node webserver
2018-01-25 06:22:58 TEST-BOT-WEBSITE POST /beginSpecialDialog X-ARR-LOG-ID=da648f30-dda9-4103-8a48-862b65eef82d 443 - 23.102.157.162 - - - test-bot-website.azurewebsites.net 500 1013 109 298 1425 120540
Could anyone shed some light as to why this happens? heres my web.config file
<configuration>
<system.webServer>
<!-- Visit http://blogs.msdn.com/b/windowsazure/archive/2013/11/14/introduction-to-websockets-on-windows-azure-web-sites.aspx for more information on WebSocket support -->
<webSocket enabled="false" />
<handlers>
<!-- Indicates that the server.js file is a node.js site to be handled by the iisnode module -->
<add name="iisnode" path="server.js" verb="*" modules="iisnode"/>
</handlers>
<rewrite>
<rules>
<!-- BEGIN rule TAG FOR WWW and HTTP to HTTPS REDIRECT -->
<rule name="First_Secure" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTPS}" pattern="OFF" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}" />
</rule>
<rule name="Second_Redirect" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTPS}" pattern="ON" />
<add input="{HTTP_HOST}" pattern="^(www\.)(.*)$" ignoreCase="false" />
</conditions>
<action type="Redirect" url="https://{C:2}" />
</rule>
<!-- END rule TAG FOR WWW and HTTP to HTTPS REDIRECT -->
<!-- Do not interfere with requests for node-inspector debugging -->
<rule name="NodeInspector" patternSyntax="ECMAScript" stopProcessing="true">
<match url="^server.js\/debug[\/]?" />
</rule>
<!--This redirects home page to /public/index.html-->
<rule name="DefaultDocRewrite" stopProcessing="True">
<match url="^$" />
<action type="Rewrite" url="/public/index.html" />
</rule>
<!--This redirects all urls to public -->
<rule name="StaticContentRewrite">
<action type="Rewrite" url="public{REQUEST_URI}"/>
</rule>
<!--This catches if the file exists under public directory and stops processing, so that iis will serve static files -->
<rule name="StaticContent" stopProcessing="True">
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" />
<add input="{REQUEST_URI}" pattern="^/public/" />
</conditions>
</rule>
<!-- All other URLs are mapped to the node.js site entry point -->
<rule name="DynamicContent">
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True"/>
</conditions>
<action type="Rewrite" url="server.js"/>
</rule>
</rules>
</rewrite>
<!-- 'bin' directory has no special meaning in node.js and apps can be placed in it -->
<security>
<requestFiltering>
<hiddenSegments>
<remove segment="bin"/>
</hiddenSegments>
</requestFiltering>
</security>
<!-- Make sure error responses are left untouched -->
<httpErrors existingResponse="PassThrough" />
<!--
You can control how Node is hosted within IIS using the following options:
* watchedFiles: semi-colon separated list of files that will be watched for changes to restart the server
* node_env: will be propagated to node as NODE_ENV environment variable
* debuggingEnabled - controls whether the built-in debugger is enabled
See https://github.com/tjanczuk/iisnode/blob/master/src/samples/configuration/web.config for a full list of options
-->
<!-- Runs node processes on each core you have in the machine -->
<iisnode watchedFiles="web.config" nodeProcessCountPerApplication="0"/>
</system.webServer>
</configuration>
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels