You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by engrdean <en...@gmail.com> on 2018/06/06 23:17:29 UTC

Ignite user create/modify trouble

I was very happy to see that the new 2.5 version of Ignite supports
authentication and I have tested this successfully with the default ignite
user.  However, I haven't had much success beyond that.  If I try to change
the password on the default ignite user (ALTER USER ignite WITH PASSWORD
'test';) I get the following error:

[19:09:24,539][SEVERE][client-connector-#95%grid%][JdbcRequestHandler]
Failed to execute SQL query [reqId=0, req=JdbcQueryExecuteRequest
[schemaName=PUBLIC, pageSize=1024, maxRows=0, sqlQry=ALTER USER ignite WITH
PASSWORD 'test', args=[], stmtType=ANY_STATEMENT_TYPE]]
class org.apache.ignite.internal.processors.query.IgniteSQLException:
Operation failed [nodeId=99cb1492-e7b1-4d1e-9cf5-111f21cd86a1,
opId=4901a57d361-acc1d895-072c-4e15-b593-434c52951f7e, err=class
org.apache.ignite.internal.processors.authentication.UserManagementException:
User doesn't exist [userName=IGNITE]]
        at
org.apache.ignite.internal.processors.query.h2.ddl.DdlStatementsProcessor.runDdlStatement(DdlStatementsProcessor.java:247)
        at
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.tryQueryDistributedSqlFieldsNative(IgniteH2Indexing.java:1572)
        at
org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.querySqlFields(IgniteH2Indexing.java:1602)
        at
org.apache.ignite.internal.processors.query.GridQueryProcessor$4.applyx(GridQueryProcessor.java:2035)
        at
org.apache.ignite.internal.processors.query.GridQueryProcessor$4.applyx(GridQueryProcessor.java:2030)
        at
org.apache.ignite.internal.util.lang.IgniteOutClosureX.apply(IgniteOutClosureX.java:36)
        at
org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuery(GridQueryProcessor.java:2578)
        at
org.apache.ignite.internal.processors.query.GridQueryProcessor.querySqlFields(GridQueryProcessor.java:2044)
        at
org.apache.ignite.internal.processors.odbc.jdbc.JdbcRequestHandler.executeQuery(JdbcRequestHandler.java:456)
        at
org.apache.ignite.internal.processors.odbc.jdbc.JdbcRequestHandler.handle(JdbcRequestHandler.java:203)
        at
org.apache.ignite.internal.processors.odbc.ClientListenerNioListener.onMessage(ClientListenerNioListener.java:160)
        at
org.apache.ignite.internal.processors.odbc.ClientListenerNioListener.onMessage(ClientListenerNioListener.java:44)
        at
org.apache.ignite.internal.util.nio.GridNioFilterChain$TailFilter.onMessageReceived(GridNioFilterChain.java:279)
        at
org.apache.ignite.internal.util.nio.GridNioFilterAdapter.proceedMessageReceived(GridNioFilterAdapter.java:109)
        at
org.apache.ignite.internal.util.nio.GridNioAsyncNotifyFilter$3.body(GridNioAsyncNotifyFilter.java:97)
        at
org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110)
        at
org.apache.ignite.internal.util.worker.GridWorkerPool$1.run(GridWorkerPool.java:70)
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
Caused by: class
org.apache.ignite.internal.processors.authentication.UserManagementException:
Operation failed [nodeId=99cb1492-e7b1-4d1e-9cf5-111f21cd86a1,
opId=4901a57d361-acc1d895-072c-4e15-b593-434c52951f7e, err=class
org.apache.ignite.internal.processors.authentication.UserManagementException:
User doesn't exist [userName=IGNITE]]
        at
org.apache.ignite.internal.processors.authentication.IgniteAuthenticationProcessor$UserOperationFinishFuture.onOperationFailOnNode(IgniteAuthenticationProcessor.java:1182)
        at
org.apache.ignite.internal.processors.authentication.IgniteAuthenticationProcessor.onFinishMessage(IgniteAuthenticationProcessor.java:802)
        at
org.apache.ignite.internal.processors.authentication.IgniteAuthenticationProcessor.access$700(IgniteAuthenticationProcessor.java:84)
        at
org.apache.ignite.internal.processors.authentication.IgniteAuthenticationProcessor$2.onMessage(IgniteAuthenticationProcessor.java:207)
        at
org.apache.ignite.internal.managers.communication.GridIoManager.invokeListener(GridIoManager.java:1556)
        at
org.apache.ignite.internal.managers.communication.GridIoManager.processRegularMessage0(GridIoManager.java:1184)
        at
org.apache.ignite.internal.managers.communication.GridIoManager.send(GridIoManager.java:1632)
        at
org.apache.ignite.internal.managers.communication.GridIoManager.sendToGridTopic(GridIoManager.java:1715)
        at
org.apache.ignite.internal.processors.authentication.IgniteAuthenticationProcessor.sendFinish(IgniteAuthenticationProcessor.java:959)
        at
org.apache.ignite.internal.processors.authentication.IgniteAuthenticationProcessor.access$3900(IgniteAuthenticationProcessor.java:84)
        at
org.apache.ignite.internal.processors.authentication.IgniteAuthenticationProcessor$UserOperationWorker.body(IgniteAuthenticationProcessor.java:1301)
        at
org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110)
        ... 3 more


If I create another user (CREATE USER test WITH PASSWORD 'test';) then it is
successful, but when I try to connect with that user it then tells me that
it does not exist.

java.sql.SQLException: Handshake failed
[driverProtocolVer=ClientListenerProtocolVersion [major=2, minor=5,
maintenance=0], remoteNodeProtocolVer=null, err=Handshake error: The user
name or password is incorrect [userName=test]]

I am able to alter the test users password and drop the user, just not login
with it.

This is all being done on a fresh, activated Ignite 2.5.0 cluster before any
caches have been created or any other work has been done.  I'm connecting
with DBeaver using the JDBC thin client and using that to execute the
commands.  I'm hoping that I'm missing something obvious so please let me
know if that is the case.




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Ignite user create/modify trouble

Posted by Denis Magda <dm...@gridgain.com>.
Vladimir, Taras,

Please help to understand how to improve existing docs. Do you have any
plans on addressing the documented and discussed limitations in regards the
case sensitivity?

--
Denis

On Fri, Jun 8, 2018 at 9:48 AM, aealexsandrov <ae...@gmail.com>
wrote:

> https://issues.apache.org/jira/browse/IGNITE-8756
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>

Re: Ignite user create/modify trouble

Posted by aealexsandrov <ae...@gmail.com>.
https://issues.apache.org/jira/browse/IGNITE-8756



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Ignite user create/modify trouble

Posted by aealexsandrov <ae...@gmail.com>.
Hi,

Documentation should be updated as for me to describe how it designed in
SQL. I will file the issue.

When you use SQL and require to create the user like TesT then just use
quotes. Without quotes, you will create TEST.

In case if you are going to change the password for TesT user via SQL then
use quotes in ALTER command. Without quotes, this command will try to find
TEST.

When you using JDBC then username will not be case sensitive.

BR,
Andrei



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Ignite user create/modify trouble

Posted by engrdean <en...@gmail.com>.
Thanks Andrei, adding quotes and realizing that case matters made all of the
difference.

I did read the documentation around this but my impression was that a
connection via JDBC should be case insensitive and that does not appear to
be the case.  From the documentation:

/For instance, if test was set as a username then:

You can use Test, TEst, TEST and other combinations from JDBC and ODBC.
You have to use TEST as the username from Ignite's native SQL APIs designed
for Java, .NET and other programming languages./

I took that to mean that since I am connecting via JDBC that the username is
case insensitive.  Am I just misunderstanding?



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Ignite user create/modify trouble

Posted by aealexsandrov <ae...@gmail.com>.
Hi,

When you create the user in quotes ("test") using SQL as next:

CREATE USER "test" WITH PASSWORD 'test'

It will be created as it was set (in this case it will be test)

If you create the user without quotes (test) using SQL as next:

CREATE USER test WITH PASSWORD 'test'

then username will be stored in uppercase (TEST).

The same situation with other DDL commands. So if you are going to change
the password of the default user you should do next:

ALTER USER "ignite" WITH PASSWORD 
'test';

When you set the username in JDBC then there is no case transformation?
Could you please re-test your cases using quotes as well?

BR,
Andrei



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/