Troubleshoot deploying an agent

This document describes how to resolve errors that you might encounter when deploying an agent to Agent Runtime. It covers a variety of common issues, including serialization failures, permission errors, and VPC-SC boundary violations.

Note: To search and filter agent error logs, use the Logs Explorer, select RESOURCE TYPE to "Vertex AI Reasoning Engine" and select the corresponding RESOURCE CONTAINER value (i.e. the project number) and REASONING ENGINE ID value.

Container build and startup errors

If your deployment fails while Agent Runtime builds or starts the agent's container, one of the following issues might be the cause:

Container image build failed

Issue:

Deployment fails with a 400, INVALID_ARGUMENT status (REASONING_ENGINE_BUILD_FAILED) and a message similar to the following:

The Reasoning Engine could not be deployed because its container image failed to build.

Possible causes:

When you deploy an agent from an agent object, from source files, or from a Dockerfile, Agent Runtime builds a container image for the agent. The build fails if one of the following steps fails:

  • Installing package requirements: A package in requirements or your source files' requirements file doesn't exist, pins a version that doesn't exist, conflicts with another package, or doesn't support the agent's Python version.
  • Installing a local wheel: A wheel file listed in requirements isn't also included in extra_packages, so it isn't available to install.
  • Running installation scripts: A script in the installation_scripts directory exits with an error.
  • Building your Dockerfile: When you deploy from a Dockerfile (image_spec), an instruction in your Dockerfile fails.

Recommended solutions:

  • Check the build logs linked in the error metadata's logs_url field to find the step that failed. Build log entries include the log ID reasoning_engine_build. To query the logs, see Building queries.
  • To reproduce the failure locally, install the same requirements in a new virtual environment that uses the deployed agent's Python version, and fix any errors that pip reports:

    python -m venv agent-env
    agent-env/bin/pip install -r requirements.txt
  • To make the build install the versions that you tested locally, pin your package versions. See Define the package requirements.

  • If you install a local wheel, include it in both requirements and extra_packages. See Define additional packages.

  • If you use installation scripts, make sure that each script exits successfully when run with root permissions in a clean environment. See Define build options.

  • If you deploy from a Dockerfile, build the container image locally from the same source files (for example, with docker build) and fix any instruction that fails.

Solutions that don't apply:

  • Retrying the deployment without changing the requirements, installation scripts, or Dockerfile fails the same way, because the build runs the same steps.

Container image build timed out

Issue:

Deployment fails with a 504, DEADLINE_EXCEEDED status (REASONING_ENGINE_BUILD_TIMEOUT) and a message saying that the agent's container image didn't finish building in time.

Possible causes:

When you deploy from source files, Agent Runtime builds a container image that installs your code and its dependencies. The deployment fails if the build is still running when its allowed time runs out. Builds usually take too long because of the dependencies they install, for example:

  • A long list of packages in requirements, including ones the agent doesn't use.
  • Packages without prebuilt wheels for the build environment, which are compiled from source during the build.
  • Unpinned or loosely pinned versions, which slow down dependency resolution.

Recommended solutions:

  • Check the build logs linked in the error metadata's logs_url field to see which step was running when the build stopped.
  • Remove unnecessary dependencies and pin the versions of all required packages.
  • Prioritize packages and versions that publish prebuilt wheels, so that nothing is compiled during the build.
  • Retry the deployment. A build can occasionally run longer than usual for reasons unrelated to your code.

Container failed to start

Issue:

Deployment fails with a 400, INVALID_ARGUMENT status (REASONING_ENGINE_CONTAINER_FAILED_TO_START) and a message saying that the agent's container didn't start serving within the startup timeout.

Possible causes:

Agent Runtime starts your agent in a container and waits for it to accept requests. The deployment fails if the container exits, or doesn't respond, before the startup timeout. Common causes can include the following:

  • Missing dependency: Your agent imports a package that isn't listed in requirements or extra_packages, so loading the agent fails with an error such as ModuleNotFoundError.
  • Package version mismatch: The packages installed in the deployed environment differ from those in your development environment, so loading the agent fails with an error such as AttributeError: Can't get attribute. See Serialization errors.
  • Error during initialization: Your agent's set_up() method, or other code that runs when the agent is loaded, raises an exception or waits on a resource it can't reach.
  • Slow initialization: Loading the agent takes longer than the startup timeout.
  • Custom container not listening: A custom container must listen for HTTP requests on 0.0.0.0 on port 8080. See the runtime contract.
  • Agent Gateway blocking startup: When you route traffic through Agent Gateway, startup fails if Identity-Aware Proxy (IAP) blocks initialization calls, if the agent identity lacks the required roles, or if a custom container doesn't trust the gateway's root certificate. See Errors during Agent Runtime startup and Agent deployed with custom container (BYOC) fails to connect to Agent Gateway.

