socket hang up

  • Hi, I have a problem converting an html to pdf in a .NetCore application.
    The html is too big and the error "The response ended prematurely" or "socket hang up" occurs.
    errors always occur after 20 minutes.
    below the errors and my configuration.

    Erros :

    As AsWebService:

    fail: Microsoft.AspNetCore.Server.Kestrel[13]
    Connection id "0HMAO7OGP8AU9", Request id "0HMAO7OGP8AU9:00000001": An unhandled exception was thrown by the application.
    System.Net.Http.HttpRequestException: An error occurred while sending the request.
    ---> System.IO.IOException: The response ended prematurely.
    at System.Net.Http.HttpConnection.FillAsync(Boolean async)
    at System.Net.Http.HttpConnection.ReadNextResponseHeaderLineAsync(Boolean async, Boolean foldedHeadersAllowed)
    at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
    --- End of inner exception stack trace ---

    As AsUtility:

    jsreport.Local.JsReportBinaryException: Error rendering report: instance has been daemonized and initialized successfully (pid: 111016)rendering has finished with errors:
    A critical error occurred while trying to execute the render command (2). Error while executing request to remote server. socket hang up (1). caused by error (2):-> stackError: at onCriticalError
    (/snapshot/jsreport/node_modules/jsreport-cli/lib/commands/render.js:302:19) at /snapshot/jsreport/node_modules/jsreport-cli/lib/commands/render.js:256:14
    at processTicksAndRejections (internal/process/task_queues.js:97:5)caused by error (1):-> meta = {"config":{"url":"http://localhost:5488/api/report",...




    Can you help me?

  • Could you try this?

    rs.ReportingService.HttpClientTimeout  = TimeSpan.FromMinutes(60);

  • this command is in my configuration, but it doesn't solve this problem. At first image has this same command

  • I apologize for late coming back. It took me a while to figure out what is wrong.
    jsreport has a HTTP request timeout for default 20minutes which needs to be configured as well.
    You can adapt the configuration in c# this way.

    Environment.SetEnvironmentVariable("extensions_express_renderTimeout", "2400000");

  • Hi, now worked correctly.
    I am generate PDFs with 3750 pages.

    Thank so much for your support :)

  • Great! I apologize for the trouble.
    I will make sure this "secret" config isn't needed in the next jsreport@v3.

  • Who's gonna read those 3750 pages. :)

Log in to reply

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.