ecaudit icon indicating copy to clipboard operation
ecaudit copied to clipboard

Unable to re-create legacy whitelist table

Open eperott opened this issue 5 years ago • 0 comments

When upgrading to ecAudit 2.0.0 or later a new format for the internal whitelist table is introduced. Once the upgrade is completed it is recommended to drop the legacy whitelist table using a custom cql command.

If for some reason the operator trigger this command to early (before all nodes are upgraded to ecAudit 2.0.0 or later), then it should be possible to re-create the legacy whitelist table simply by restarting one of the nodes which is still running on the old version. However, this doesn't work. Instead nodes fail to start:

2019-11-14T08:21:11.625+0100 [main] ERROR o.a.c.service.CassandraDaemon:726 exitOrFail Exception encountered during startup
java.lang.AssertionError: org.apache.cassandra.exceptions.InvalidRequestException: unconfigured table role_audit_whitelists
        at com.ericsson.bss.cassandra.ecaudit.auth.WhitelistDataAccess.prepare(WhitelistDataAccess.java:158) ~[ecaudit_c3.0-1.0.0.jar:na]
        at com.ericsson.bss.cassandra.ecaudit.auth.WhitelistDataAccess.setup(WhitelistDataAccess.java:59) ~[ecaudit_c3.0-1.0.0.jar:na]
        at com.ericsson.bss.cassandra.ecaudit.auth.AuditWhitelistManager.setup(AuditWhitelistManager.java:75) ~[ecaudit_c3.0-1.0.0.jar:na]
        at com.ericsson.bss.cassandra.ecaudit.auth.AuditRoleManager.setup(AuditRoleManager.java:78) ~[ecaudit_c3.0-1.0.0.jar:na]
        at org.apache.cassandra.service.StorageService.doAuthSetup(StorageService.java:1006) ~[apache-cassandra-3.0.17-E004.jar:3.0.17-E004]
        at org.apache.cassandra.service.StorageService.finishJoiningRing(StorageService.java:997) ~[apache-cassandra-3.0.17-E004.jar:3.0.17-E004]
        at org.apache.cassandra.service.StorageService.joinTokenRing(StorageService.java:934) ~[apache-cassandra-3.0.17-E004.jar:3.0.17-E004]
        at org.apache.cassandra.service.StorageService.initServer(StorageService.java:659) ~[apache-cassandra-3.0.17-E004.jar:3.0.17-E004]
        at org.apache.cassandra.service.StorageService.initServer(StorageService.java:572) ~[apache-cassandra-3.0.17-E004.jar:3.0.17-E004]
        at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:362) [apache-cassandra-3.0.17-E004.jar:3.0.17-E004]
        at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:585) [apache-cassandra-3.0.17-E004.jar:3.0.17-E004]
        at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:713) [apache-cassandra-3.0.17-E004.jar:3.0.17-E004]
Caused by: org.apache.cassandra.exceptions.InvalidRequestException: unconfigured table role_audit_whitelists
        at org.apache.cassandra.thrift.ThriftValidation.validateColumnFamilyWithCompactMode(ThriftValidation.java:119) ~[apache-cassandra-3.0.17-E004.jar:3.0.17-E004]
        at org.apache.cassandra.cql3.statements.SelectStatement$RawStatement.prepare(SelectStatement.java:897) ~[apache-cassandra-3.0.17-E004.jar:3.0.17-E004]
        at org.apache.cassandra.cql3.statements.SelectStatement$RawStatement.prepare(SelectStatement.java:892) ~[apache-cassandra-3.0.17-E004.jar:3.0.17-E004]
        at com.ericsson.bss.cassandra.ecaudit.auth.WhitelistDataAccess.prepare(WhitelistDataAccess.java:154) ~[ecaudit_c3.0-1.0.0.jar:na]
        ... 11 common frames omitted

Neither is it possible to create this table manually (since this is not allowed in system keyspaces), leaving the operator in a rather tricky situation.

eperott avatar Nov 14 '19 08:11 eperott