Recommended solutions:

  • Check the agent's logs linked in the error metadata's logs_url field to find the error that stopped the container. See View logs for an agent.
  • Add any missing packages to requirements or extra_packages, and pin the versions that you use in development.
  • To reproduce the failure locally, install only the packages listed in requirements in a clean environment with the same Python version, then import and instantiate your agent.
  • Move slow or failure-prone work, such as connecting to external services, out of agent initialization.
  • For a custom container, make sure that the server listens on 0.0.0.0 and on the port in the PORT environment variable (default 8080).

Solutions that don't apply:

  • Retrying the deployment without changing the agent or its dependencies usually fails the same way, because the cause is in the agent code or its environment.

Container didn't start in time

Issue:

Deployment fails with a 504, DEADLINE_EXCEEDED status (REASONING_ENGINE_CONTAINER_START_TIMEOUT) and a message saying that the agent's container didn't start serving in time.

Possible causes:

After the image is built, Agent Runtime starts the agent's container and waits for it to become ready to serve requests. The deployment fails if the container is still starting when its allowed time runs out. Common causes can include the following:

  • Slow work at import time, such as loading large models or files when the agent's modules are imported.
  • Slow or blocking work in the agent's set_up() method, such as network calls that wait on an unreachable service.

Recommended solutions:

  • Check the container logs linked in the error metadata's logs_url field to see where startup stalled.
  • Move expensive initialization out of module import time, and minimize the number of steps in set_up() fast. Defer work that isn't needed to serve the first request.
  • Make sure that any service the agent calls during startup is reachable from the agent, and set timeouts on those calls so that they can't block startup indefinitely.
  • If the container logs show that the agent started normally, retry the deployment. Startup can occasionally take longer than usual for reasons unrelated to your code.

Prebuilt Template errors

If you run into issues with the LangchainAgent template during deployment, it might be due to one of the issues in this section.

Internal server errors

Issue:

You receive an error message similar to the following:

InternalServerError: 500 Revision YYY is not ready and cannot serve traffic.

Unfortunately, this is a catch-all error for any issues with the container at runtime, and the possible cause is one of many errors that might be happening.

Possible cause(s):

  • Dirty state on LangchainAgent. This might happen if .set_up() was called on a LangchainAgent before deploying the agent.
  • Inconsistent package versions. This might happen if the packages installed in the development environment are different from the packages installed in the remote environment in Agent Runtime.

Recommended solution(s):

  • Dirty state on LangchainAgent. Instantiate a fresh instance of the LangchainAgent or remove agent.set_up() from the code before deploying the agent.
  • Inconsistent package specs. See the section on troubleshooting serialization errors.

Serialization errors

In general, it is important to ensure that the "local" and "remote" environments are in sync when deploying the agent. You can ensure this by specifying requirements= when deploying the agent.

If you run into issues with serialization (errors related to "pickle" or "pickling" are synonymous with "serialization" errors), it might be due to one of the issues that's described in this section.

Pydantic version

Issue:

You receive an error message similar to the following:

PicklingError: Can't pickle <cyfunction str_validator at 0x7ca030133d30>: it's
not the same object as pydantic.validators.str_validator

Possible cause:

This might happen if your pydantic package is earlier than version 2.6.4. To check which version you're using, run the following command in your terminal:

pip show pydantic

Recommended solution:

Update your package by running the following command in the terminal:

pip install pydantic --upgrade

Run the following command in your terminal to verify you're using version 2.6.4 or later:

pip show pydantic

If you're in a notebook instance (for example, a Jupyter, Colab, or Workbench), you might need to restart your runtime to use the updated packages.

Cloudpickle version

Issue:

You receive an error message similar to the following:

