<@ULVA73B9P> I use prefect with an "Azure Containe...
# ask-marvin
b
@Marvin I use prefect with an "Azure Container Instance:push" work pool. Since September 18, even though I didn't change anything in my Docker image, My flow crashes with the following error:
State message: Execution was aborted by a termination signal.
What is going on?
m
From the information available, it appears that the error you're encountering, where flows crash with a termination signal, might be linked to infrastructure provisioning or management issues on Azure when using Prefect's Azure Container Instance (ACI) work pool. Here are some potential causes and solutions: 1. Infrastructure Changes: Even though you haven't changed your Docker image, be aware that infrastructure is dynamic. Azure may have updated their systems or configurations, which could affect the execution of your flows. Therefore, try re-provisioning your infrastructure to ensure it's correctly set up. Source: Prefect 2.x Docs - Provisioning infrastructure 2. State Management and Cleanup: The issue might also be related to state management and unhandled cleanup of resources. Ensure that states transition correctly and any infrastructure is cleaned up properly if the flow crashes. This can be managed using state change hooks to handle cleanup tasks in case of failures. Source: Prefect 2.x Docs - State Change Hooks 3. Analyze State Transitions: Check the specific state transitions and ensure that nothing is interfering with or abruptly terminating running states. Flows sometimes end up in a
CRASHED
state due to unforeseen issues, which need thorough investigation. Source: Prefect 2.x Docs - States 4. Manual Management of Resources: If using Prefect 3.x or considering an upgrade, review the methods for handling automatic infrastructure provisioning and see if any manual management might help stabilize the pipeline. Source: Prefect 3.x Docs - Serverless Infrastructure 5. Troubleshoot Connection Issues: Generic connection issues during flow execution can also cause termination signals. This might need more focused troubleshooting on the network or the interaction between Prefect and Azure. Source: Prefect 3.x Docs - Troubleshoot Cloud If the problem persists, consider reaching out to Prefect's support with detailed logs and error messages for more tailored advice.
b
Any idea how I could log relevant information from a container run? The container instance is deleted as soon as the flow run is over
m
Hi @Baptiste Ottino, have you had any luck finding out how to log info from a container run? I have looked at the base job template for 'azure-container-instance:push', but it does not appear to have the option to log to a Azure's Log Analytics Workspace...
b
@Michal Drobena Hi. Unfortunately, I didn't find a way. That's because Prefect doesn't expose many options in the ARM template it uses to create the ACI. Ideally, I would like to pass a
log-analytics-workspace
and
log-analytics-workspace-key
arguments to the template, but that's not supported: https://github.com/PrefectHQ/prefect/blob/main/src/integrations/prefect-azure/prefect_azure/workers/container_instance.py#L152
@Michal Drobena I found a convincing way to do it: • create a new Log Analytics workspace • create an Azure Policy assignment for the built-in policy called "Configure diagnostics for container group to log analytics workspace". This policy, whenever a container group is created, will append the workspace id and the workspace key you need. Restrict the scope of the assignment to the resource group in which your container groups are created. • the logs will appear in you Log Analytics workspace
🙌 1