{"record":{"id":"00e1975cbef95b87","repo":"prestodb/presto","slug":"unexpected-accumulo-error-00e197","errorCode":"UNEXPECTED_ACCUMULO_ERROR","errorMessage":"Failed to create batch scanner for table %s","messagePattern":"Failed to create batch scanner for table (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"presto-accumulo/src/main/java/com/facebook/presto/accumulo/io/AccumuloRecordSet.java","lineNumber":99,"sourceCode":"        catch (Exception e) {\n            throw new PrestoException(NOT_FOUND, \"Failed to factory serializer class.  Is it on the classpath?\", e);\n        }\n\n        // Save off the column handles and create a list of the Accumulo types\n        this.columnHandles = requireNonNull(columnHandles, \"column handles is null\");\n        ImmutableList.Builder<Type> types = ImmutableList.builder();\n        for (AccumuloColumnHandle column : columnHandles) {\n            types.add(column.getType());\n        }\n        this.columnTypes = types.build();\n\n        try {\n            // Create the BatchScanner and set the ranges from the split\n            scanner = connector.createBatchScanner(split.getFullTableName(), getScanAuthorizations(session, split, connector, username), 10);\n            scanner.setRanges(split.getRanges());\n        }\n        catch (Exception e) {\n            throw new PrestoException(UNEXPECTED_ACCUMULO_ERROR, format(\"Failed to create batch scanner for table %s\", split.getFullTableName()), e);\n        }\n    }\n\n    /**\n     * Gets the scanner authorizations to use for scanning tables.\n     * <p>\n     * In order of priority: session username authorizations, then table property, then the default connector auths.\n     *\n     * @param session Current session\n     * @param split Accumulo split\n     * @param connector Accumulo connector\n     * @param username Accumulo username\n     * @return Scan authorizations\n     * @throws AccumuloException If a generic Accumulo error occurs\n     * @throws AccumuloSecurityException If a security exception occurs\n     */\n    private static Authorizations getScanAuthorizations(ConnectorSession session, AccumuloSplit split, Connector connector, String username)\n            throws AccumuloException, AccumuloSecurityException","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-accumulo/src/main/java/com/facebook/presto/accumulo/io/AccumuloRecordSet.java#L81-L117","documentation":"AccumuloRecordSet creates a BatchScanner with 10 query threads against the split's table using the configured scan authorizations. If Accumulo's Connector.createBatchScanner throws (TableNotFoundException, AccumuloSecurityException, AccumuloException), it is wrapped as UNEXPECTED_ACCUMULO_ERROR. The table could not be scanned at all.","triggerScenarios":"connector.createBatchScanner(split.getFullTableName(), ...) throwing because the table does not exist, the user lacks scan permissions, or the Accumulo connection/instance is unreachable; also scanner.setRanges failing.","commonSituations":"Table dropped concurrently while a query was running; scan authorizations configured in the session do not match the user's Accumulo authorizations; Accumulo instance name or zookeepers misconfigured; user credentials lack the Table.READ permission.","solutions":["Verify the full table name exists in Accumulo (Accumulo shell: tables list) and the split is not stale","Check the Accumulo user has READ permission on the table and that the configured authorizations are a subset of the user's authorizations","Confirm Accumulo connection settings (zookeepers, instance name, credentials) in the catalog properties are correct","Check Accumulo master/tablet server health and network reachability to zookeepers and tserver ports"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// before querying, confirm table exists and user can scan\nConnector conn = ...;\nif (!conn.tableOperations().exists(fullTableName)) {\n    throw new IllegalStateException(\"Accumulo table missing: \" + fullTableName);\n}\nconn.securityOperations().hasTablePermission(user, fullTableName, TablePermission.READ);","typeGuard":null,"tryCatchPattern":"try {\n    // run query against accumulo connector\n} catch (PrestoException e) {\n    if (e.getErrorCode().getName().equals(\"UNEXPECTED_ACCUMULO_ERROR\") && e.getMessage().contains(\"batch scanner\")) {\n        // check table existence / auths, then retry with backoff\n    }\n    throw e;\n}","preventionTips":["Verify catalog properties (zookeepers, instance, credentials) before deploying","Grant the Accumulo user Table.READ on all queried tables","Ensure session scan authorizations are a subset of the user's max authorizations","Avoid dropping Accumulo tables while Presto queries are running"],"tags":["accumulo","scanner","permissions","table-not-found"],"backgroundTag":"accumulo-batch-scan-failure","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"}