AttributeError: Can't get attribute '_class_setstate' on <module 'cloudpickle.cloudpickle'
from '/usr/local/lib/python3.10/site-packages/cloudpickle/cloudpickle.py'>

Possible cause:

This might happen if the version of your cloudpickle package is different in your development environment and your deployment environment. To check which version you're using in development, run the following command in your terminal:

pip show cloudpickle

Recommended solution:

Deploy the same version of cloudpickle in both environments, such as your local development environment and the remotely deployed agent by specifying requirements= when deploying the agent.

Internal server errors

Issue:

You receive an error message similar to the following:

InternalServerError: 500 Revision YYY is not ready and cannot serve traffic.

Possible cause:

This might happen if sys_version= is different from the development environment when deploying the agent.

Recommended solution:

After deploying the agent, consider removing sys_version= from the input arguments. If you still run into issues, file a bug report.

Cloud Storage bucket errors

If you're running into issues with the Cloud Storage staging bucket that's used at deployment time to collect and upload your agent, it might be due to one of the following issues:

Permission errors

Recommended solution:

If you want to use a pre-existing bucket: make sure the principal that's authenticated to use Agent Platform (either yourself or a service account) has Storage Admin access to the bucket, and grant permissions to the service account.

Alternatively, you can specify a new bucket when deploying the agent and the SDK will create the bucket with the necessary permissions.

If you still run into issues, file a bug report.

Cloud Storage bucket subdirectory isn't created

Issue:

You receive an error message similar to the following:

NotFound: 404 Can not copy from \"gs://[LOCATION]-*/agent_engine/agent_engine.pkl\" to \"gs://*/code.pkl\", check if the source object and target bucket exist.

