Aspose on premise approach giving red message boxes in converted pdf

Hi team,

We are using on premise approach for converting docx to pdf. Yesterday, we started seeing red message boxes in the converted pdfs in production. Our credits were not completely utilized as can be seen from the ss attached below. We use aspose words on premise approach, docker image: docker.io/aspose/words-cloud:24.9

Adding the logs below for the pods. This was resolved by redeploying the pods but it shouldn’t have happened in the first place as we didn’t exceed our credit limit. Please get it checked.

image.jpg (129.1 KB)

image.jpg (222.2 KB)

In other pod, we were seeing below logs:
asposeforcloud6fbd614989c44e879a4e2a06d4b61ded, YgU0L8YBX6UAIPrzOHhjqKexsAiiJqtaEcdqRflJlLZT695VgeHdNGZZNu6xDpT2APptWzKVeqgaaJxbno0iAAzMS87C0jVWWtqJjMlX69cmAsQSFKhLKZjHKlZtxwp1EZFlMotzQBMjdgaPFyuJGnwIMotbldLdU-sP*-GxY_
Metered license is set
Credit: 21
Consumption quantity: 2.4610
LicenseInitializer:InitLicense() - Metered license for Aspose.Barcode successfully initialized.
Hosting environment: Production
Content root path: /app
Now listening on: [http://%5B::%5D:80]http://[::]:80
Application started. Press Ctrl+C to shut down.
fail: Aspose.Words.Cloud.WebApp.Filters.CoreResultExceptionFilter[0]
api exception
Aspose.Words.Cloud.Exceptions.WordsApiException: Error while loading file ‘Air Invoice - Foreign Rev1 Test.docx-c709ed77a9cb23ad-rexfqf.docx’ from storage: Unexpected end of file has occurred. The following elements are not closed: w:tbl, w:body, w:document. Line 2, position 98624.
—> System.Xml.XmlException: Unexpected end of file has occurred. The following elements are not closed: w:tbl, w:body, w:document. Line 2, position 98624.
at Aspose.Words.Document.M3(Stream d, LoadOptions v)
at Aspose.Words.Cloud.Business.DocumentCore…(Stream )
at Aspose.Words.Cloud.Storage.FileManagerExtensions.LoadDocument[T](IFileManager , String, Func2 ) --- End of inner exception stack trace --- at Aspose.Words.Cloud.Storage.FileManagerExtensions.LoadDocument[T](IFileManager , String, Func2 )
at Aspose.Words.Cloud.Business.DocumentCore.LoadDocument(String , Boolean&, Int64& , FileFormatInfo& , Boolean )
at Aspose.Words.Cloud.Business.WordsDocument.()
at Aspose.Words.Cloud.WordsApiController.GetWordsDocument(IFileManager fileManager, String path, Boolean convertMetafilesToPng, String encryptedPassword, String password, Boolean forceSpecifiedPassword)
at Aspose.Words.Cloud.DocumentActions.Convert.ConvertController…MoveNext()
— End of stack trace from previous location —

PLEASE NOTE: THIS IS A REPEATED ISSUE. OUR BUSINESS IS SERIOUSLY BEING IMPACTED.

Sorry for the inconvenience. In the 24.11 docker hub version, we will introduce a new field in the words/info endpoint, showing whether the license is set. Also, in the docker hub version, such an error may occur if the container can’t send data to the billing for 24 hours.

Hi. Any idea how can we avoid for future? And also, how did it got fixed after redeploying the aspose words pods?

You can set up a health check for your container to check if a license is okay when the container has already started, there is an API method to check information about the license. The URL is GET https://customeraddress.com /v4.0/words/info. It requires an authorization token, so we must first obtain it by /connect/token URL.
result will be like this:
{
“Name”: “Aspose.Words Cloud API”,
“Version”: “24.9.0”,
“AdditionalInfo”: [
{
“Key”: “ConsumptionCredit”,
“Value”: “0”
},
{
“Key”: “ConsumptionQuantity”,
“Value”: “0.0498”
}
],
“RequestId”: “77362525-9fc9-401c-af80-7aa550ee728f”
}
In this method, we will add the IsMeteredLicensed field along with “ConsumptionQuantity” so you can check this new field if it is False, your container failed to send data to billing for the previous 24 hours, and you should restart the container.

hi. Thanks for this suggestion. But question is, how come it suddenly stopped sending data like it’s running fine for almost a month. Is it a known issue?

There were a couple of times when customers observed the same behavior, and our billing team found out that it happened because the container didn’t send data; I will contact them to check the billing logs for your account.

1 Like

Thank you for your prompt response.

Hey, I am trying to implement this approach. Can you share wiki documentation or any description/CURL for above api to implement?

Also, What do you suggest? Like should it run like after every hour and should our pod try to hit this URL and check it’s response? Also, what should be done if we get a false value in flag? Should we manually restart or is there a better suggestion?

Now, the info method also returns the field “IsMeteredLicensed.” If it is false, it means something wrong happened in communication between your pod and billing service; the easiest way to fix it is to restart the container.

For on premise, my requests look like these:

const asposeHtmlToExcelUrl = baseUrl + ‘/v3.0/cells/convert?format=XLSX&checkExcelRestriction=true&streamFormat=html’
var configuration = {
method: ‘put’,
url: asposeHtmlToExcelUrl,
headers: {
‘accept’: ‘multipart/form-data’,
‘Content-Type’: ‘multipart/form-data’,
…data.getHeaders()
},
data: data,
responseType : ‘stream’
};

Where baseUrl is something like: http://aspose-cells-cloud.document-service-backend-${ appEnv }.svc.cluster.local;

basically: http://aspose-words-cloud.<backend_container>.svc.cluster.local

We don’t use any token in this case. How to make a call from this pod to the said URL then?

I do not know how to implement this for cell service; you better contact them via the forum.

I mean cells or words, I should implement for all. I provided code just for reference. I got this issue in words which is implemented in similar fashion.

Edit: This has happened multiple times at random and our business is getting impacted by this. We need to have a handling mechanism for this so it is very important for us.

You should call baseUrl + /v4.0/words/info and set authToken, which you should get before from /connect/token

ok. let me try.

Hey. I am able to hit the URL and getting response. Thank you for your help.

One clarification needed, so let’s say IsMeteredLicensed is false, they will the requests immediately start showing the red messages, or it will happen in next 24 hours. This is because, we might also want to set an interval for making this call periodically. So we are thinking what should we do in case when IsMeteredLicensed is false.

If you have some suggestion please let us know, as restarting containers automatically might not be possible for us.

Edit: Response
{
“Name”: “Aspose.Words Cloud API”,
“Version”: “24.12.0”,
“AdditionalInfo”: [
{
“Key”: “ConsumptionCredit”,
“Value”: “13701”
},
{
“Key”: “ConsumptionQuantity”,
“Value”: “6470.9579”
},
{
“Key”: “IsMeteredLicensed”,
“Value”: “True”
}
],
“RequestId”: “d046c954-4490-4b5e-bb2a-6a6bc225a0da”
}

When “Key”: “IsMeteredLicensed” is false, the container can’t send statistics to the billing service for 24 hours, and the application will add a red message whenever the license is not set again.
So, if you call this URL once every 24 hours, it should be enough for the container to be always licensed.

1 Like

Thank you for your reply. If I understand correctly, hitting this api URL once in 24 hours, will give billing service the statistics and we will never face this issue, correct? or i want to understand like even after doing this, is their still a possibility that IsMeteredLicensed comes as false? And what could be the reasons why this comes as false?

This issue is sporadic, so we now know only one reason why it is happening - the container cannot send data.
So, if it happens even with IsMeteredLicensed, it is true, so we will consider a deeper analysis.

Hey, One question. So I got above response which I shared by running the curl in our backend pod. So if you see this URL in the curl:
curl --location 'http://aspose-words-cloud.document-service-backend-qa.svc.cluster.local/v4.0/words/info'

It is calling aspose pod as this is the way on premise is implemented. My question is, can I do similar thing in aspose pod itself? Like I am not able to run this CURL in aspose pod. I want to do something like liveliness probe based on some condition so was hoping if there is a way to trigger this in aspose pod itself.

You may try to set up a liveness probe that will call specific API URL like /v4.0/words/info; I will ask our devops team if they can share some solutions.