Exception trying to convert html to pdf

We are converting with local files and are getting an exception deep in NewtonSoft for parsing the JSON??? - I believe this JSON parsing is failing after a 504 Gateway Time-out (using Fiddler) for uploading the html (very small 5959 content size)

Simple Code:

                ConvertApi htmlApi = new HtmlApi(wordApiKey!, wordApiSecret!).ConvertApi;
                ConverterBuilder converterBuilder = new ConverterBuilder()
                    .FromLocalFile(decisionLetterHtmlFilePath)
                    .ToLocalFile(decisionLetterPdfFilePath);

                ConvertResult convertResult = await htmlApi.ConvertAsync(converterBuilder);

Exception Message:

Unexpected character encountered while parsing value: <. Path '', line 0, position 0.

Exception Call Stack

at Newtonsoft.Json.JsonTextReader.ParseValue()
   at Newtonsoft.Json.JsonReader.ReadAndMoveToContent()
   at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
   at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
   at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value)
   at Aspose.HTML.Cloud.Sdk.Runtime.ApiInvoker`1.CallPostAsync(String url, HttpContent content)
   at Aspose.HTML.Cloud.Sdk.Runtime.ApiInvoker`1.CallPostAsync(RequestUrlBuilder urlBuilder, HttpContent content)
   at Aspose.HTML.Cloud.Sdk.Services.StorageService.<>c__DisplayClass21_0.<<UploadFileAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Aspose.HTML.Cloud.Sdk.Services.StorageService.UploadFileAsync(String file, String remoteFileUri, String storageName)
   at Aspose.HTML.Cloud.Sdk.StorageApi.UploadFileAsync(String file, String remoteFileUri, String storageName)
   at Aspose.HTML.Cloud.Sdk.Services.ConversionService.UploadAsync(String folder, String basePath, String[] files)
   at Aspose.HTML.Cloud.Sdk.Services.ConversionService.PrepareRequestBodyAsync(ConverterBuilder builder)
   at Aspose.HTML.Cloud.Sdk.Services.ConversionService.<>c__DisplayClass12_0.<<ExecuteConversionAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Aspose.HTML.Cloud.Sdk.Services.ConversionService.ExecuteConversionAsync(ConverterBuilder builder, IObserver`1 observer)
   at Aspose.HTML.Cloud.Sdk.Services.ConversionService.ConvertAsync(ConverterBuilder builder, IObserver`1 observer)
   at Aspose.HTML.Cloud.Sdk.ConvertApi.ConvertAsync(ConverterBuilder builder, IObserver`1 observer)
   at srs_frontend.Utilities.SubmissionEditorDecisionFileUtilities.GetDecisionLetterAsPdfAsync(Nullable`1 editorDecisionId, String versionTrackingNumber, CancellationToken cancellationToken) in C:\Dev\Git\srs-project\srs-frontend\Utilities\SubmissionEditorDecisionFileUtilities.cs:line 193

Fiddler Request header

POST https://api.aspose.cloud/v4.0/html/file?path=b789e8a0-666e-4a12-962d-d1c2c59fe0fc%2F HTTP/1.1
Host: api.aspose.cloud
Authorization: Bearer 
<a class="attachment" href="/uploads/aspose_cloud/10372">AsposeGatewayTimeout.jpg</a> (208.5 KB)

REDACTED
traceparent:  REDACTED
Content-Type: multipart/form-data; boundary="18bbf5b6-6b13-4d1f-ae06-409bb242e5d1"
Content-Length: 5959

Fiddler Response

HTTP/1.1 504 Gateway Time-out
server: nginx/1.19.9
date: Thu, 10 Jul 2025 16:45:56 GMT
content-type: text/html
content-length: 167
x-lb: TLR

I’ve attached the html file from this example (all our conversions fail though) as a zip
Fiddler image of the Gateway Time-out

NOTE:
I tried your free HTML to PDF website with the same local fie and it fails too - well never succeeds - just spins forever

AsposeGatewayTimeout.jpg (208.5 KB)

JATIS-250118-1_decisionLetter.zip (2.4 KB)

Hi @glenngatspie Please check now. It must be back to normal. If something doesn’t work please let us know

Verified that is started working again

@andrey.gubal we are seeing this again today

Gateway-Timeout when we are trying to convert HTML to PDF
Our code hasn’t changed, same api keys, same code as posted above

Are we doing something wrong? Do you see errors in your server logs for this?
Thanks
Glenn - spie.org

504 Gateway Time-out

504 Gateway Time-out


nginx/1.19.9

Hi @glenngatspie please check if it works for you now

@andrey.gubal
Could you please help us understand the underlying cause of these failures and what steps are being taken (or can be taken) to ensure improved stability moving forward?

We’ve been experiencing recurring issues with this in our production environment, which have unfortunately led to business disruptions on our end. Given the critical role this package plays in our operations, we’re concerned about the frequency and impact of these breakdowns. We’re eager to work with your team to find a sustainable resolution as soon as possible.

Also, confirmed that it is working this morning for us

@glenngatspie Hi, thank your for the trust and a willing to help. Highly appreciated. Of course we can’t involve your help unfortunately, but our team is working to make adjustments to our responsible infrastructure to resolve this issue. We expect release within 10 days.