Troubleshooting Agent Link Entrypoints
This feature is in the Early Access stage and under active development. Configuration schemas and behavior are subject to change. We recommend that you do not use this feature in production environments.
This page describes issues that you might encounter with an Agent Link Entrypoint and its link agents, and how to resolve them. For how the entrypoint works and how to connect an agent to it, see Agent Link Entrypoints (Early Access).
Agent Receives HTTP 400 When It Connects
The connection request is not a valid WebSocket handshake, for example because a proxy between the agent and the Entrypoint Executor did not pass the WebSocket upgrade headers. The Entrypoint Executor log records agent link connection refused with reason=upgrade failed.
To resolve this issue:
-
Configure the proxy to pass the
UpgradeandConnectionheaders on the/gw/path.
Agent Receives HTTP 401 When It Connects
The entrypoint did not find an agent with the name the agent sent, or the token's digest does not match the configured digest. The Entrypoint Executor log records agent link connection refused with reason=invalid credentials, the claimed agentName, and the caller's address.
To resolve this issue, verify that:
-
The name that the agent sends matches the expected name exactly, including case:
-
For a link agent that the Platform service manages, the expected name is its
instanceName. -
For an agent in a runtime configuration file, the expected name is its
name.
The agent sends the
nameinAgentConfig, or the value ofSAM_AGENT_NAME, which the Link SDK reads whenAgentConfigsets no name. -
-
The digest was computed from the exact token the agent sends, with
printf %sand notecho. -
For a link agent that the Platform service manages, the link agent is deployed. The entrypoint accepts a link agent only after its deployment completes.
-
For an agent in a runtime configuration file, you restarted
sam run --embeddedafter you added the agent or changed its digest.
Agent Receives HTTP 403 When It Connects
The entrypoint refuses the connection for one of the following reasons:
-
The agent is disabled, and the Entrypoint Executor log records
agent link connection refusedwithreason=agent disabled. To enable the agent, setenabledtotrueor remove the field, then deploy the link agent again or, for an agent in a runtime configuration file, restartsam run --embedded. -
The connection request carries an
Originheader, which the entrypoint refuses, and the Entrypoint Executor log recordsagent link connection refusedwithreason=upgrade failed. Connect from a server-side client, not a web browser.
Agent Receives HTTP 429 When It Connects
The agent opened more than max_connects_per_minute connections in 1 minute, which usually means it is reconnecting in a loop. The Entrypoint Executor log records reason=connection rate exceeded.
To resolve this issue:
-
Find out why the agent's connections close, using the agent's own log and the other entries on this page.
-
Increase
max_connects_per_minuteonly if the agent legitimately runs many processes.
Agent Keeps Receiving HTTP 503 When It Connects
The entrypoint answers a connection with HTTP 503 in the following cases, and the Link SDK tries again after about 1 second:
-
The Entrypoint Executor replica does not serve link agents.
-
A link agent that the Platform service manages restarts with its new settings after a deployment. The entrypoint answers HTTP 503 for a short time, until the restart completes.
-
The entrypoint cannot start a link agent that the Platform service manages, for example because it cannot create the agent's queue. The entrypoint tries the start again on its own.
When the agent never gets past HTTP 503, verify that:
-
The load balancer does not pin the agent to one replica. For more information, see Running Several Entrypoint Executor Replicas.
-
For an agent in a runtime configuration file, every Entrypoint Executor process in the namespace loads the file.
-
For a link agent that the Platform service manages, the Entrypoint Executor log does not record
agent link could not start an agent; its token is answered 503 and the start is tried again.
Connection Closes with Code 4400, 4408, 4409, 1009, or 1013
The close code tells you why the entrypoint closed the connection:
4400— The entrypoint closes the connection for one of the following reasons:With the reason
subprotocol sam-agent-link.v2 required, the client does not support the protocol version the entrypoint supports. Upgrade thesam-link-sdkpackage.With the reason
text messages only, the client sent a binary WebSocket message. Upgrade thesam-link-sdkpackage.
-
4408— The entrypoint received neither a message nor a reply to a ping from the agent for 60 seconds. Check that every proxy between the agent and the Entrypoint Executor allows idle connections for longer than 60 seconds. -
4409— The agent already hasmax_connections_per_agentopen connections, and the Entrypoint Executor log recordsreason=too many connections. Stop surplus agent processes or increase the limit. -
1009— A message exceededmax_frame_bytes. Increasemax_frame_bytesandSAM_LINK_MAX_FRAME_BYTEStogether. -
1013— The agent did not read the entrypoint's messages fast enough, and the Entrypoint Executor log recordsagent link connection too slow; closing. Check the agent's host for CPU starvation or a blocked event loop.
Entrypoint Executor Does Not Start After You Add the Entrypoint
This issue applies to an entrypoint in a runtime configuration file. A refused Agent Link Entrypoint stops the Entrypoint Executor from starting, for one of the following reasons:
-
The environment of the Entrypoint Executor sets
SAM_FEATURE_AGENT_LINK_ENTRYPOINT=false. The log recordsagent link: the agent link entrypoint is disabled; set SAM_FEATURE_AGENT_LINK_ENTRYPOINT=true to enable it. Remove the setting or set it totrue. -
The entrypoint refused its configuration. The log names the agent and the field, for example
token_sha256 must be the 64-character hex SHA-256 of the agent's token,unknown key, orthe agent_<uuid> and workflow_<uuid> names are reserved.
To resolve this issue, verify that:
-
Every
token_sha256resolves to 64 hexadecimal characters. An unset environment variable leaves the value empty. -
Every key in an agent entry and a
wakeblock appears in Agent Link Entrypoint Configuration Reference, and every boolean istrueorfalsewithout quotes. -
Every limit under
adapter_configis a positive whole number. -
No two agents share a name or a digest.
Agent Is Not Listed
The agent connected but does not appear in GET /api/v1/agentCards or in the Agent Mesh UI.
To resolve this issue, verify that:
-
The agent's log shows no refused self-description. The entrypoint delivers no tasks to the agent until it accepts a new self-description, and it refuses a self-description that has any of the following:
tools that name more than 64 distinct scopes
a
descriptionover 4,096 bytesmore than 32 skills
a skill name over 256 bytes or a skill description over 1,024 bytes
an agent card over 256 KiB
-
For an entrypoint in a runtime configuration file, its
namespacematches the namespace of the Web UI Entrypoint. -
For a request-driven agent after an Entrypoint Executor restart, the Entrypoint Executor log shows
agent link waking agent to list it, and no warning that starts withagent link wake,agent link woke, oragent link refused a wake targetfollows it. -
Under enforced RBAC, the user who runs the check holds the link agent's invoke scope. For more information, see Controlling Which Agents Can Delegate to a Link Agent.
Tasks for a Link Agent Reach Another Agent
This issue applies to an agent in a runtime configuration file. Another agent or workflow in the namespace uses the link agent's name, so both consume the same request queue. The Entrypoint Executor log records the warning agent link agent shares its name with another agent on the mesh.
To resolve this issue:
-
Rename the link agent in its entry under
agentsand in the agent'sAgentConfig. -
Update the
peerslists of other link agents that name it. -
Restart
sam run --embedded.
Request-Driven Agent Is Never Woken
The entrypoint calls the runtime, or refuses to call it, and the agent does not connect. The Entrypoint Executor log records one of the following warnings:
-
agent link wake call failed,agent link wake call refused,agent link wake token request failed, oragent link wake call timed out -
agent link woke the agent and it has not connected -
agent link refused a wake target on a private or loopback address; set SAM_AGENT_LINK_ALLOW_PRIVATE_WAKE=true on the Entrypoint Executor to allow it -
agent link refused a wake target on an address it never calls
To resolve this issue, verify that:
-
The wake URL is the runtime's invocation endpoint and the runtime is deployed.
-
The OAuth client in the wake block can obtain a token for its scope at the token URL, and the runtime accepts that token.
-
The invocation endpoint does not answer with a redirect, which counts as a failed wake.
-
The woken agent's environment sets
SAM_LINK_URLto an address it can reach andSAM_LINK_TOKENorSAM_LINK_TOKEN_FILEto its token. -
For a link agent that the Platform service manages, the wake address is not a private-network or loopback address, or
SAM_AGENT_LINK_ALLOW_PRIVATE_WAKEistrueon the Entrypoint Executor. The log recordsagent link refused a wake target on a private or loopback addresswhen the entrypoint refuses such an address. For more information, see Waking Request-Driven Agents.
Tasks Fail with Access denied: insufficient scopes or Authentication failed
The entrypoint refused the task before delivering it to the agent. The Entrypoint Executor log records agent link refused a task with reason=insufficient scopes or reason=authentication failed, and the task fails with one of the following errors:
-
Access denied: insufficient scopes— The user does not hold a scope that the agent requires for itself. Grant the scope to one of the user's roles. -
Authentication failed— The entrypoint could not verify the user's task token, or the task carried no token while the Trust Manager is enabled.
Task Fails with Request too large
The task is larger than max_frame_bytes, so the entrypoint cannot send it to the agent. The task fails with an error that starts with Request too large, and the Entrypoint Executor log records agent link refused a task too large to send.
To resolve this issue:
-
Increase
max_frame_bytesandSAM_LINK_MAX_FRAME_BYTEStogether.
Task Fails with the agent did not answer before the task's time limit
The agent took the task but sent no answer within task_ttl_seconds, and the Entrypoint Executor log records agent link task expired unanswered.
To resolve this issue:
-
Check the agent's own log for the task.
-
If the agent's work legitimately takes longer, increase
task_ttl_seconds.
A Peer Call Is Refused
The link agent's call to another agent fails at once. The Link SDK reports SAM refused the peer call: followed by a reason, such as one of the following:
-
not a configured peer of this agent— The peer is missing from the agent's peers, or its name differs. -
the user may not invoke this peer— The task's user lacks the invoke scope for the peer. The Entrypoint Executor log recordsagent link refused a peer call. -
the peer is not on the mesh— No agent with that name is listed. The Entrypoint Executor log recordsagent link refused a peer call to a peer not on the mesh. -
call depth limit reached— The task has already passed through too many delegations. -
the parent task is not an open task of this agent— The agent called the peer for a task that has already ended. -
the parent task was cancelled— The user or caller canceled the task that the peer call belongs to.
Next Steps
From here, you can:
-
Review how the entrypoint handles replicas, restarts, and network access. For more information, see Operating Agent Link Entrypoints.
-
Look up the limits and fields that these issues name. For more information, see Agent Link Entrypoint Configuration Reference.
-
Return to connecting an agent. For more information, see Agent Link Entrypoints (Early Access).