apache/hadoop · error · IOException

Unexpected error while invoking API

Error message

Unexpected error while invoking API {}

What it means

Router catch-all around concurrent invocation: an unexpected runtime error escaped while invoking the remote method futures; it is wrapped in an IOException naming the API and propagated to the caller.

Solutions

  1. Examine the chained exception in the Router log for the underlying cause (IOException type).
  2. If it is a transient standby/unavailable error, retry the operation.
  3. Verify the invoked API is supported by the target subcluster's Hadoop version.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: An unclassified exception escaped while the Router was invoking an API on a namenode.

Common situations: Unexpected IOExceptions from the subcluster, version incompatibilities, or bugs surfaced during RPC fan-out.


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

Appendix: source

Thrown at hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcClient.java:1696

        futures = executorService.invokeAll(
            callables, timeOutMs, TimeUnit.MILLISECONDS);
      } else {
        futures = executorService.invokeAll(callables);
      }
      return processFutures(method, m, orderedLocations, futures);
    } catch (RejectedExecutionException e) {
      if (rpcMonitor != null) {
        rpcMonitor.proxyOpFailureClientOverloaded();
      }
      int active = executorService.getActiveCount();
      int total = executorService.getMaximumPoolSize();
      String msg = "Not enough client threads " + active + "/" + total;
      LOG.error(msg);
      throw new StandbyException(
          "Router " + router.getRouterId() + " is overloaded: " + msg);
    } catch (InterruptedException ex) {
      LOG.error("Unexpected error while invoking API: {}", ex.getMessage());
      throw new IOException(
          "Unexpected error while invoking API " + ex.getMessage(), ex);
    } finally {
      releasePermit(CONCURRENT_NS, ugi, method, controller);
    }
  }

  /**
   * Handle all futures during the invokeConcurrent call process.
   *
   * @param <T> The type of the remote location.
   * @param <R> The type of the remote method return.
   * @param method The remote method and parameters to invoke.
   * @param m The method to invoke.
   * @param orderedLocations List of remote locations to call concurrently.
   * @param futures all futures during the invokeConcurrent call process.
   * @return Result of invoking the method per subcluster (list of results),
   *         This includes the exception for each remote location.
   * @throws InterruptedException if the current thread was interrupted while waiting.

View on GitHub (pinned to 2add963021)