(The 404 occurs when the system tries to copy into a folder that doesn't exist.)

Possible cause:

This is likely due to an issue with string interpolation in versions of google-cloud-aiplatform earlier than version 1.49.0. This is fixed in later versions. To check which version of google-cloud-aiplatform you're using, run the following command in your terminal:

pip show google-cloud-aiplatform

Recommended solution:

Update your package by running the following command in the terminal:

pip install google-cloud-aiplatform --upgrade

Verify that you're using version 1.49.0 or later of google-cloud-aiplatform by running the following command in your terminal:

pip show google-cloud-aiplatform

If you're using a notebook instance (for example, Jupyter or Colab or Workbench), you might need to restart your runtime before you can use the updated packages.

VPC-SC violation errors

If you're experiencing problems with VPC-SC, one of the following issues might be the cause:

Permission errors

Issue:

You receive an error message similar to the following:

Reasoning Engine instance REASONING_ENGINE_ID failed to start and cannot serve traffic.

or:

Request is prohibited by organization's policy.

Possible cause:

This is likely caused by missing required ingress rules in the VPC-SC perimeter.

Recommended solution:

If you use Agent Platform in a VPC-SC environment, you must create an ingress rule in your perimeter to allow ingress from the Reasoning Engine Service Agent (service-PROJECT_NUMBER@gcp-sa-aiplatform-re.iam.gserviceaccount.com) into the storage.googleapis.com service and artifactregistry.googleapis.com service.

Custom service account errors

If you're experiencing problems with service accounts, one of the following issues might be the cause:

Act as service account

Issue:

You receive an error message similar to the following:

You do not have permission to act as service_account.

Possible cause:

You may not have the iam.serviceAccounts.actAs permission on the custom service account used for deployment. Note that in a multi-agent system where there are multiple custom service accounts, one agent author or deployer can act as some of the service accounts. If you are using the wrong service account, this error is the expected behavior

In addition, you may encounter this error if the custom service account is located in a project different from the one where you deploy the agent, and the iam.disableCrossProjectServiceAccountUsage organization policy is enforced in the service account project.

See Cross-project custom service account for the full list of required configurations for this scenario.

Recommended solution:

Make sure you are using the intended service account. Check if you have the Service Account User (roles/iam.serviceAccountUser) role on this service account. If not, ask your administrator to grant you the role on this service account.

If you are in the cross-project scenario, check if your service account project has iam.disableCrossProjectServiceAccountUsage organization policy enforced. If so, ask your administrator to disable the policy.

Metadata server unavailable

Issue:

You receive an error message similar to the following:

ServiceUnavailable: 503 Getting metadata from plugin failed with error

or

Compute Engine Metadata server unavailable due to : Could not fetch URI /computeMetadata/v1/instance/service-accounts/default/token

Possible cause:

This can happen if the custom service account and your agent are in different projects and the Agent Platform Service Agent (service-PROJECT_NUMBER@gcp-sa-aiplatform.iam.gserviceaccount.com) does not have the iam.serviceAccounts.getAccessToken permission on the custom service account.

See Cross-project custom service account for the full list of required configurations for this scenario.

Recommended solution:

Ask your administrator to grant the Agent Platform Service Agent (service-PROJECT_NUMBER@gcp-sa-aiplatform.iam.gserviceaccount.com) of the agent project the Service Account Token Creator (roles/iam.serviceAccountTokenCreator) role on the custom service account.

The Agent Platform Service Agent should be located in the same project you use to deploy your agent. The IAM binding of the role grant should be in the project where the custom service account resides.

Environment provisioning failed

Issue:

Creating an agent fails with a 500, INTERNAL status (REASONING_ENGINE_PROVISIONING_FAILED) and a message saying that the agent's Google-managed environment couldn't be provisioned.

Possible cause:

Before Agent Runtime deploys your first agent in a project and region, it sets up Google-managed resources for your agents, such as service agents and the hosting environment. If this setup fails, every pending agent creation in that project and region fails with this error.

Recommended solution:

Contact support and include the failed operation's name in the format projects/PROJECT_ID/locations/LOCATION/operations/OPERATION_ID.

Solutions that don't apply:

  • Retrying the agent creation doesn't resolve this error, because Google must fix the failed setup first.
  • Changing your agent's code, requirements, or resource_limits doesn't help, because the failure occurs before Agent Runtime deploys your agent.
  • Requesting a quota increase for your project has no effect, because Google manages these resources.

Resource exhausted errors

If your deployment fails with a 429, RESOURCE_EXHAUSTED status, one of the following issues might be the cause:

API rate limit or quota exceeded

Issue:

Deployment fails with an Error 429 or RESOURCE_EXHAUSTED status.

Possible cause:

The project has exceeded its API rate limits or concurrent request quotas.

Recommended solutions:

  • Implement an exponential backoff and retry strategy in deployment scripts.
  • Verify current usage against limits in the Google Cloud Quotas page for the "Agent Platform API".
  • Reduce the frequency of concurrent deployments.

Region temporarily at capacity

Issue:

Deployment fails with a 429, RESOURCE_EXHAUSTED status and a message saying that the region is temporarily at capacity for a total allowable amount of memory or CPU.

Possible cause:

Agent deployments in a region draw on a pool of serving capacity that Agent Runtime manages on your behalf and that all customers in that region share. When the pool is exhausted, new deployments in that region fail until capacity frees up.

This limit is not one of your project's quotas. It does not appear on the Google Cloud Quotas page, and it cannot be raised by requesting a quota increase.

Recommended solutions:

  • Deploy to a different supported region. This is the fastest way to unblock a deployment.
  • Retry later. A region at capacity is a temporary issue that usually resolves on its own.
  • Request a smaller amount of memory or CPU for your agent. A smaller deployment may fit within the remaining capacity.
  • Contact support if deployments in a region keep failing this way. Although we can't raise the limit, your reports help us direct capacity to where it's needed.

Solutions that don't apply:

  • Deleting your existing agents doesn't free capacity for this limit, because the capacity isn't consumed by your project alone.
  • Requesting a quota increase has no effect, because the limit isn't a project quota.

Maximum instances exceed regional limit

Issue:

Deployment fails with a 429, RESOURCE_EXHAUSTED status and a message saying that spec.deployment_spec.max_instances exceeds the maximum number of instances supported for the requested CPU or memory in the region's resource_limits.

Possible cause:

When you deploy an agent, Agent Runtime multiplies spec.deployment_spec.max_instances by the per-instance cpu and memory in spec.deployment_spec.resource_limits and checks that this single agent's peak allocation fits within the regional limit of the underlying serving project. If you don't specify max_instances, Agent Runtime applies a default value (such as 200), which in regions with lower limits can exceed the maximum supported instances when multiplied by the configured per-instance cpu or memory.

Recommended solutions:

  • Set spec.deployment_spec.max_instances to the maximum value shown in the error message (or fewer).
  • Reduce the per-instance cpu or memory value in spec.deployment_spec.resource_limits.
  • Deploy the agent to a different supported region with a higher limit.

Solutions that don't apply:

  • Requesting a quota increase on your project's Google Cloud Quotas page has no effect, because this limit is enforced on the Google-managed serving project rather than your project.
  • Deleting other agents in your project or retrying without changing max_instances or resource_limits doesn't resolve this error, because the check evaluates the single deployment's peak allocation against a static limit.

Agent Gateway lookup throttled

Issue:

Deploying or updating an agent that uses an Agent Gateway fails with a 429, RESOURCE_EXHAUSTED status (REASONING_ENGINE_AGENT_GATEWAY_LOOKUP_THROTTLED) and a message similar to the following:

The Reasoning Engine could not be created or updated because the request to look up Agent Gateway `projects/PROJECT_NUMBER/locations/LOCATION/agentGateways/AGENT_GATEWAY_ID` was throttled. Wait about a minute, then try again.

Possible cause:

Before a deployment or update starts, Agent Runtime looks up each Agent Gateway in the agent's spec.deployment_spec.agent_gateway_config to validate the request. This error means that the lookup is temporarily rate limited. The request is rejected before the deployment or update starts, so your agent isn't created or changed.

Recommended solutions:

  • Wait about a minute, and then retry the deployment or update.
  • In automated workflows, retry the request with exponential backoff.
  • Contact support if the error persists.

Solutions that don't apply:

  • Changing your agent's code, requirements, or resource_limits doesn't resolve this error, and checking container or Agent Gateway traffic logs won't show an error, because the request is rejected before Agent Runtime builds or starts your agent's container.

Secret Manager access errors

Issue:

Deployment fails with a 400, INVALID_ARGUMENT status (REASONING_ENGINE_SECRET_ACCESS_DENIED) and a message similar to the following:

The Reasoning Engine could not access `projects/PROJECT_NUMBER/secrets/SECRET_ID/versions/VERSION_ID` referenced by `spec.deployment_spec.secret_env` (reason: FAILURE_REASON).

Possible causes:

  • NOT_FOUND: The secret ID or version ID specified in secret_env doesn't exist in Secret Manager in the same project as the deployed agent, or contains a typo.
  • DESTROYED or DISABLED: The referenced secret version in Secret Manager is in a destroyed or disabled state.
  • PERMISSION_DENIED: On a service-account-based deployment (custom service_account or default AI Platform Reasoning Engine Service Agent), the configured service account doesn't have the Secret Manager Secret Accessor role (roles/secretmanager.secretAccessor) on the referenced secret during deployment validation.

Recommended solutions:

  • For NOT_FOUND, DESTROYED, or DISABLED:
    1. In the Secret Manager page of the project where you are deploying the agent, verify that each SECRET_ID and VERSION_ID referenced in secret_env exists and is in the Enabled state.
    2. If a referenced version was disabled or destroyed, enable a valid version or update secret_env to reference an enabled version.
  • For PERMISSION_DENIED: Follow Manage access to secrets to grant the Secret Manager Secret Accessor role (roles/secretmanager.secretAccessor) on the specific secret to the dedicated custom service account configured on the agent (or switch to an isolated agent identity).

Container startup failure when using secret_env with AGENT_IDENTITY

Issue:

An agent configured with identity_type = AGENT_IDENTITY and secret_env fails or times out during container startup (rather than returning REASONING_ENGINE_SECRET_ACCESS_DENIED during deployment validation).

Possible causes:

For AGENT_IDENTITY deployments, Agent Runtime skips deployment-time secret access validation and fetches referenced secrets at container startup. If you pass secret_env during initial creation (before the provisioned agent identity exists and has been granted access), if the provisioned agent identity lacks roles/secretmanager.secretAccessor on a referenced secret, or if a referenced secret version is missing (NOT_FOUND), disabled (DISABLED), or destroyed (DESTROYED), container startup repeatedly fails to fetch the secret.

Recommended solutions:

  1. Create the agent with AGENT_IDENTITY first without secret_env.
  2. Follow Manage access to secrets to grant roles/secretmanager.secretAccessor on the specific secret to the agent's provisioned agent identity (prepend principal:// to spec.effective_identity when specifying the IAM member—for example, --member="principal://EFFECTIVE_IDENTITY").
  3. Verify that each referenced secret version exists and is enabled, and update the agent to attach secret_env. Restrict aiplatform.reasoningEngines.update permissions on the agent so only authorized principals can modify code running as its identity.

Agent Gateway binding errors

If you route traffic through Agent Gateway and deploying or updating your agent fails before the agent starts, one of the following issues might be the cause:

Agent Gateway binding timed out

Issue:

Deploying or updating an agent fails with a 504, DEADLINE_EXCEEDED status (REASONING_ENGINE_AGENT_GATEWAY_PROVISION_TIMEOUT) and a message similar to the following:

The Reasoning Engine timed out waiting for an in-progress operation on shared Agent Gateway `projects/PROJECT_NUMBER/locations/LOCATION/agentGateways/AGENT_GATEWAY_ID` to finish. Wait for the other operation to complete, then try again.

Possible causes:

Agent Runtime agents in the same project and region share one binding to each configured Agent Gateway. Setting up or tearing down the shared binding can take several minutes longer than attaching an agent to an active binding. Your deployment or update times out if another binding or unbinding operation in the same project and region doesn't finish within the allowed time. Common causes can include the following:

  • Concurrent initial bindings: You bind multiple agents to an Agent Gateway in the same project and region before the initial shared setup finishes.
  • In-progress unbinding: You unbind or delete the last gateway-bound agent in the project and region, and then bind another agent to the same or a different gateway before the shared teardown finishes.
  • Retry after a failed binding: A deployment or update that binds a gateway fails, and you retry it before Agent Runtime finishes cleaning up the failed setup.

Recommended solutions:

  • Wait several minutes for other operations on the gateway named in the error to finish, and then retry the deployment or update.
  • To bind multiple agents in a project and region without an active Agent Gateway binding, bind one agent first and wait for that operation to succeed. Then deploy or update the remaining agents concurrently.
  • In automated workflows, avoid unbinding or deleting the last gateway-bound agent in a project and region immediately before binding other agents. Removing the last gateway-bound agent tears down the shared binding, so the next deployment repeats the full setup.

Solutions that don't apply:

  • Checking container logs or Agent Gateway traffic logs doesn't show an error for this failure, because the timeout occurs before Agent Runtime starts your agent's container.
  • Changing your agent's code, requirements, or resource_limits doesn't reduce shared binding setup time.

If the gateway binding succeeds but the container then fails to start, see Errors during Agent Runtime startup.

Agent Gateway binding aborted

Issue:

Deploying or updating an agent fails with a 409, ABORTED status (REASONING_ENGINE_AGENT_GATEWAY_CONCURRENT_PROVISION_ABORTED) and a message similar to the following:

The Reasoning Engine could not be bound to Agent Gateway `projects/PROJECT_NUMBER/locations/LOCATION/agentGateways/AGENT_GATEWAY_ID` because a concurrent shared gateway provisioning operation failed and rolled back. Try again.

Possible cause:

Agent Runtime agents in the same project and region share one binding to each configured Agent Gateway. When you bind multiple agents to the same gateway before its shared binding is set up, one deployment or update sets up the binding and the others wait for it. If that deployment or update fails before the binding is ready, Agent Runtime rolls back the binding, and every deployment or update that was waiting on it fails with this error. The deployment or update that set up the binding reports its own error, which might not be related to Agent Gateway.

Recommended solutions:

  • Wait at least 10 minutes for Agent Runtime to finish rolling back the failed setup, and then retry the deployment or update. A retry that starts before the rollback finishes can fail with a 504, DEADLINE_EXCEEDED status. See Agent Gateway binding timed out.
  • To retry multiple deployments or updates, retry one first and wait for that operation to succeed, and then retry the rest concurrently. If that first operation fails, it returns the underlying error instead of 409, ABORTED (for example, Agent Gateway binding temporarily unavailable or Container image build failed), which you can look up in the error catalog.

Solutions that don't apply:

  • Checking container logs or Agent Gateway traffic logs doesn't show an error for this failure, because the failure occurs before Agent Runtime starts your agent's container.
  • Changing your agent's code, requirements, or resource_limits doesn't help, because another deployment or update caused this error, not your agent.

Agent Gateway binding temporarily unavailable

Issue:

Deploying or updating an agent fails with a 503, UNAVAILABLE status (REASONING_ENGINE_AGENT_GATEWAY_PROVISION_UNAVAILABLE) and a message similar to the following:

The Reasoning Engine could not be bound to Agent Gateway `projects/PROJECT_NUMBER/locations/LOCATION/agentGateways/AGENT_GATEWAY_ID` because network provisioning encountered a transient upstream service error. Try again.

Possible cause:

When the first agent in a project and region binds to an Agent Gateway, Agent Runtime sets up shared Google-managed networking resources that connect agents to the gateway. If a Google Cloud service that this setup depends on keeps returning temporary errors after several automatic retries, Agent Runtime rolls back the setup and the deployment or update fails with this error. Other deployments or updates that were waiting on the same setup fail with a 409, ABORTED status. See Agent Gateway binding aborted.

Recommended solutions:

  • Wait at least 10 minutes for Agent Runtime to finish rolling back the failed setup, and then retry the deployment or update. A retry that starts before the rollback finishes can fail with a 504, DEADLINE_EXCEEDED status. See Agent Gateway binding timed out.
  • If the error persists after several retries, contact support and include the failed operation's name in the format projects/PROJECT_ID/locations/LOCATION/operations/OPERATION_ID.

Solutions that don't apply:

  • Changing your agent's code, requirements, or resource_limits doesn't help, because the failure occurs before Agent Runtime deploys your agent.
  • Requesting a quota increase for your project has no effect, because Google manages these networking resources.

Network attachment project missing Agent Platform Service Agent

Issue:

Deploying or updating an agent configured with a Private Service Connect interface fails with a 400, FAILED_PRECONDITION status (REASONING_ENGINE_PSC_INTERFACE_SERVICE_AGENT_NOT_FOUND) and a message similar to the following:

The Reasoning Engine could not configure Private Service Connect interface network attachment `projects/ATTACHMENT_PROJECT_ID/regions/LOCATION/networkAttachments/NETWORK_ATTACHMENT_NAME` because the Vertex AI service agent `service-ATTACHMENT_PROJECT_NUMBER@gcp-sa-aiplatform.iam.gserviceaccount.com` does not exist in project `ATTACHMENT_PROJECT_ID`.

Possible cause:

When spec.deployment_spec.psc_interface_config.network_attachment references a network attachment, Agent Runtime updates that network attachment's accept list to accept connections from Agent Runtime, by using the Agent Platform Service Agent of the project that owns the network attachment. When the network attachment is in a different project (for example, a Shared VPC host project), deploying an agent in your service project doesn't create the Agent Platform Service Agent in the network attachment's project. If the Agent Platform API was never enabled in the network attachment's project or its service agent wasn't created, Agent Runtime can't update the network attachment.

Recommended solution:

Complete the following steps in the project that owns the network attachment (ATTACHMENT_PROJECT_ID):

  1. Enable the Agent Platform API:

    gcloud services enable aiplatform.googleapis.com --project=ATTACHMENT_PROJECT_ID
  2. Create the Agent Platform Service Agent:

    gcloud beta services identity create --service=aiplatform.googleapis.com --project=ATTACHMENT_PROJECT_ID
  3. Grant the Compute Network Admin role (roles/compute.networkAdmin) on ATTACHMENT_PROJECT_ID to the Agent Platform Service Agent (service-ATTACHMENT_PROJECT_NUMBER@gcp-sa-aiplatform.iam.gserviceaccount.com).

  4. If the network attachment is in a Shared VPC host project, grant the Compute Network User role (roles/compute.networkUser) on the host project to the Agent Platform Service Agent of the service project where you deploy the agent.

  5. Retry deploying or updating your agent with the same network attachment.

Alternatively, create the network attachment in the service project where you deploy the agent. See Using Private Service Connect interface with Shared VPC.

Solutions that don't apply:

  • Creating a new network attachment under a different name in the same project without creating the Agent Platform Service Agent fails the same way.
  • Checking container logs doesn't show an error for this failure, because the failure occurs before Agent Runtime starts your agent's container.

Support resources

If your problem is still not resolved, refer to our support guide to get help.