apache/hadoop · error · IOException
Print network topology failed. {}
Error message
Print network topology failed. {} What it means
Error "Print network topology failed. {}" thrown in apache/hadoop.
Source
Thrown at hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NetworkTopologyServlet.java:79
if (FORMAT_TEXT.equals(format)) {
response.setContentType("text/plain; charset=UTF-8");
} else if (FORMAT_JSON.equals(format)) {
response.setContentType("application/json; charset=UTF-8");
}
NameNode nn = NameNodeHttpServer.getNameNodeFromContext(context);
BlockManager bm = nn.getNamesystem().getBlockManager();
List<Node> leaves = bm.getDatanodeManager().getNetworkTopology()
.getLeaves(NodeBase.ROOT);
try (PrintStream out = new PrintStream(
response.getOutputStream(), false, "UTF-8")) {
printTopology(out, leaves, format);
} catch (Throwable t) {
String errMsg = "Print network topology failed. "
+ StringUtils.stringifyException(t);
response.sendError(HttpServletResponse.SC_GONE, errMsg);
throw new IOException(errMsg);
} finally {
response.getOutputStream().close();
}
}
/**
* Display each rack and the nodes assigned to that rack, as determined
* by the NameNode, in a hierarchical manner. The nodes and racks are
* sorted alphabetically.
*
* @param stream print stream
* @param leaves leaves nodes under base scope
* @param format the response format
*/
protected void printTopology(PrintStream stream, List<Node> leaves,
String format) throws BadFormatException, IOException {
if (leaves.isEmpty()) {
stream.print("No DataNodes");View on GitHub (pinned to 2add963021)
Solutions
- Check NameNode logs for the topology error detail and verify the network topology (script or table) configuration is valid.
When it happens
Trigger: The /topology or printTopology servlet fails while rendering the cluster network topology.
Common situations: A broken net topology script or dfs.networkscript configuration causing topology resolution failure.
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/0caba2fb71623daa.
Report an issue: GitHub.