prestodb/presto · error

UNEXPECTED_ACCUMULO_ERROR

UNEXPECTED_ACCUMULO_ERROR

Error message

Index mutation rejected by server

What it means

PrestoException with code UNEXPECTED_ACCUMULO_ERROR thrown from addIndexMutation when Accumulo's BatchWriter rejects an individual index mutation (MutationsRejectedException). This typically means the index table's constraints, security labels, or server state invalidated the write. The rejection is fail-fast: the indexing operation aborts.

Source

Thrown at presto-accumulo/src/main/java/com/facebook/presto/accumulo/index/Indexer.java:266

    }

    public void index(Iterable<Mutation> mutations)
    {
        for (Mutation mutation : mutations) {
            index(mutation);
        }
    }

    private void addIndexMutation(ByteBuffer row, ByteBuffer family, ColumnVisibility visibility, byte[] qualifier)
    {
        // Create the mutation and add it to the batch writer
        Mutation indexMutation = new Mutation(row.array());
        indexMutation.put(family.array(), qualifier, visibility, EMPTY_BYTES);
        try {
            indexWriter.addMutation(indexMutation);
        }
        catch (MutationsRejectedException e) {
            throw new PrestoException(UNEXPECTED_ACCUMULO_ERROR, "Index mutation rejected by server", e);
        }

        // Increment the cardinality metrics for this value of index
        // metrics is a mapping of row ID to column family
        MetricsKey key = new MetricsKey(row, family, visibility);
        AtomicLong count = metrics.get(key);
        if (count == null) {
            count = new AtomicLong(0);
            metrics.put(key, count);
        }

        count.incrementAndGet();
    }

    /**
     * Flushes all Mutations in the index writer. And all metric mutations to the metrics table.
     * Note that the metrics table is not updated until this method is explicitly called (or implicitly via close).
     */

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Inspect MutationsRejectedException's constraint violation summaries and security error codes to find the rejecting constraint or authorization
  2. Ensure the Presto Accumulo user has WRITE permission on the index table and Authorizations covering the mutation's visibility label
  3. Fix the offending row data or visibility expression; correct any custom constraint that flags it
  4. Verify the index table is online and the BatchWriter is not used after close

Example fix

// before
indexWriter.addMutation(indexMutation); // rejection aborts indexing with generic message
// after
try {
    indexWriter.addMutation(indexMutation);
} catch (MutationsRejectedException e) {
    e.getConstraintViolationSummaries().forEach(v -> log.warn("constraint: " + v.getDescription()));
    e.getSecurityErrorCodes().forEach((t, codes) -> log.warn("authz failure on " + t + ": " + codes));
    throw e;
}
Defensive patterns

Strategy: try-catch

Validate before calling

// before writing, ensure the writer user can write and has needed authorizations
if (!conn.securityOperations().hasTablePermission(user, indexTable, TablePermission.WRITE))
    throw new IllegalStateException("no WRITE permission on index table");
Authorizations auths = conn.securityOperations().getUserAuthorizations(user);
// assert auths covers every visibility label planned for index mutations

Type guard

static boolean isMutationRejection(PrestoException e) {
    return e.getCause() instanceof MutationsRejectedException;
}

Try / catch

try {
    indexer.index(row, family, qualifier, visibility, value);
} catch (PrestoException e) {
    if (e.getCause() instanceof MutationsRejectedException mre) {
        mre.getConstraintViolationSummaries().forEach(v -> log.warn("constraint: " + v));
        mre.getSecurityErrorCodes().forEach((t, codes) -> log.warn("authz on " + t + ": " + codes));
    }
    throw e;
}

Prevention

When it happens

Trigger: Calling Indexer.index -> addIndexMutation while Accumulo rejects the mutation: a violated constraint, a column visibility label the writer's user is not authorized for, the index table offline, or server-side write errors.

Common situations: Row visibility (security label) not covered by the user's Authorizations; Accumulo constraint violations from bad data; missing WRITE permission on the index table for the Presto Accumulo user; tservers failing during ingest.

Related errors


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/936944376b98f95c. Report an issue: GitHub.