Reputation: 2008
I have a Python Azure Function that is inconsistently running:
The most recent errors show "python exited with code 137":
Why is this happening and how do I fix it?
This Function is running on a premium EP2 App Service Plan with 7GB of memory. Files being moved are no larger than 750MB.
UPDATE 1:
Below is an example of the memory usage profile for the timeline that the function runs are failing. Its unclear to me how moving a ~700MB file can consume ~6GB of memory.
Upvotes: 3
Views: 9288
Reputation: 2676
This is happening because we are using too much memory. Python error code 137 typically means the process was killed due to excessive memory usage. The AppInsights memory profile showing up to 6GB memory used supports that To fix it, reduce your memory usage to keep the application from terminating. To dig deeper, we'd need code examples. Since none have been provided, I'd suggest we search SO for "Azure Python error 137" You will find several questions and answers with suggestions on how others with your same error reduced their memory footprint when using the azure storage libraries.
Upvotes: 3