apache/hadoop · error · IOException

Can't handle old inotify server response.

Error message

Can't handle old inotify server response.

What it means

When converting a GetEditsFromTxidResponseProto, the client finds the deprecated EventsListProto.events field populated instead of the batchList field. That layout belongs to an old pre-batching NameNode (pre-2.6 inotify protocol); modern clients can only decode EventBatchProto batches and refuse the old format with an IOException.

Source

Thrown at hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocolPB/PBHelperClient.java:882

      return new BlockStoragePolicy[0];
    }
    BlockStoragePolicy[] policies = new BlockStoragePolicy[policyProtos.size()];
    int i = 0;
    for (BlockStoragePolicyProto proto : policyProtos) {
      policies[i++] = convert(proto);
    }
    return policies;
  }

  public static EventBatchList convert(GetEditsFromTxidResponseProto resp)
      throws IOException {
    final InotifyProtos.EventsListProto list = resp.getEventsList();
    final long firstTxid = list.getFirstTxid();
    final long lastTxid = list.getLastTxid();

    List<EventBatch> batches = Lists.newArrayList();
    if (list.getEventsList().size() > 0) {
      throw new IOException("Can't handle old inotify server response.");
    }
    for (InotifyProtos.EventBatchProto bp : list.getBatchList()) {
      long txid = bp.getTxid();
      if ((txid != -1) && ((txid < firstTxid) || (txid > lastTxid))) {
        throw new IOException("Error converting TxidResponseProto: got a " +
            "transaction id " + txid + " that was outside the range of [" +
            firstTxid + ", " + lastTxid + "].");
      }
      List<Event> events = Lists.newArrayList();
      for (InotifyProtos.EventProto p : bp.getEventsList()) {
        switch (p.getType()) {
        case EVENT_CLOSE:
          InotifyProtos.CloseEventProto close =
              InotifyProtos.CloseEventProto.parseFrom(p.getContents());
          events.add(new Event.CloseEvent(close.getPath(),
              close.getFileSize(), close.getTimestamp()));
          break;
        case EVENT_CREATE:

View on GitHub (pinned to 2add963021)

Solutions

  1. Upgrade the NameNode/cluster to a version with batched inotify events (Hadoop 2.6+)
  2. Or use a client version matching the cluster and do not use the inotify API there
  3. Feature-detect the server version before relying on inotify
Defensive patterns

Strategy: validation

Validate before calling

// before relying on inotify, require a server that emits batched events
if (serverVersionIsOlderThan("2.6.0")) {
  usePollingOrUpgrade(); // avoid getEditsFromTxid against old NameNodes
}

Try / catch

catch (IOException e) with message containing "old inotify server response": stop using inotify against this cluster; no retry can succeed.

Prevention

When it happens

Trigger: A modern client calls getEditsFromTxid / DFSInotifyEventInputStream against a NameNode old enough to return raw events; list.getEventsList().size() > 0 trips the guard during PBHelperClient.convert.

Common situations: Application bundling newer hadoop-client jars against a legacy cluster; test harnesses pointed at old clusters; using inotify before event batching stabilized.

Related errors


AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22). Data as JSON: /api/errors/3afa87e84cf1f1ce. Report an issue: GitHub.