Skip to content

Commit 6dd8a51

Browse files
Merge pull request #570 from mulesoft/W-20130245-troubleshoot-agent-networks-ie
W-20130245-troubleshoot-agent-networks-ie
2 parents ef5e0d2 + d5dafda commit 6dd8a51

3 files changed

Lines changed: 118 additions & 6 deletions

File tree

modules/ROOT/nav.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
** xref:af-define-your-agent-network-specification.adoc[]
5050
** xref:af-publish-agent-network-assets.adoc[]
5151
** xref:af-deploy-agent-network-targets.adoc[]
52-
** xref:af-troubleshoot-anypoint-code-builder.adoc[]
52+
** xref:af-troubleshoot-agent-networks.adoc[]
5353
** xref:af-build-agent-networks-in-a-ci-cd-environment.adoc[]
5454
** xref:af-project-files.adoc[]
5555
* xref:ai-enabling-api-project-topic-center.adoc[]
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
= Troubleshoot Agent Networks
2+
:page-aliases: af-troubleshoot-anypoint-code-builder.adoc
3+
4+
Resolve common agent network errors and connectivity issues by enabling verbose logging, message logging policies, and distributed tracing.
5+
6+
[NOTE]
7+
Use Agent Visualizer to xref:agent-visualizer::troubleshoot-agent-network.adoc[view metrics, logs, and traces] for your agents and MCP servers in your network
8+
9+
== Enable Logging to Debug Agent Brokers
10+
11+
Enable logging and log levels from CloudHub 2.0 or Runtime Fabric:
12+
13+
. In Runtime Manager, navigate to the application for the agent broker.
14+
. Choose one of these options to configure logging:
15+
+
16+
* xref:cloudhub-2::ch2-manage-app-logs.adoc#configure-log-levels-and-categories[CloudHub 2.0]
17+
* xref:runtime-fabric::deploy-to-runtime-fabric.adoc#configure-logging-and-log-levels[Runtime Fabric]
18+
. Set the log level to Debug for these classes:
19+
+
20+
* `com.mulesoft.modules.agent.broker`
21+
* `org.mule.service.http.impl.service.HttpMessageLogger`
22+
23+
[IMPORTANT]
24+
HTTP wire logging displays HTTP headers and payload in plain text. Avoid leaving it enabled indefinitely or unsupervised, as it can negatively impact API performance.
25+
26+
[[enable-message-logging]]
27+
== Enable Message Logging Policy
28+
29+
Use API Manager or manually edit the agent network file to add a message logging policy.
30+
31+
=== Using API Manager
32+
33+
. In API Manager, select the API, agent, or MCP server instance for which you want to apply the policy.
34+
. Follow the steps in xref:gateway::flex-managed-message-log.adoc#configure-message-logging-in-connected-mode[Configure Message Logging in Connected Mode] and add these settings:
35+
+
36+
* In the Messages field, enter `#[attributes]`.
37+
* Select the checkboxes for **Before Calling API** and **After Calling API**.
38+
. Click **Save**.
39+
40+
Afterward, you should see a Message Log option for the API, agent, or MCP server.
41+
42+
[NOTE]
43+
If you redeploy the network, this policy is deleted.
44+
45+
=== Using the Agent Network File
46+
47+
In the `connection` section of the API, agent, or MCP server instance you want to log, add the following inside `policies`:
48+
49+
[source,yaml]
50+
----
51+
52+
policies: ## add the following inside the policy setting
53+
- ref:
54+
name: message-logging
55+
namespace: business_group_UUID
56+
configuration:
57+
loggingConfiguration:
58+
- itemName: "Payload"
59+
itemData:
60+
message: "#[payload]"
61+
firstSection: true
62+
secondSection: true
63+
level: "INFO"
64+
- itemName: "Headers"
65+
itemData:
66+
message: "#[attributes]"
67+
firstSection: true
68+
secondSection: true
69+
level: "INFO"
70+
----
71+
72+
[NOTE]
73+
On non-US control planes, the value for the `namespace` parameter can change. In Exchange, check the group in the policy API Gateway Message Logging Policy Template.
74+
75+
== Troubleshooting Common Issues and Errors
76+
77+
Use the steps in this section to diagnose and fix common problems in agent networks.
78+
79+
=== Issue: Traces Not Shown
80+
81+
If Anypoint Monitoring isn't showing traces for agents and MCP servers, check these settings:
82+
83+
* In API Manager, verify you've enabled the tracing policy for all brokers and agents.
84+
* In the managed Flex Gateways, verify that you've enabled Distributed Tracing for ingress and egress.
85+
86+
=== Issue: Agent Visualizer Shows Disconnected Nodes
87+
88+
If Agent Visualizer shows disconnected nodes with no edges, delete the `extensions` from the `spec.capabilities` section in `agent-network.yaml`.
89+
90+
=== Issue: Null Response from Broker
91+
92+
If your agent network broker returns a null response, restart the broker.
93+
94+
=== Issue: No Agent Network Commands in Anypoint Code Builder
95+
96+
If you installed Anypoint Code Builder successfully, but you don’t see agent network commands in the interface, verify that you have the latest version of the Anypoint Extension Pack. Then, restart VS Code.
97+
98+
=== Issue: No Agent Network Deployment Targets
99+
100+
If you attempt to deploy an agent network, but you don’t see any deployment targets in Anypoint Code Builder or Anypoint CLI, then you need to set up your target deployment space and set up gateways. For instructions, see xref:anypoint-code-builder::af-get-started.adoc[Get Started with Agent Networks].
101+
102+
=== Error: "Cannot complete task due to issue accessing reasoning engine"
103+
104+
This is a generic error that the broker issues when the LLM fails. To troubleshoot this error, <<enable-message-logging,enable the message logging policy>> on the LLM instance, and then review the logs to determine the cause of the error.
105+
106+
=== Error: "HTTP error 404: Agent card not found at /.well-known/agent-card.json"
107+
108+
You can encounter this error in two different scenarios:
109+
110+
. The agent card URL is incorrect. In this case:
111+
+
112+
* Check that the URL you set on the connection ends with a `/`.
113+
* Use a browser or Postman to ping the URL you configured prefixed with `.well-known/agent-card.json`, for example, https://ping-id-agent-url/pingid/.well-known/agent-card.json
114+
. The A2A agent is not configured to use A2A protocol version 0.3.0. In this case:
115+
+
116+
* If you created the agent with MuleSoft, verify that you are using the A2A connector version 0.4.0 or later.
117+
* If you are using an external agent, verify that it uses the A2A protocol version 0.3.0.

modules/ROOT/pages/af-troubleshoot-anypoint-code-builder.adoc

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)