aeron-io/aeron · error · ArchiveException

failed to send get recording position request

Error message

failed to send get recording position request

What it means

AeronArchive.getRecordingPosition() throws this ArchiveException when the get-recording-position request could not be offered to the archive control-request publication. archiveProxy.getRecordingPosition() returned false (publication not connected, closed, or back-pressured for the whole retry window), so pollForResponse never executes and no position is returned.

Solutions

  1. Check that the archive is running and the control channel settings match between client and archive.
  2. Retry the call after a short backoff; the failed offer is often transient back-pressure.
  3. Reconnect with AeronArchive.connect() if the control session has been closed server-side.
  4. Slow down polling loops so the control publication buffer does not fill.
  5. Review archive logs for session timeouts or publication errors preceding this failure.
Defensive patterns

Strategy: retry

Validate before calling

if (!archive.archiveProxy().controlPublication().isConnected()) {
    throw new IllegalStateException("archive control publication not connected");
}

Try / catch

try {
    long pos = archive.getRecordingPosition(recordingId);
} catch (ArchiveException e) {
    if (e.getMessage().contains("failed to send get recording position request")) {
        Thread.sleep(backoffMs); // retry or reconnect
    } else { throw e; }
}

Prevention

When it happens

Trigger: Calling getRecordingPosition(recordingId) while the archive control stream cannot accept requests: archive process down, control session expired or closed by the archive, control-request buffer full, or misconfigured control channel/endpoint.

Common situations: Live-progress monitors polling recording positions during an archive restart; long-lived clients whose session was reaped; bursts of position queries queuing on a saturated control publication.

Understand the failure class

Background: "API request failed": what wrapped HTTP errors from external APIs mean and how to find the real cause — this error's family across 29 libraries.

Related errors


AI-assisted analysis of aeron-io/aeron@6d60124e15 (2026-09-12). Data as JSON: /api/errors/49bffadc1628bb5d. Report an issue: GitHub.

Appendix: source

Thrown at aeron-archive/src/main/java/io/aeron/archive/client/AeronArchive.java:1552

     * Get the position recorded for an active recording. If no active recording then return {@link #NULL_POSITION}.
     *
     * @param recordingId of the active recording for which the position is required.
     * @return the recorded position for the active recording or {@link #NULL_POSITION} if recording not active.
     * @see #getStopPosition(long)
     */
    public long getRecordingPosition(final long recordingId)
    {
        lock.lock();
        try
        {
            ensureConnected();
            ensureNotReentrant();

            lastCorrelationId = aeron.nextCorrelationId();

            if (!archiveProxy.getRecordingPosition(recordingId, lastCorrelationId, controlSessionId))
            {
                throw new ArchiveException("failed to send get recording position request");
            }

            return pollForResponse(lastCorrelationId);
        }
        finally
        {
            lock.unlock();
        }
    }

    /**
     * Get the stop position for a recording.
     *
     * @param recordingId of the recording for which the position is required.
     * @return the stop position, or {@link #NULL_POSITION} if still active.
     * @see #getRecordingPosition(long)
     */
    public long getStopPosition(final long recordingId)

View on GitHub (pinned to 6d60124e15)