Invalid license signature only for OCR

Hi there,

we came into an issue after the upgrade of Aspose.OCR from 25.9.1 to 26.1.0:

In a Docker Environment we get from time to time (~0.02%) the following error when calling Aspose.OCR.License.SetLicense(String licenseName).

We have a class that sets the license on initialization on all products, and we get from time to time the named error, only for OCR, never for the other products:


    public class AsposeLicense
    {
        protected AsposeLicense() { }

        static AsposeLicense()
        {
            var wordsLicense = new Aspose.Words.License();
            wordsLicense.SetLicense("Aspose.Total.lic");

            var cellsLicense = new Aspose.Cells.License();
            cellsLicense.SetLicense("Aspose.Total.lic");

            var slidesLicense = new Aspose.Slides.License();
            slidesLicense.SetLicense("Aspose.Total.lic");

            var pdfLicense = new Aspose.Pdf.License();
            pdfLicense.SetLicense("Aspose.Total.lic");

            var imagingLicense = new Aspose.Imaging.License();
            imagingLicense.SetLicense("Aspose.Total.lic");

            var ocrLicense = new Aspose.OCR.License();
            ocrLicense.SetLicense("Aspose.Total.lic");
        }
    }

I can revert the version of course, but maybe you can give some insight?

Hello. Tell me if you are using the full version of Aspose.OCR or the plugin. Also, could you share what error you are getting? Maybe the whole stack

I am using Aspose.Total for .NET

This is the stack trace, but it’s not very helpful:

System.InvalidOperationException: Failed to set license. Details: Invalid license signature.Please make sure the license file was not modified.
at Aspose.OCR.License.SetLicense(String licenseName)
at Cloudworx.Components.WordMailMerger…ctor(DataParser dataParser) in /src/Components/Words.cs:line 57
at WebApi.Endpoints.WordMailMergerEndpoints.<>c__DisplayClass1_0.b__0(List1 filePaths) in /src/WebApi/Endpoints/WordMailMergerEndpoints.cs:line 36 at WebApi.Endpoints.EndpointHelpers.HandleFileUploadRequest(IFormFileCollection files, String jsonContent, ILogger logger, Func2 processFilesAction) in /src/WebApi/Endpoints/EndpointHelpers.cs:line 46

@daniel.castilla
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): OCRNET-1190

Hello,

At the moment, we have reviewed the changes introduced between versions 25.9.0 and 26.2.0, and we did not find any changes related to licensing. Because of that, we are not yet able to identify the exact cause of the issue.

We would like to ask you to make a small change in the code: please change the order of license initialization and make sure that Aspose.OCR is not the last product in the list. This will help us verify whether the issue could be related to the initialization order.

We would also like to clarify one more point: the exception is thrown at the very first stage, during the license loading step, and not later during recognition or when creating the AsposeOcr() object. Is that correct?

I just changed the order of the license initialization and will check if I get the error happens again in the next days or if the error changes.

We would also like to clarify one more point: the exception is thrown at the very first stage, during the license loading step , and not later during recognition or when creating the AsposeOcr() object. Is that correct?

Yes, that is correct.

Good, waiting for your feedback

We haven’t experienced the issue for the last six days. Either changing the order resolved the issue, or something in the last deployment process was different, which we are unaware of. So I would say the ticket is closed, as we can’t really find a culprit.

Okay, if the problem occurs again, please contact me again.