{"record":{"id":"936944376b98f95c","repo":"prestodb/presto","slug":"unexpected-accumulo-error-936944","errorCode":"UNEXPECTED_ACCUMULO_ERROR","errorMessage":"Index mutation rejected by server","messagePattern":"Index mutation rejected by server","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"presto-accumulo/src/main/java/com/facebook/presto/accumulo/index/Indexer.java","lineNumber":266,"sourceCode":"    }\n\n    public void index(Iterable<Mutation> mutations)\n    {\n        for (Mutation mutation : mutations) {\n            index(mutation);\n        }\n    }\n\n    private void addIndexMutation(ByteBuffer row, ByteBuffer family, ColumnVisibility visibility, byte[] qualifier)\n    {\n        // Create the mutation and add it to the batch writer\n        Mutation indexMutation = new Mutation(row.array());\n        indexMutation.put(family.array(), qualifier, visibility, EMPTY_BYTES);\n        try {\n            indexWriter.addMutation(indexMutation);\n        }\n        catch (MutationsRejectedException e) {\n            throw new PrestoException(UNEXPECTED_ACCUMULO_ERROR, \"Index mutation rejected by server\", e);\n        }\n\n        // Increment the cardinality metrics for this value of index\n        // metrics is a mapping of row ID to column family\n        MetricsKey key = new MetricsKey(row, family, visibility);\n        AtomicLong count = metrics.get(key);\n        if (count == null) {\n            count = new AtomicLong(0);\n            metrics.put(key, count);\n        }\n\n        count.incrementAndGet();\n    }\n\n    /**\n     * Flushes all Mutations in the index writer. And all metric mutations to the metrics table.\n     * Note that the metrics table is not updated until this method is explicitly called (or implicitly via close).\n     */","sourceCodeStart":248,"sourceCodeEnd":284,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-accumulo/src/main/java/com/facebook/presto/accumulo/index/Indexer.java#L248-L284","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Inspect MutationsRejectedException's constraint violation summaries and security error codes to find the rejecting constraint or authorization","Ensure the Presto Accumulo user has WRITE permission on the index table and Authorizations covering the mutation's visibility label","Fix the offending row data or visibility expression; correct any custom constraint that flags it","Verify the index table is online and the BatchWriter is not used after close"],"exampleFix":"// before\nindexWriter.addMutation(indexMutation); // rejection aborts indexing with generic message\n// after\ntry {\n    indexWriter.addMutation(indexMutation);\n} catch (MutationsRejectedException e) {\n    e.getConstraintViolationSummaries().forEach(v -> log.warn(\"constraint: \" + v.getDescription()));\n    e.getSecurityErrorCodes().forEach((t, codes) -> log.warn(\"authz failure on \" + t + \": \" + codes));\n    throw e;\n}","handlingStrategy":"try-catch","validationCode":"// before writing, ensure the writer user can write and has needed authorizations\nif (!conn.securityOperations().hasTablePermission(user, indexTable, TablePermission.WRITE))\n    throw new IllegalStateException(\"no WRITE permission on index table\");\nAuthorizations auths = conn.securityOperations().getUserAuthorizations(user);\n// assert auths covers every visibility label planned for index mutations","typeGuard":"static boolean isMutationRejection(PrestoException e) {\n    return e.getCause() instanceof MutationsRejectedException;\n}","tryCatchPattern":"try {\n    indexer.index(row, family, qualifier, visibility, value);\n} catch (PrestoException e) {\n    if (e.getCause() instanceof MutationsRejectedException mre) {\n        mre.getConstraintViolationSummaries().forEach(v -> log.warn(\"constraint: \" + v));\n        mre.getSecurityErrorCodes().forEach((t, codes) -> log.warn(\"authz on \" + t + \": \" + codes));\n    }\n    throw e;\n}","preventionTips":["Grant the Presto Accumulo user WRITE on the index table and authorizations covering all visibility labels","Validate visibility expressions against the user's authorizations before ingest","Avoid data that violates Accumulo constraints (oversized values, invalid characters)","Keep the index table online; don't close the BatchWriter prematurely"],"tags":["accumulo","presto","mutation-rejected","security-label"],"backgroundTag":"accumulo-mutations-rejected","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}