/v5.0/RecognizePdf returns "AttributeError(“‘list’ object has no attribute ‘Error’”) "

Starting from 13/12/2024 endpoint GET http://api.aspose.cloud/v5.0/RecognizePd returns response like:
class OCRResponse {
id: b04d8be2-4d98-48a7-a18e-85c9aad3c4d1
responseStatusCode: Error
taskStatus: Error
results: null
error: class OCRError {
messages: [AttributeError(“‘list’ object has no attribute ‘Error’”)]
warnings: []
}
}

Step to reproduce:

  1. Do POST http://api.aspose.cloud/v5.0/RecognizePdf - it returned taskId
  2. Check status for given taskId using GET http://api.aspose.cloud/v5.0/RecognizePdf

First time it returns: “taskStatus: Pending”
After a while it gives error described above.

It was working 10/12/2024.

Please check.

@Legitech

It seems you are encountering an error when trying to check the status of a PDF recognition task using the Aspose OCR Cloud API. The error message indicates that there is an AttributeError related to a list object not having an ‘Error’ attribute.

Here are some steps you can take to troubleshoot this issue:

  1. Check API Version: Ensure that you are using the correct version of the API. Since you mentioned that it was working on 10/12/2024, verify if there have been any updates or changes to the API that might affect its functionality.

  2. Review Task Status: When you receive a “taskStatus: Pending” response, it indicates that the task is still being processed. If it later returns an error, it could be due to the task taking too long or encountering an issue during processing. Consider implementing a retry mechanism to check the status after a longer interval.

  3. Inspect Input PDF: Ensure that the PDF file you are trying to process is valid and not corrupted. Sometimes, issues with the input file can lead to errors during processing.

  4. Error Handling: Implement error handling in your code to capture and log the full response from the API. This can provide more context about the error and help in diagnosing the issue.

  5. Contact Support: If the problem persists, consider reaching out to Aspose support with the details of your request, including the task ID and the exact error message you are receiving. They may be able to provide more specific guidance or identify if there is a known issue with the API.

If you have any further questions or need additional assistance, feel free to ask!

I changed my settings to the following one:
OCRSettingsRecognizePdf settings = new OCRSettingsRecognizePdf();

    settings.setDsrConfidence(DsrConfidence.HIGH);
    settings.setDsrMode(DsrMode.TEXT_DETECTOR);
    settings.setMakeBinarization(false);
    settings.setMakeSkewCorrect(false); 
    settings.setMakeContrastCorrection(false);
    settings.setMakeUpsampling(false); 
    settings.setResultType(ResultType.TEXT);

After change It started working but for couple of days. Today it starts again to return the same error. I change nothing in my parameters or API version, just make tests for OCR recognition with more data.
I do tests with same documents but API response changed from COMPLETED to error as I mentioned above.

Could you check from your side please. Quick search in google give results related to python syntax errors.

I have checked today and try to re-launch OCR process for the same PDF several times. It randomly gets 3 state:

  1. Error: Timeout
  2. Error: AttributeError(“‘list’ object has no attribute ‘Error’”)
  3. Completed

It is just small PDF with 2 pages.

Please check on your end, last taskID: ac090d1c-86bc-4cdd-98a1-4aa609392bec