You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cassandra.apache.org by shirish <sh...@gmail.com> on 2010/03/10 14:54:31 UTC

Login Failure

hello,

I have just download the source code from the trunk using svn, I have set up
the following configuration

Created a different user and group named cassandra
When i do *cassandra -f* the following is the output I get

 INFO 18:02:16,697 Auto DiskAccessMode determined to be standard
 INFO 18:02:16,995 Saved Token not found. Using
481224115341523783443682481258
6788175
 INFO 18:02:17,008 Creating new commitlog segment
/u02/cassandra/commitlog/CommitLog-1268224337008.log
 INFO 18:02:17,105 Starting up server gossip
 INFO 18:02:17,163 Binding thrift service to localhost/127.0.0.1:9160
 INFO 18:02:17,169 Cassandra starting up...

and next i ran* cassandra-cli --host 127.0.0.1 --port 9160* I get the
following

Login failure. Did you specify 'keyspace', 'username' and 'password'?
Welcome to cassandra CLI.

Type 'help' or '?' for help. Type 'quit' or 'exit' to quit.


What could have gone wrong ?

Re: Login Failure

Posted by Morten Wegelbye Nissen <mw...@monit.dk>.
>>  
> After the latest patch in the auth I saw the same. I needed to supply 
> the --keyspace, --username and --password. (funny thing is that with 
> the "allow all" authentication its still mandatory.
>
> # cassandra-cli --host localhost --port 9160 --keyspace Keyspace1  
> --username mickey --password mouse
> Starting Cassandra Client
> Connected to: "Morten's MEGA Cluster" on localhost/9160
> Welcome to cassandra CLI.
>
> Type 'help' or '?' for help. Type 'quit' or 'exit' to quit.
> cassandra>
>
> Works fine (user mickey is not defined anywhere).
>
> Question is, is this a bug or a feature?
> If bug, I can go for the patch, if feature the wiki should be updated.
>
> ./Morten
Above behaviour is introduced in the 915858 commit / thrunk on 
CliMain.java. (TException is thrown from some of the gen-source in 
o.a.c.t.Cassandra.

Question is; what would correct behaviour be? Could one imagine that 
someone, except developers, will run a system without audit at all?

./Morten

Re: Login Failure

Posted by Eric Evans <ee...@rackspace.com>.
On Wed, 2010-03-10 at 16:31 +0100, Morten Wegelbye Nissen wrote:
> After the latest patch in the auth I saw the same. I needed to supply 
> the --keyspace, --username and --password. (funny thing is that with
> the "allow all" authentication its still mandatory.

Gah, you're right.

> # cassandra-cli --host localhost --port 9160 --keyspace Keyspace1  
> --username mickey --password mouse
> Starting Cassandra Client
> Connected to: "Morten's MEGA Cluster" on localhost/9160
> Welcome to cassandra CLI.
> 
> Type 'help' or '?' for help. Type 'quit' or 'exit' to quit.
> cassandra>
> 
> Works fine (user mickey is not defined anywhere).
> 
> Question is, is this a bug or a feature? If bug, I can go for the
> patch, if feature the wiki should be updated. 

Well, it's a bug introduced while introducing support for a half-baked
feature.

CASSANDRA-852 added support for the Thrift login() method which is
present and usable in 0.6, but optional, (though obviously it
implemented that in a way that made it non-optional).

For 0.7, login() will become mandatory, even if you've effectively
disabled authentication (it will be used to set a current working
keyspace, and the keyspace argument will be dropped from the other
methods).

So, it's buggy for 0.6, and trunk, and the direction trunk is going in,
but to different degrees and for different reasons :)

I've reopened CASSANDRA-852 and attached a patch for 0.6 that makes the
invocation of login() conditional on the all three of the new arguments
(keyspace, username, and password).

https://issues.apache.org/jira/browse/CASSANDRA-852

-- 
Eric Evans
eevans@rackspace.com


Re: Login Failure

Posted by Morten Wegelbye Nissen <mw...@monit.dk>.
Eric Evans wrote:
> On Wed, 2010-03-10 at 19:24 +0530, shirish wrote:
>   
>> and next i ran* cassandra-cli --host 127.0.0.1 --port 9160* I get the
>> following
>>
>> Login failure. Did you specify 'keyspace', 'username' and 'password'?
>> Welcome to cassandra CLI.
>>
>> Type 'help' or '?' for help. Type 'quit' or 'exit' to quit.
>>
>>
>> What could have gone wrong ? 
>>     
>
>   
After the latest patch in the auth I saw the same. I needed to supply 
the --keyspace, --username and --password. (funny thing is that with the 
"allow all" authentication its still mandatory.

# cassandra-cli --host localhost --port 9160 --keyspace Keyspace1  
--username mickey --password mouse
Starting Cassandra Client
Connected to: "Morten's MEGA Cluster" on localhost/9160
Welcome to cassandra CLI.

Type 'help' or '?' for help. Type 'quit' or 'exit' to quit.
cassandra>

Works fine (user mickey is not defined anywhere).

Question is, is this a bug or a feature?
If bug, I can go for the patch, if feature the wiki should be updated.

./Morten

Re: Login Failure

Posted by Eric Evans <ee...@rackspace.com>.
On Wed, 2010-03-10 at 19:24 +0530, shirish wrote:
> and next i ran* cassandra-cli --host 127.0.0.1 --port 9160* I get the
> following
> 
> Login failure. Did you specify 'keyspace', 'username' and 'password'?
> Welcome to cassandra CLI.
> 
> Type 'help' or '?' for help. Type 'quit' or 'exit' to quit.
> 
> 
> What could have gone wrong ? 

Were there any exceptions produced by the node (i.e. in the terminal
where you started cassandra in the foreground)?

Try adding the --debug argument when starting cassandra-cli, that should
cause it to print a stacktrace when the error occurs.

-- 
Eric Evans
eevans@rackspace.com