Re: System auth empty, how to populate it

2018-07-18 Thread Thomas Lété
; >> >>> >> https://gist.github.com/bistory/ececc0bef7627f39a21e4e8f0c8d841c >>> >> <https://gist.github.com/bistory/ececc0bef7627f39a21e4e8f0c8d841c> >>> >> >>> >>> Le 18 juil. 2018 à 00:28, Horia Mocioi >> >>> <mailto:hori

Re: System auth empty, how to populate it

2018-07-18 Thread Sam Tunnicliffe
>>> >> >>> >>> Le 18 juil. 2018 à 00:28, Horia Mocioi >>> >>> a écrit : >>> >>> >>> >>> Cassandra allows to use custom authenticators so I would create a >>> >>> CustomPasswordAuthenticator. Th

Re: System auth empty, how to populate it

2018-07-18 Thread Thomas Lété
d create a >> >>> CustomPasswordAuthenticator. This would be a copy of the existing >> >>> PasswordAuthenticator. I would add several debugging info like: >> >>> provided username and password, the output of the checkpw function, >> >>&

Re: System auth empty, how to populate it

2018-07-18 Thread Sam Tunnicliffe
>> a écrit : >> >>> >> >>> Cassandra allows to use custom authenticators so I would create a >> >>> CustomPasswordAuthenticator. This would be a copy of the existing >> >>> PasswordAuthenticator. I would add several debugging inf

Re: System auth empty, how to populate it

2018-07-18 Thread Thomas Lété
gt;>> CustomPasswordAuthenticator. This would be a copy of the existing > >>> PasswordAuthenticator. I would add several debugging info like: > >>> provided username and password, the output of the checkpw function, > >>> what cql statement is exe

Re: System auth empty, how to populate it

2018-07-18 Thread Sam Tunnicliffe
tor. I would add several debugging info like: > >>> provided username and password, the output of the checkpw function, > >>> what cql statement is executed etc (any other info that would help > >>> me to understand what is being executed in the authenticator). >

Re: System auth empty, how to populate it

2018-07-18 Thread Thomas Lété
statement is executed etc (any other info that would help >>> me to understand what is being executed in the authenticator). >>> From: Thomas Lété >>> Sent: Tuesday, July 17, 2018 5:24:39 PM >>> To: user@cassandra.apache.org >>> Subject: Re: System auth

Re: System auth empty, how to populate it

2018-07-17 Thread Horia Mocioi
; what cql statement is executed etc (any other info that would help > > me to understand what is being executed in the authenticator). > > From: Thomas Lété > > Sent: Tuesday, July 17, 2018 5:24:39 PM > > To: user@cassandra.apache.org > > Subject: Re: System auth empty,

Re: System auth empty, how to populate it

2018-07-17 Thread Thomas Lété
ly 17, 2018 5:24:39 PM > To: user@cassandra.apache.org > Subject: Re: System auth empty, how to populate it > > Thanks for your reply, > > - I have not defined role_manager in the config > - I dropped the users table, it was present in the keyspace > - Cassandra then created a record in the

Re: System auth empty, how to populate it

2018-07-17 Thread Horia Mocioi
etc (any other info that would help me to understand what is being executed in the authenticator). From: Thomas Lété Sent: Tuesday, July 17, 2018 5:24:39 PM To: user@cassandra.apache.org Subject: Re: System auth empty, how to populate it Thanks for your reply

Re: System auth empty, how to populate it

2018-07-17 Thread Thomas Lété
Thanks for your reply, - I have not defined role_manager in the config - I dropped the users table, it was present in the keyspace - Cassandra then created a record in the roles table, yay ! But when I do clash -u cassandra -p cassandra => Invalid credentials supplied. Authentication error on ho

Re: System auth empty, how to populate it

2018-07-17 Thread Simon Fontana Oscarsson
Very strange. CassandraRoleManager will create cassandra user if it doesn't already exist (look in the setupDefaultRole method). Perhaps this is an issue with consistency. After starting Cassandra, could you try do a nodetool repair on system_auth keyspace on all nodes. I'm starting to run out of

Re: System auth empty, how to populate it

2018-07-17 Thread Sam Tunnicliffe
The default superuser is only created at startup if 3 conditions are met: i) The default role manager is configured. In cassandra.yaml, you should see "role_manager: CassandraRoleManager". This is also the default value, so unless you're explicitly using a custom role manager it should be good. ii

Re: System auth empty, how to populate it

2018-07-17 Thread Thomas Lété
Yes I did that multiple time, always following the same procedure : stop Cassandra, on all nodes, remove data, update config then restart nodes one by one… I really don’t understand when I could have done wrong... > Le 17 juil. 2018 à 16:15, Simon Fontana Oscarsson > a écrit : > > This is ve

