Change Workflow Rule Error

Can someone help me with the following error. It occurs when a user tried to run a workflow rule that creates a PDF report. Others have been using the report before and after so not sure the issue.

Error: “Jeenee.DataTypes.SpreadsheetException: The underlying connection was closed: An unexpected error occurred on a receive. → The HTML to PDF conversion web service failed to convert the HTML document to PDF for application ‘HarvestInspectionAzure-634705-660349 (02eef9fb-d7fd-4456-99db-4771077a8861)’ due to: The underlying connection was closed: An unexpected error occurred on a receive. —> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. —> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. —> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host\r\n at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)\r\n — End of inner exception stack trace —\r\n at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)\r\n at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size)\r\n at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead)\r\n — End of inner exception stack trace —\r\n at System.Net.WebClient.UploadValues(Uri address, String method, NameValueCollection data)\r\n at Nirvana.Data.PDFEncoder.Encode(Context context, String input, PageOrientationEnum pageOrientation, PageSizeEnum pageSize) in q:\git\Jeenee\V2API\Workflow\Common\PDFEncoder.cs:line 93\r\n — End of inner exception stack trace —\r\n at Nirvana.Data.PDFEncoder.Encode(Context context, String input, PageOrientationEnum pageOrientation, PageSizeEnum pageSize) in q:\git\Jeenee\V2API\Workflow\Common\PDFEncoder.cs:line 110\r\n at Nirvana.Data.WorkflowActionResultEmail.<>c__DisplayClass59_0.b__0() in q:\git\Jeenee\V2API\Workflow\ActionResult\WorkflowActionResultEmail.cs:line 197”

I suggest you reach out to support@appsheet.com directly for this one.

This error indicates that the HTML to PDF conversion service failed when trying to convert your attachment from HTML to PDF.

When the workflow rule runs:

  1. We read the attachment template document and convert it to HTML.
  2. We fill in the HTML document by replacing the variables in your template with the corresponding data values from your tables. This yields the filled in HTML document.
  3. We send the resulting HTML document to a web based HTML to PDF conversion service. After converting the HTML to PDF, the web based conversion service returns the PDF document.
  4. We attach the PDF document to the email as an attachment.
  5. We send the email to the web based email delivery service.

The error indicates that step 3 failed. This happens very rarely. I have no idea exactly why the conversion failed.

I can try to replay the update that triggered the workflow rule. This should fire the workflow rule, recreate the HTML document, and allow me to see if I can reproduce the HTML to PDF conversion problem.

Excellent explanation of how the workflow rule works! This only occurs occasionally and I cannot recreate when I try. Emailing with Dinh, it may be a connectivity issue. My users are foresters often in poor cell location areas (Offline use is a big reason I chose AppSheet). I am going to watch closely and see if I can tie it to connection issues.

Hi Stephen,

The error is happening between our AppSheet servers and the HTML to PDF web service in New Zealand.

I doubt that connectivity with your client devices is contributing to the problem.

I suspect that one of two things is occurring:

  1. It might be an intermittent connectivity issue with the HTML to PDF web service.
  2. It might be a symptom that the HTML to PDF web service is “choking” on something contained in the HTML it is trying to convert to PDF.

I was suggesting that we “replay” the update because it might prove or disprove the second possibility. I assume that replaying the update would recreate the same HTML content that the original update created. If the HTML to PDF web service “choked” on that, then we would know that it was HTML content related. I am not sure how likely this is, but it might be worth trying. Would not want to “replay” the update without your permission. It runs the risk of re-applying an outdated change to your table.

1 Like

Feel free to replay. I did the same after the user notified me and it ran with no issue. I appreciate you looking into this.

Thank you,
Stephen Logan

Hi,

I have just received an error like this twice this morning. The concern I have is that there is no alert that it’s failed unless I know it’s been sent and didn’t arrive. How do I get alerts when WorkFlows failed? Is there a cure for this. The error message is

Error:
“Jeenee.DataTypes.SpreadsheetException: The remote server returned an error: (400) Bad Request. → The HTML to PDF conversion web service failed to convert the HTML document to PDF for application ‘GriffApp-1353866 (4621daba-f1a2-437e-a600-88f43ab47a5b)’ despite 3 retries due to: The remote server returned an error: (400) Bad Request. —> System.Net.WebException: The remote server returned an error: (400) Bad Request.\r\n at System.Net.WebClient.UploadValues(Uri address, String method, NameValueCollection data)\r\n at V2API.Workflow.Pdf.PdfEncoder.EncodePdfRocket(Context context, String input, PageOrientationEnum pageOrientation, PageSizeEnum pageSize, Int32 pageHeight, Int32 pageWidth)\r\n — End of inner exception stack trace —\r\n at V2API.Workflow.Pdf.PdfEncoder.EncodePdfRocket(Context context, String input, PageOrientationEnum pageOrientation, PageSizeEnum pageSize, Int32 pageHeight, Int32 pageWidth)\r\n at V2API.Workflow.Pdf.PdfEncoder.Encode(Context context, String input, PageOrientationEnum pageOrientation, PageSizeEnum pageSize, Int32 pageHeight, Int32 pageWidth)\r\n at Nirvana.Data.TaskResultEmail.<>c__DisplayClass73_0.b__0()”

Please contact support@appsheet.com for help with the error.

There’s no built-in way to get alerted that I know of. You might be able to contrive something with workflows or reports, but I’ve never tried myself, so have no guidance to offer.

1 Like

Thanks Steve.

1 Like