Starting April 29, 2025, Gemini 1.5 Pro and Gemini 1.5 Flash models are not available in projects that have no prior usage of these models, including new projects. For details, seeModel versions and lifecycle.
Permissions error:If you encounter errors when creating a sandbox,
ensure your Google Cloud project has the Vertex AI User(roles/aiplatform.user)Identity and Access Management (IAM) role.
Invalid Project ID or Location:Verify that thePROJECT_IDandLOCATIONvariables used in your code are correct and supported. For
a list of supported regions, seeSupported regions.
Agent Engine not created:Before creating a sandbox, confirm that the
Agent Engine instance was successfully created. Theagent_engine.create()method must complete without errors.
Code execution issues
Code errors:Review thestderroutput from theexecute_coderesponse
to identify any syntax errors, runtime exceptions, or logical flaws in your
code.
File I/O issues:
File not found:Ensure that any input files specified in thefilesarray of yourinput_dataare correctly referenced within your code.
Your code is executed in the same folder as the files and can't access
other folders.
Output file not generated:Check that your code is writing to the
expected output filename and that there are no errors preventing file
creation or writing.
Size limits:There is a 100MB size limit for files.
State persistence:If your code relies on previous state,
verify that you are using the samesandbox_namefor subsequent calls.
Also, make sure that the sandbox has not expired.
Timeout:Code execution times out after 300 seconds.
Consider optimizing your code for performance or breaking down complex tasks
into smaller, more manageable steps.
Sandbox management and cleanup
Sandbox not found for deletion:If you're unable to delete a sandbox,
ensure that thesandbox_nameyou are using is correct and that the sandbox
still exists.
Agent Engine not found for deletion:Similar to sandboxes, verify theagent_engine_namewhen attempting to delete the Agent Engine.
Resource quotas:If you are creating many sandboxes or performing
frequent executions, you might encounter resource quota limits. Check your
project's quotas for Vertex AI services and request increases
if necessary. For
a list of Agent Engine quotas, seeQuotas.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-10 UTC."],[],[],null,["| **Preview**\n|\n|\n| This feature is\n|\n| subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section of the\n| [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nThis section provides common issues and their solutions when working with the\n[Agent Engine Code\nExecution](/vertex-ai/generative-ai/docs/agent-engine/code-execution/overview).\n\nSandbox creation issues\n\n- **Permissions error:** If you encounter errors when creating a sandbox,\n ensure your Google Cloud project has the Vertex AI User\n `(roles/aiplatform.user)` Identity and Access Management (IAM) role.\n\n- **Invalid Project ID or Location:** Verify that the `PROJECT_ID` and\n `LOCATION` variables used in your code are correct and supported. For\n a list of supported regions, see [Supported regions](/vertex-ai/generative-ai/docs/agent-engine/overview#supported-regions).\n\n- **Agent Engine not created:** Before creating a sandbox, confirm that the\n Agent Engine instance was successfully created. The `agent_engine.create()`\n method must complete without errors.\n\nCode execution issues\n\n- **Code errors:** Review the `stderr` output from the `execute_code` response\n to identify any syntax errors, runtime exceptions, or logical flaws in your\n code.\n\n- **File I/O issues:**\n\n - **File not found:** Ensure that any input files specified in the `files`\n array of your `input_data` are correctly referenced within your code.\n Your code is executed in the same folder as the files and can't access\n other folders.\n\n - **Output file not generated:** Check that your code is writing to the\n expected output filename and that there are no errors preventing file\n creation or writing.\n\n - **Size limits:** There is a 100MB size limit for files.\n\n- **State persistence:** If your code relies on previous state,\n verify that you are using the same `sandbox_name` for subsequent calls.\n Also, make sure that the sandbox has not expired.\n\n- **Timeout:** Code execution times out after 300 seconds.\n Consider optimizing your code for performance or breaking down complex tasks\n into smaller, more manageable steps.\n\nSandbox management and cleanup\n\n- **Sandbox not found for deletion:** If you're unable to delete a sandbox,\n ensure that the `sandbox_name` you are using is correct and that the sandbox\n still exists.\n\n- **Agent Engine not found for deletion:** Similar to sandboxes, verify the\n `agent_engine_name` when attempting to delete the Agent Engine.\n\n- **Resource quotas:** If you are creating many sandboxes or performing\n frequent executions, you might encounter resource quota limits. Check your\n project's quotas for Vertex AI services and request increases\n if necessary. For\n a list of Agent Engine quotas, see [Quotas](/vertex-ai/generative-ai/docs/agent-engine/overview#quotas)."]]