Re: System auth empty, how to populate it

2018-07-17 Thread Simon Fontana Oscarsson
This is very strange behavior if Cassandra won't recreate the cassandra user when you delete the folder. So just to make sure, you are stopping Cassandra on all nodes and deleting the data directory? -- SIMON FONTANA OSCARSSON Software Developer Ericsson Ölandsgatan 1 37133 Karlskrona, Sweden

Re: System auth empty, how to populate it

2018-07-17 Thread Thomas Lété
It’s empty... > Le 17 juil. 2018 à 15:59, Horia Mocioi a écrit : > > Could you also send the output of "select * from system_auth.roles"? > (you will need to change authenticator to AllowAllAuthenticator and > authorizer to AllowAllAuthorizer) > > On tis, 2018-07-17 at 15:43 +0200, Thomas Lété

Re: System auth empty, how to populate it

2018-07-17 Thread Horia Mocioi
Could you also send the output of "select * from system_auth.roles"? (you will need to change authenticator to AllowAllAuthenticator and authorizer to AllowAllAuthorizer)  On tis, 2018-07-17 at 15:43 +0200, Thomas Lété wrote: > Ok I tried that, nothing better (I already tried dropping the entire >

Re: System auth empty, how to populate it

2018-07-17 Thread Thomas Lété
Ok I tried that, nothing better (I already tried dropping the entire system_auth folder that way, same result) When I open the log, I found nothing about « Password » and when I search for « roles », I only find that : DEBUG [main] 2018-07-17 15:37:39,420 CompactionStrategyManager.java:380 - R

Re: System auth empty, how to populate it

2018-07-17 Thread Simon Fontana Oscarsson
Could you try the following steps? Stop Cassandra. Change authenticator in yaml to PasswordAuthenticator if not already done. Remove data directory with `rm -rf data/system_auth/roles-*` Start Cassandra. Login with `cqlsh -u cassandra -p cassandra` Works for me. -- SIMON FONTANA OSCARSSON Softw

Re: System auth empty, how to populate it

2018-07-17 Thread Thomas Lété
The latest : 3.11.2, the same as yours :( > Le 17 juil. 2018 à 14:36, Horia Mocioi a écrit : > > What Cassandra version do you use? > > On tis, 2018-07-17 at 14:23 +0200, Thomas Lété wrote: >> Hi, >> >> Thanks I tried that, made a node tool repair system_auth and I get a >> new error now : >>

Re: System auth empty, how to populate it

2018-07-17 Thread Horia Mocioi
What Cassandra version do you use? On tis, 2018-07-17 at 14:23 +0200, Thomas Lété wrote: > Hi, > > Thanks I tried that, made a node tool repair system_auth and I get a > new error now : > > Connection error: ('Unable to connect to any servers', {'127.0.0.1': > AuthenticationFailed('Failed to aut

Re: System auth empty, how to populate it

2018-07-17 Thread Thomas Lété
Hi, Thanks I tried that, made a node tool repair system_auth and I get a new error now : Connection error: ('Unable to connect to any servers', {'127.0.0.1': AuthenticationFailed('Failed to authenticate to 127.0.0.1: Error from server: code=0100 [Bad credentials] message="Provided username cas

Re: System auth empty, how to populate it

2018-07-17 Thread Horia Mocioi
Try executing in cqlsh: insert into system_auth.roles (role , can_login , is_superuser , salted_hash ) VALUES ( 'cassandra', True, True, '$2a$10$qQIh9pXDu0JNA7vQd7KRcO7VXryjbTu8XBQTC.tXcTpJHliH6S1aW'); The above hash encrypted value is for the default password cassandra After doing this you shou

Re: System auth empty, how to populate it

2018-07-17 Thread Thomas Lété
Hi Horia, Thanks for your reply :-) As the keyspace was corrupt, Cassandra didn’t boot… So as we were in a hurry and not needed that keyspace, we dropped the files and put AllowAllAuthorizer. Now even the roles table is empty. When I enable PasswordAuthenticator, I’m not able to authenticate, c

Re: System auth empty, how to populate it

2018-07-17 Thread Horia Mocioi
Hello, Those tables are empty by default, except system_auth.roles table which contains one entry(by default): the cassandra user/role. CassandraRoleManager creates it on startup if it does not exist. Those tables will be populated once you start adding new users/roles and use authorization. Wha

System auth empty, how to populate it

2018-07-17 Thread Thomas Lété
Hi everyone, Due to a crash, we lost the system_auth keyspace. It was not important at that time because this was a closed system, not communicating outside the structure so we used AllowAllAuthorizer. Now it is changing and we would like to recover that keyspace (re-create it from scratch). U