Occasionally, the BotCity Runner may appear stuck after retrieving a new task from the queue. In these cases, the status remains as:
Executing task...
and the automation does not actually start until the Runner is manually restarted.
This issue is often caused by resources not being properly released at the end of the previous automation. When the script tries to access those same resources again, the operating system may block the action, believing the resources are still in use.
One of the most frequent scenarios involves the WebDriver used in web automation:
If the WebDriver instance is not terminated properly, it may remain running in the background.
This leads to conflicts during the next execution attempt and can cause the Runner to freeze.
To avoid this issue, it’s important to include code that reliably releases all allocated resources, even in the event of an exception.
For example, in Python:
from selenium import webdriver
driver = webdriver.Chrome()
try:
# your automation logic
pass
finally:
driver.quit() # Ensures the WebDriver is closed
Using try...finally
blocks or context managers will help maintain a clean environment for each task execution.
Once a task is retrieved by the BotCity Runner, it transitions to the Running
status. It is the developer's responsibility to inform BotCity Maestro about the final outcome of that task using the Maestro SDK.
Doing so allows for:
Accurate task tracking
Visibility into task outcomes for stakeholders
Metrics that can be analyzed in BotCity Insights
You can finalize a task with one of the following statuses:
SUCCESS
: Task completed successfully.
FAILED
: Task failed to complete.
PARTIALLY_COMPLETED
: Task completed some, but not all steps.
In Python:
You can define what an "item" means in your automation (e.g., a file, a record, an email, etc.) and track performance accordingly.
This feature is tightly integrated with BotCity Insights, which provides real-time dashboards and performance metrics for your RPA initiatives.
If the Runner appears to be stuck, always check the generated log.txt
file. This file often contains useful exception traces or system messages that can help pinpoint the exact issue during the preparation or execution phase.
When the Runner is stuck at "Executing task...", it’s often due to leftover system resources or an improperly finalized previous execution. Ensuring proper cleanup of all resources and reporting the task status via the Maestro SDK not only prevents these issues but also contributes to more effective task monitoring and analytics through BotCity Insights.