Hello AEM community,
I'm encountering an issue where a workflow instance keeps running even after I restart the bundle in AEM. I've tried various troubleshooting steps like terminating the instance, purging active instances, and restarting the AEM instance itself, but none of these actions seem to resolve the problem. Interestingly, the issue is temporarily fixed after a full machine restart and setting up AEM again, but it eventually recurs.
Has anyone else faced this problem before? What steps or solutions have you used to resolve this issue permanently?
Any help or suggestions would be greatly appreciated!
Thanks in advance!
Views
Replies
Total Likes
Hi @lavanya-merkle ,
There could be multiple reason for active workflows
1. Workflow session is not properly closed in a custom workflow process step, it may cause an infinite loop.
Solution: Ensure that all session.logout() and resourceResolver.close() calls are properly executed
2. If you have any custom event listeners in your OSGi services that might be triggering workflow executions.
Solution: Disable them temporarily and see if the issue persists.
3. Even after terminating the workflow, some instances might not be properly removed from the repository.
Solution: Purge old/completed workflow instances. Also go to crx/de (/var/workflow/instances) and delete any stuck or old workflow instances manually.
4. If the workflow execution is stuck due to a process step failing, it may cause the instance to keep running indefinitely.
Solution: Checking for any workflows in a RUNNING state, and manually forcing completion.
Regards,
Can you check your workflow launcher configuration as well. You may have a condition to trigger that workflow.
Thanks
Narendra
Views
Replies
Total Likes
Views
Replies
Total Likes
@lavanya-merkle The most probable reason for workflow stuck in infinite execution is, there could be an exception somewhere in the code(in workflow or service/util referred in workflow). Particularly in workflows, if any exception occurs, then it will go to the try block and it will keep retrying the same code again and it will end up with same exception and repeats same again.
1. Open error.log and see at which line the exception is thrown and handle it properly.
2. Use finally block to prevent the re-execution.
3. If you want to terminate the instance, you can identify the workflow in instances and in /var/workflow/instances and you can delete manually.
Thanks,
Ramesh.
Thanks,
Ramesh.
Views
Replies
Total Likes
Please check the workflow queue, it might be possible that queue is blocked due to bundle restart.
Views
Replies
Total Likes
Deleting stuck workflows in AEM from CRXDE involves several steps to ensure that you safely remove the workflow instances without causing inconsistencies in your system.
Manual Deletion via CRXDE:
Always ensure you have a recent backup before making significant changes.
Be cautious when deleting workflows to avoid removing active or necessary instances.