简体   繁体   English

使用Microsoft.AspNetCore.NodeServices调用JS文件时,获取节点调用超时错误

[英]Getting Node invocation timed out error when invoking JS file using Microsoft.AspNetCore.NodeServices

Title Getting Node invocation timed out error when invoking JS file using Microsoft.AspNetCore.NodeServices 使用Microsoft.AspNetCore.NodeServices调用JS文件时, 标题获取节点调用超时错误

Functional impact I developed application which is using NodeServices and deployed it on Azure using following article: https://code.msdn.microsoft.com/How-to-export-HTML-to-PDF-c5afd0ce 功能影响我开发了使用NodeServices的应用程序,并使用以下文章将其部署在Azure上: https ://code.msdn.microsoft.com/How-to-export-HTML-to-PDF-c5afd0ce

It's working locally, but not on deployed version. 它在本地运行,但不适用于已部署的版本。 Getting node time out error: 获取节点超时错误:

The Node invocation timed out after 60000ms.
You can change the timeout duration by setting the InvocationTimeoutMilliseconds property on NodeServicesOptions.
The first debugging step is to ensure that your Node.js function always invokes the supplied callback (or throws an exception synchronously), even if it encounters an error. Otherwise, the .NET code has no way to know that it is finished or has failed. | Source: Microsoft.AspNetCore.NodeServices

Expected result PDF should be created. 预期结果 PDF应该被创建。

Actual result NodeService throwing timeout error 实际结果 NodeService抛出超时错误

But still getting Timeout error on deployed version. 但是仍然在部署版本上出现超时错误。 Any help would be appreciated. 任何帮助,将不胜感激。 Thanks. 谢谢。

You can specify a timeout when adding NodeServices to the service container - You can also set an ILogger there which might help you debug the problem : 您可以在将NodeServices添加到服务容器时指定超时-您还可以在那里设置ILogger,这可能有助于您调试问题:

services.AddNodeServices(options =>
{
    options.InvocationTimeoutMilliseconds = TimeSpan.FromMinutes(5).Milliseconds;
    options.NodeInstanceOutputLogger = log;

});

PhantomJS is not supported on Azure Web App. Azure Web App不支持PhantomJS。 More information here . 更多信息在这里
I ended up using Azure Web App for Containers . 我最终将Azure Web App用于容器

Here's my blogpost on how to do it in ASP.NET Core using NodeServices on docker: Link . 这是我的博客文章,介绍如何在Docker上使用NodeServices在ASP.NET Core中执行此操作: Link
(It uses another node package though). (尽管它使用另一个节点包)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何解决“ Microsoft.AspNetCore.NodeServices.HostingModels.NodeInvocationException” - How do i solve 'Microsoft.AspNetCore.NodeServices.HostingModels.NodeInvocationException' AspNetCore(Kestrel)请求超时 - AspNetCore (Kestrel) request timed out 使用 ASP.NET Core NodeServices 时配置节点 HTTP 服务器超时 - Configure Node HTTP server timeout when using ASP.NET Core NodeServices 使用带有 C# 的电报机器人出现错误“请求超时”? - Getting error “Request timed out” using telegram bot with c#? 调用“选择文件”对话框时出现NullReferenceException错误 - Getting a NullReferenceException Error when invoking a Select File Dialog Box 使用Microsoft.AspNetCore.Authentication.AzureADB2C.UI时如何覆盖/替换错误页面处理? - How to override / substitute Error Page handling when using the Microsoft.AspNetCore.Authentication.AzureADB2C.UI? 使用SQLBulkCopy将数据插入到Azure SQL数据库表中时,出现错误消息“等待操作超时”? - When inserting data using SQLBulkCopy into an Azure SQL Database table I am getting an error message “The wait operation timed out”? JSon调用时请求超时错误 - Request Timed Out error when JSon Call 使用WebClient下载时操作超时错误 - Operation timed out error when downloading with WebClient 使用 SmtpClient 时“操作超时” - “The operations timed out” when using SmtpClient
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM