You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/08/19 14:50:00 UTC

[GitHub] [shardingsphere] sandynz opened a new issue #6943: PostgreSQL current login user's password changed by DCL integration test

sandynz opened a new issue #6943:
URL: https://github.com/apache/shardingsphere/issues/6943


   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   master branch, 5.0.0-RC1-SNAPSHOT
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-JDBC
   
   ### Expected behavior
   Keep original password unchanged.
   
   ### Actual behavior
   DCL integration test hang up.
   
   From PostgreSQL log `postgresql-2020-08-18_071719`:
   ```
   2020-08-18 22:20:00.431 HKT [17060] STATEMENT:  DROP USER user_dev
   2020-08-18 22:20:00.432 HKT [17060] ERROR:  role "user_dev_new" does not exist
   2020-08-18 22:20:00.432 HKT [17060] STATEMENT:  DROP USER user_dev_new
   2020-08-18 22:20:00.670 HKT [1216] FATAL:  password authentication failed for user "postgres"
   2020-08-18 22:20:00.670 HKT [1216] DETAIL:  Password does not match for user "postgres".
   	Connection matched pg_hba.conf line 80: "host    all             all             127.0.0.1/32            md5"
   ...
   2020-08-18 23:00:34.293 HKT [3340] DETAIL:  Password does not match for user "postgres".
   	Connection matched pg_hba.conf line 80: "host    all             all             127.0.0.1/32            md5"
   2020-08-18 23:01:05.986 HKT [2032] FATAL:  password authentication failed for user "root"
   2020-08-18 23:01:05.986 HKT [2032] DETAIL:  Role "root" does not exist.
   	Connection matched pg_hba.conf line 82: "host    all             all             ::1/128                 md5"
   ```
   
   ### Reason analyze (If you can)
   ALTER PASSWORD statement executed.
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   1, env.properties:
   rule.types=db
   databases=PostgreSQL
   postgresql.host=127.0.0.1
   postgresql.password=test
   
   2, go to shardingsphere-test-suite module
   
   3, mvn clean install
   
   ### Example codes for reproduce this issue (such as a github link).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero commented on issue #6943: PostgreSQL current login user's password changed by DCL integration test

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #6943:
URL: https://github.com/apache/shardingsphere/issues/6943#issuecomment-676927165


   @sandynz Hi thanks for your issue and PR. Just to confirm, you can not install the ShardingSphere project due to the configuration for PostgreSQL?
   But Sorry, I can not get the point from your PR. How could an added` SQL case` solve your issue?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] tuohai666 commented on issue #6943: PostgreSQL current login user's password changed by DCL integration test

Posted by GitBox <gi...@apache.org>.
tuohai666 commented on issue #6943:
URL: https://github.com/apache/shardingsphere/issues/6943#issuecomment-678055187


   > Hi @tristaZero , I copied a wrong case in previous comment, there is <dcl-test-case sql="ALTER USER user_dev WITH ENCRYPTED PASSWORD 'password'" db-types="PostgreSQL"/> in dcl-integrate-test-cases.xml.
   
   It make sense to remove the **CURRENT_USER** case.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero commented on issue #6943: PostgreSQL current login user's password changed by DCL integration test

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #6943:
URL: https://github.com/apache/shardingsphere/issues/6943#issuecomment-677519280


   @sandynz Hi thanks for your clarification!
   Got it.  I think `MySQL` TESTS have the same issue as well. My suggestions are,
   First, could you look at how `MySQL` tests deal with this issue in the same `test-case` file?
   Second, do you think it is better to test the relevant SQL case with another new `user` or `role`?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] sandynz commented on issue #6943: PostgreSQL current login user's password changed by DCL integration test

Posted by GitBox <gi...@apache.org>.
sandynz commented on issue #6943:
URL: https://github.com/apache/shardingsphere/issues/6943#issuecomment-676483284


   Since PosgreSQL account `postgres`'s password may be different on different environments, once password is changed, it can't be recovered by integration test itself.
   
   Possible solution:
   - Keep current login user (admin account used by jdbc) 's password unchanged.
   - ALTER PASSWORD could be tested on test account created by integration test itself.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] sandynz commented on issue #6943: PostgreSQL current login user's password changed by DCL integration test

Posted by GitBox <gi...@apache.org>.
sandynz commented on issue #6943:
URL: https://github.com/apache/shardingsphere/issues/6943#issuecomment-678034092


   > 
   > 
   > @sandynz Yep, that is precisely expected. Look forward to the relevant modification for your PR. :-)
   > 
   > Best,
   > Trista
   > 
   > > It's better to test with new user. user_dev in  is a new user defined in authority.xml: CREATE USER user_dev PASSWORD 'passwd_dev'
   
   Hi @tristaZero , I copied a wrong case in previous comment, there is `<dcl-test-case sql="ALTER USER user_dev WITH ENCRYPTED PASSWORD 'password'" db-types="PostgreSQL"/>` in `dcl-integrate-test-cases.xml`.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] sandynz commented on issue #6943: PostgreSQL current login user's password changed by DCL integration test

Posted by GitBox <gi...@apache.org>.
sandynz commented on issue #6943:
URL: https://github.com/apache/shardingsphere/issues/6943#issuecomment-677197429


   > 
   > 
   > @sandynz Hi thanks for your issue and PR. Just to confirm, you can not install the ShardingSphere project due to the configuration for PostgreSQL?
   > But Sorry, I can not get the point from your PR. How could an added` SQL case` solve your issue?
   
   Hi @tristaZero , I was running DCL integration test these days, it blocked by this issue, since `postgresql.password` was changed by test case, then the later jdbc connection could not be created, and integration test broken.
   
   Related env.properties configurations:
   ```
   postgresql.host=127.0.0.1
   postgresql.port=5432
   postgresql.username=postgres
   postgresql.password=test
   ```
   
   This test case is: `<dcl-test-case sql="ALTER USER CURRENT_USER WITH ENCRYPTED PASSWORD 'password'" db-types="PostgreSQL"/>`.
   
   I think it could be removed, this situation could be tested by: `<dcl-test-case sql="ALTER USER user_dev WITH ENCRYPTED PASSWORD 'password'" db-types="PostgreSQL"/>`.
   
   `ALTER PASSWORD` could be verified with psql on command line:
   - run `psql -U postgres`, enter original password, e.g. `test`
   - run `ALTER USER CURRENT_USER WITH ENCRYPTED PASSWORD 'password'`
   - run `\q`
   - run `psql -U postgres`, password should be `password` now
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] tuohai666 closed issue #6943: PostgreSQL current login user's password changed by DCL integration test

Posted by GitBox <gi...@apache.org>.
tuohai666 closed issue #6943:
URL: https://github.com/apache/shardingsphere/issues/6943


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero removed a comment on issue #6943: PostgreSQL current login user's password changed by DCL integration test

Posted by GitBox <gi...@apache.org>.
tristaZero removed a comment on issue #6943:
URL: https://github.com/apache/shardingsphere/issues/6943#issuecomment-677519280


   @sandynz Hi thanks for your clarification!
   Got it.  I think `MySQL` TESTS have the same issue as well. My suggestions are,
   First, could you look at how `MySQL` tests deal with this issue in the same `test-case` file?
   Second, do you think it is better to test the relevant SQL case with another new `user` or `role`?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero commented on issue #6943: PostgreSQL current login user's password changed by DCL integration test

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #6943:
URL: https://github.com/apache/shardingsphere/issues/6943#issuecomment-678015921


   @sandynz Yep, that is precisely expected. Look forward to the relevant modification for your PR. :-)
   
   Best,
   Trista 
   
   > It's better to test with new user. user_dev in <dcl-test-case sql="ALTER USER user_dev WITH ENCRYPTED PASSWORD 'password'" db-types="PostgreSQL"/> is a new user defined in authority.xml: <sql>CREATE USER user_dev PASSWORD 'passwd_dev'</sql>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] sandynz commented on issue #6943: PostgreSQL current login user's password changed by DCL integration test

Posted by GitBox <gi...@apache.org>.
sandynz commented on issue #6943:
URL: https://github.com/apache/shardingsphere/issues/6943#issuecomment-677610819


   > 
   > 
   > @sandynz Hi thanks for your clarification!
   > Got it. I think `MySQL` TESTS have the same issue as well. My suggestions are,
   > First, could you look at how `MySQL` tests deal with this issue in the same `test-case` file?
   > Second, do you think it is better to test the relevant SQL case with another new `user` or `role`?
   
   Hi @tristaZero , I've had a look at `dcl-integrate-test-cases.xml` and `authority.xml`.
   - MySQL has no alter current login user's password test case
   - It's better to test with new user. `user_dev` in `<dcl-test-case sql="ALTER USER user_dev WITH ENCRYPTED PASSWORD 'password'" db-types="PostgreSQL"/>` is a new user defined in `authority.xml`: `<sql>CREATE USER user_dev PASSWORD 'passwd_dev'</sql>`
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org