{"record":{"id":"e623aee27a7f94b8","repo":"apache/cassandra","slug":"cannot-enable-accord-on-system-tables-s-s-e623ae","errorCode":null,"errorMessage":"Cannot enable accord on system tables (%s.%s)","messagePattern":"Cannot enable accord on system tables \\((.+?)\\.(.+?)\\)","errorType":"validation","errorClass":"InvalidRequestException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/cql3/statements/schema/CreateTableStatement.java","lineNumber":189,"sourceCode":"        expandedCql = builder.build().toCqlString(false, attrs.hasProperty(TableAttributes.ID), ifNotExists);\n        verifyExpandedCql(expandedCql);\n\n        if (!attrs.hasProperty(TableAttributes.ID))\n            builder.id(TableId.get(metadata));\n        TableMetadata table = builder.build();\n        table.validate();\n\n        if (keyspace.replicationStrategy.hasTransientReplicas()\n            && table.params.readRepair != ReadRepairStrategy.NONE)\n        {\n            throw ire(\"read_repair must be set to 'NONE' for transiently replicated keyspaces\");\n        }\n\n        if (!table.params.compression.isEnabled() && !SchemaConstants.isSystemKeyspace(table.keyspace))\n            Guardrails.uncompressedTablesEnabled.ensureEnabled(state);\n\n        if (table.params.transactionalMode.accordIsEnabled && SchemaConstants.isSystemKeyspace(keyspaceName))\n            throw ire(\"Cannot enable accord on system tables (%s.%s)\", keyspaceName, tableName);\n\n        if (table.params.transactionalMode.accordIsEnabled && !DatabaseDescriptor.getAccordTransactionsEnabled())\n            throw ire(format(\"Cannot create table %s.%s with transactional mode %s with accord.enabled set to false\",\n                             keyspaceName, tableName, table.params.transactionalMode));\n\n        if (table.params.transactionalMigrationFrom.isMigrating())\n            throw ire(\"Cannot set transactional migration on new tables (%s.%s), %s\", keyspaceName, tableName, table.params.transactionalMigrationFrom);\n\n        return schema.withAddedOrUpdated(keyspace.withSwapped(keyspace.tables.with(table)));\n    }\n\n    @Override\n    public void validate(ClientState state)\n    {\n        super.validate(state);\n\n        // If a memtable configuration is specified, validate it against config\n        if (attrs.hasOption(TableParams.Option.MEMTABLE))","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/cql3/statements/schema/CreateTableStatement.java#L171-L207","documentation":"Transactional mode based on Accord cannot be enabled on system keyspaces. Tables created in system keyspaces must not use Accord transactional mode, so CREATE TABLE rejects any table with transactionalMode.accordIsEnabled targeting a system keyspace.","triggerScenarios":"`CREATE TABLE system.t (...) WITH transactional_mode = 'accord'` (or similar Accord-enabled transactional mode) where SchemaConstants.isSystemKeyspace(keyspaceName) is true in apply().","commonSituations":"Attempting to extend Accord-backed transactional behavior to system keyspaces during experiments or migrations; automated DDL generators applying transactional_mode options unconditionally, including to system.* tables.","solutions":["Create the table in a non-system keyspace when using Accord transactional mode.","Drop the transactional_mode option for tables in system keyspaces.","Filter system keyspaces out of any DDL-generation pipeline that injects transactional_mode."],"exampleFix":"// before\nCREATE TABLE system.mytable (id int PRIMARY KEY) WITH transactional_mode = 'accord';\n\n// after\nCREATE TABLE myapp.mytable (id int PRIMARY KEY) WITH transactional_mode = 'accord';","handlingStrategy":"validation","validationCode":"if (isSystemKeyspace(ks) && tableOptions.containsKey(\"transactional_mode\")) throw new IllegalArgumentException(\"transactional_mode cannot be set on system keyspace tables\");","typeGuard":null,"tryCatchPattern":"try { session.execute(ddl); } catch (InvalidQueryException e) { if (e.getMessage().contains(\"Cannot enable accord on system tables\")) { /* retarget to a user keyspace or drop transactional_mode */ } else throw e; }","preventionTips":["Never generate DDL targeting system.* keyspaces from application tooling","Gate Accord transactional_mode options to application keyspaces only","Filter SchemaConstants system keyspaces in DDL generators"],"tags":["cassandra","cql","table","accord","system-keyspace"],"backgroundTag":"unsupported-operation","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}