{"record":{"id":"780ec7c08b8d9770","repo":"prestodb/presto","slug":"unexpected-accumulo-error-780ec7","errorCode":"UNEXPECTED_ACCUMULO_ERROR","errorMessage":"Failed to check for existence or create Accumulo namespace","messagePattern":"Failed to check for existence or create Accumulo namespace","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-accumulo/src/main/java/com/facebook/presto/accumulo/AccumuloTableManager.java","lineNumber":68,"sourceCode":"    {\n        this.connector = requireNonNull(connector, \"connector is null\");\n    }\n\n    /**\n     * Ensures the given Accumulo namespace exist, creating it if necessary\n     *\n     * @param schema Presto schema (Accumulo namespace)\n     */\n    public void ensureNamespace(String schema)\n    {\n        try {\n            // If the table schema is not \"default\" and the namespace does not exist, create it\n            if (!schema.equals(DEFAULT) && !connector.namespaceOperations().exists(schema)) {\n                connector.namespaceOperations().create(schema);\n            }\n        }\n        catch (AccumuloException | AccumuloSecurityException e) {\n            throw new PrestoException(UNEXPECTED_ACCUMULO_ERROR, \"Failed to check for existence or create Accumulo namespace\", e);\n        }\n        catch (NamespaceExistsException e) {\n            // Suppress race condition between test for existence and creation\n            LOG.warn(\"NamespaceExistsException suppressed when creating \" + schema);\n        }\n    }\n\n    public boolean exists(String table)\n    {\n        return connector.tableOperations().exists(table);\n    }\n\n    public void createAccumuloTable(String table)\n    {\n        try {\n            connector.tableOperations().create(table);\n        }\n        catch (AccumuloException | AccumuloSecurityException e) {","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-accumulo/src/main/java/com/facebook/presto/accumulo/AccumuloTableManager.java#L50-L86","documentation":"AccumuloTableManager.ensureNamespace checks whether the table's schema (namespace, if not 'default') exists and creates it when missing. Any AccumuloException or AccumuloSecurityException in that check/create is wrapped as UNEXPECTED_ACCUMULO_ERROR; a benign race (NamespaceExistsException) is intentionally suppressed with a warning.","triggerScenarios":"Creating a Presto table in a schema whose Accumulo namespace does not exist, when the namespaceOperations().exists() call or create() fails due to a permissions problem, ZooKeeper/master error, or another Accumulo-level failure.","commonSituations":"Accumulo user lacks Namespace.CREATE permission; namespace created concurrently in a rare non-race failure; Accumulo master unavailable; schema name invalid as an Accumulo namespace identifier.","solutions":["Grant the connector's Accumulo user the CREATE namespace permission: 'grant Namespace.CREATE -ns <schema> -u presto' (or System.CREATE).","Pre-create the namespace manually in the Accumulo shell: 'createnamespace <schema>'.","Check Accumulo master/monitor logs for the underlying AccumuloException cause.","Validate the schema name is a legal Accumulo namespace identifier (no illegal characters)."],"exampleFix":"// Accumulo shell, as root:\n// before: presto user cannot create namespaces\nsystem permission -u presto -s\n// after\ncreatenamespace myschema\ngrant Namespace.CREATE -ns myschema -u presto","handlingStrategy":"validation","validationCode":"// Ensure the namespace exists (or is creatable) before table creation:\nif (!\"default\".equals(schema) && !conn.namespaceOperations().exists(schema)) {\n  conn.namespaceOperations().create(schema); // run with an admin user or pre-create it\n}","typeGuard":null,"tryCatchPattern":"try {\n  tableManager.ensureNamespace(schema);\n} catch (PrestoException e) {\n  if (e.getErrorCode().getName().equals(\"UNEXPECTED_ACCUMULO_ERROR\")) {\n    // grant Namespace.CREATE to the connector user or pre-create the namespace, then retry\n  }\n  throw e;\n}","preventionTips":["Pre-create all needed namespaces in the Accumulo shell before deploying the catalog.","Grant the connector user Namespace.CREATE permission up front.","Validate schema names as legal Accumulo namespace identifiers.","Monitor Accumulo master availability; ensureNamespace fails when the cluster is degraded."],"tags":["accumulo","namespace","permissions","ddl"],"backgroundTag":"insufficient-permissions","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"}