theonedev/onedev · error · ExplicitException
Error calling tool '', check server log for details
Error message
Error calling tool '', check server log for details
What it means
ToolUtils.handleCallException's fallback: if a tool call fails with an exception that is neither an UnauthorizedException nor an ExplicitException, it logs 'Error calling tool: <name>' and throws ExplicitException telling the user to check the server log. The empty tool name in the shown message just means toolName was an empty string at the call site.
Source
Thrown at server-core/src/main/java/io/onedev/server/ai/ToolUtils.java:103
var objectMapper = getObjectMapper();
if (toolExecutionRequest.arguments() == null)
return objectMapper.createObjectNode();
try {
return objectMapper.readTree(toolExecutionRequest.arguments());
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
}
public static void handleCallException(String toolName, Throwable exception) {
if (ExceptionUtils.find(exception, UnauthorizedException.class) != null)
throw new ExplicitException("Permission denied calling tool: " + toolName);
var explicitException = ExceptionUtils.find(exception, ExplicitException.class);
if (explicitException != null)
throw explicitException;
logger.error("Error calling tool: " + toolName, exception);
throw new ExplicitException("Error calling tool '" + toolName + "', check server log for details");
}
public static ChatTool wrapForChat(TaskTool taskTool) {
return new ChatTool() {
@Override
public ToolSpecification getSpecification() {
return taskTool.getSpecification();
}
@Override
public CompletableFuture<ToolExecutionResult> execute(@Nullable IPartialPageRequestHandler handler, Subject subject, JsonNode arguments) {
return CompletableFuture.completedFuture(taskTool.execute(subject, arguments));
}
};
}
public static List<ChatTool> wrapForChat(List<TaskTool> taskTools) {View on GitHub (pinned to d44925c47c)
Solutions
- Inspect the server log for 'Error calling tool: <name>' to find the root-cause stack trace.
- Fix the underlying cause (project state, storage, configuration) indicated by the stack trace.
- Ensure the tool name is passed correctly at call sites (empty name hampers diagnosis).
- Retry the tool call after addressing the root cause.
Example fix
// before
ToolUtils.handleCallException("", e); // empty toolName obscures the error
// after
ToolUtils.handleCallException("submitJob", e); Defensive patterns
Strategy: try-catch
Try / catch
try { return callTool(name, args); } catch (e) { if (/Error calling tool '.*', check server log/.test(e.message)) { logger.warn("Tool " + name + " failed; inspect server log", e); return fallbackResult; } throw e; } Prevention
- Always pass the real tool name to handleCallException
- Monitor server logs for 'Error calling tool' entries
- Wrap tool implementations to convert known failures into ExplicitException with actionable messages
When it happens
Trigger: Any unexpected runtime exception inside a wrapped AI tool (NPEs, IO errors, service failures) — anything not explicitly categorized — reaching handleCallException.
Common situations: Underlying OneDev services throwing unexpected errors (storage issues, git failures); bugs in tool implementations; server-side misconfiguration surfaced through tools.
Related errors
AI-assisted analysis of theonedev/onedev@d44925c47c (2026-09-06).
Data as JSON: /api/errors/711df9fff87956bb.
Report an issue: GitHub.