The code terminated for an unknown reason


Im trying to run a python script that gets data from google analytics 4.

When I test the script locally, the process takes 32.5 MB max.

For some reason, when I run the code in Retool Python Code block, I get the error: "{"data":null,"error":"The code terminated for an unknown reason. Potentially, the memory limit 256 Mibs was breached."}"

Any ideas?


while, at run-time, the script only uses 32.5MB the error is referring to the workflow as a whole. this includes other blocks and amount of code/file size (which also includes any libraries you've added) in the calculation. are there a lot of blocks in your workflow or libraries you've imported that aren't minified?

1 Like

I thought that this was the case. To validate this, I created a fresh workflow where I installed: google-analytics-data library and I added one code block with the same script. Got the same error.

An option can be that the library is really large and it cannot be used in the workflow (and should be hidden). Unless there is another issue?

Can we also see a screenshot of the block that is failing?

We are tracking requests in our backlog for the ability to increase the allowed memory. I'll post on this thread if we are able to prioritize that request