多年来我一直对 Azure SDK 感到非常沮丧,我一直在使用它,但仍然会出现将错误输出到日志文件的问题:
Application has thrown an uncaught exception and is terminated:
Error: ENOENT, no such file or directory 'C:\DWASFiles\Sites\pazooza\VirtualDirectory0\site\wwwroot\iisnode\RD00155D4313F9-20848-stdout-Tue Mar 26 2013 03:10:56 GMT+0000 (GMT Standard Time).txt'
at Object.openSync (fs.js:240:18)
at Object.writeFileSync (fs.js:628:15)
at SyncWriteStream.<anonymous> (D:\Program Files (x86)\iisnode\interceptor.js:181:20)
at Object.<anonymous> (console.js:25:18)
at IncomingMessage.<anonymous> (C:\DWASFiles\Sites\pazooza\VirtualDirectory0\site\wwwroot\utils\facebook.js:69:21)
at IncomingMessage.emit (events.js:88:20)
at HTTPParser.parserOnMessageComplete [as onMessageComplete] (http.js:130:23)
at CleartextStream.socketOnData [as ondata] (http.js:1288:20)
at CleartextStream._push (tls.js:375:27)
at SecurePair.cycle (tls.js:734:20)
如您所见,发生错误是因为 fs 对象正在尝试查找 c: 驱动器上的内容,指向我的本地计算机的 c: 驱动器是什么与假设在 Azure 网站中的日志记录系统有关?
和 D:\Program Files (x86)\iisnode\interceptor.js
它不应该指向 Azure 云网站实例中的资源吗?
Azure SDK 中的任何人都可以告诉我如何消除此错误。
几个月前我问过这个问题,我们认为我们现在已经修复它了......非常令人沮丧的微软......你们是为了让我们的生活更轻松吗?
我在这里的其他问题导致了这个问题:
Webmatrix 2 损坏和 Windows Azure Node.js 内部服务器错误
我的 node.js web.config 文件如下所示:
<configuration>
<system.webServer>
<handlers>
<!-- indicates that the server.js file is a node.js application to be handled by the iisnode module -->
<add name="iisnode" path="server.js" verb="*" modules="iisnode"/>
</handlers>
<rewrite>
<rules>
<!-- Don't interfere with requests for node-inspector debugging -->
<rule name="NodeInspector" patternSyntax="ECMAScript" stopProcessing="true">
<match url="^server.js\/debug[\/]?" />
</rule>
<!-- First we consider whether the incoming URL matches a physical file in the /public folder -->
<rule name="StaticContent">
<action type="Rewrite" url="public{{REQUEST_URI}}"/>
</rule>
<!-- All other URLs are mapped to the Node.js application entry point -->
<rule name="DynamicContent">
<conditions>
<add input="{{REQUEST_FILENAME}}" matchType="IsFile" negate="True"/>
</conditions>
<action type="Rewrite" url="server.js"/>
</rule>
</rules>
</rewrite>
<!-- You can control how Node is hosted within IIS using the following options -->
<iisnode
loggingEnabled="true"
devErrorsEnabled="true"
/>
</system.webServer>
</configuration>
任何关于为什么在我设置 logginEnabled="true" 时出现此错误的帮助或建议将不胜感激。
当我将 loggingEnabled 设置为 false 时,没有错误并且站点运行良好,但是当它打开时,一切都变得糟糕了!