"Operation Does Not Exist" when Splitting Slides Asynchronously in Java

We have been using a slides split operation of the async api. It was working correctly earlier, but today we are getting operation not found error:

Here is the code to initiate the split process after uploading the file.

String operationId = slidesAsyncApi.startSplit(filePath, 
        resolveExportFormat(docFormat), null, null, null, null, null, 
        destFolder, null, null, asposeStorageName, null);

Operation opStatus = slidesAsyncApi.getOperationStatus(operationId);

Below is the error message:

Caused by: com.aspose.slides.ApiException: Operation does not exist
at com.aspose.slides.ApiClient.handleResponse(ApiClient.java:904) ~[aspose-slides-cloud-24.12.0.jar:?]
at com.aspose.slides.ApiClient.execute(ApiClient.java:781) ~[aspose-slides-cloud-24.12.0.jar:?]
at com.aspose.slides.api.SlidesAsyncApi.getOperationStatusWithHttpInfo(SlidesAsyncApi.java:383) ~[aspose-slides-cloud-24.12.0.jar:?]
at com.aspose.slides.api.SlidesAsyncApi.getOperationStatus(SlidesAsyncApi.java:365) ~[aspose-slides-cloud-24.12.0.jar:?]
at com.enablix.aspose.AsposeService.checkAndProcessSplitOperation(AsposeService.java:331) ~[classes/:?]

We can see the folder created with the operation id under the async_operations folder in the file storage.

@enablix

The “Operation not found” error you are encountering typically indicates that the operation ID you are trying to check does not exist or has expired. This can happen for several reasons:

  1. Operation ID Expiration: If the operation takes too long to complete, the ID may expire. Ensure that you are checking the operation status promptly after starting the operation.

  2. Incorrect Operation ID: Double-check that the operation ID you are using to check the status is the same one returned when you initiated the split operation.

  3. Service Issues: Occasionally, there may be temporary issues with the service that could lead to this error. You might want to check the service status or try again later.

To troubleshoot this issue, you can implement a retry mechanism in your code to handle cases where the operation ID might not be found immediately. Here’s an example of how you might modify your code to include retries:

String operationId = slidesAsyncApi.startSplit(filePath, resolveExportFormat(docFormat), 
                null, null, null, null, null, destFolder, null, null, asposeStorageName, null);

Operation opStatus = null;
int maxRetries = 5;
int retryCount = 0;

while (retryCount < maxRetries) {
    try {
        opStatus = slidesAsyncApi.getOperationStatus(operationId);
        if (opStatus != null && opStatus.getStatus() != Operation.StatusEnum.Created) {
            break; // Exit loop if operation is no longer in the created state
        }
    } catch (ApiException e) {
        // Handle specific API exceptions if necessary
    }
    Thread.sleep(3000); // Wait before retrying
    retryCount++;
}

if (opStatus == null || opStatus.getStatus() == Operation.StatusEnum.Failed) {
    // Handle the failure case
    System.out.println("Operation failed or does not exist.");
} else {
    // Proceed with the successful operation
}

This code snippet includes a retry mechanism that checks the operation status multiple times before concluding that the operation has failed or does not exist. Adjust the maxRetries and sleep duration as needed based on your application’s requirements.

If the problem persists, consider reaching out to Aspose support for further assistance, providing them with the operation ID and any relevant details about your request.

Sources:

Here are couple of operation ids which are returning operation does not exist error:

“1da67a80-ad81-4477-826a-c341db2ca1e3”
“39eb7781-7849-446c-a1d6-4ec38c134932”

I had the same for around an hour for every operation I started, then it suddenly worked without anything changed on my side…

@enablix, @a.hellmann,
Thank you for reporting on the issue. We are sorry that you encountered this problem.

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): SLIDESCLOUD-2011

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Exactly right now, I have the same issue with every operation I start. Already got calls by my users, so it comes from my prod system where no changes where done.

Based on support calls on my side, it started somewhere around an hour ago.

Is there any idea what causes it? Otherwise I have to implement some retry logic to retry it an hour later. But that is really bad user experience…

@andrey.potapov

This is an example operation id:
9caf5d94-6520-4155-aed9-1a40b8f6abb0

@a.hellmann,
Thank you for your messages. I’ve forwarded them to our developers. We need some time to investigate these cases. I will keep you updated. We apologize for any inconvenience caused.

@andrey.potapov Cool. Thank you. I will wait. Are there any other users experiencing this or am I the only one at the moment?

If you need any further assistance on my side to investigate the issue, or some of the devs wants to contact me, feel free! I am eager to help to fix this issue as it happens the second time. It’s kind of hard to explain to our users why it does not work :slight_smile:

Regards!
Artur

@andrey.potapov
It started working again. So whatever has been done, it fixed it. :smiley:

@a.hellmann,

Fortunately, there have been no similar messages from other users yet.

Our developers have sorted out this problem. The issue should be resolved now. We apologize again for any inconvenience caused.

Nice! Thank you all again!

You all do a great Job!

1 Like