You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "goto456 (via GitHub)" <gi...@apache.org> on 2023/05/05 06:48:15 UTC

[GitHub] [dubbo] goto456 opened a new issue, #12233: Dubbo 3.2 中 redis是cluster模式时,不支持password

goto456 opened a new issue, #12233:
URL: https://github.com/apache/dubbo/issues/12233

   <!-- If you need to report a security issue please visit https://github.com/apache/dubbo/security/policy -->
   
   
   ### Environment
   
   * Dubbo version: 3.2.0 或 3.0.18
   * Java version: 1.8
   
   RedisMetadataReport类中当redis是cluster模式时,password并没有起作用,源码中password未初始化,为null,导致报了如下错误:
   
   ```
   Caused by: redis.clients.jedis.exceptions.JedisDataException: NOAUTH Authentication required.
   	at redis.clients.jedis.Protocol.processError(Protocol.java:127)
   	at redis.clients.jedis.Protocol.process(Protocol.java:161)
   	at redis.clients.jedis.Protocol.read(Protocol.java:215)
   	at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:340)
   	at redis.clients.jedis.Connection.getRawObjectMultiBulkReply(Connection.java:285)
   	at redis.clients.jedis.Connection.getObjectMultiBulkReply(Connection.java:291)
   	at redis.clients.jedis.Jedis.clusterSlots(Jedis.java:3376)
   	at redis.clients.jedis.JedisClusterInfoCache.discoverClusterNodesAndSlots(JedisClusterInfoCache.java:54)
   	at redis.clients.jedis.JedisClusterConnectionHandler.initializeSlotsCache(JedisClusterConnectionHandler.java:39)
   	at redis.clients.jedis.JedisClusterConnectionHandler.<init>(JedisClusterConnectionHandler.java:17)
   	at redis.clients.jedis.JedisSlotBasedConnectionHandler.<init>(JedisSlotBasedConnectionHandler.java:24)
   	at redis.clients.jedis.BinaryJedisCluster.<init>(BinaryJedisCluster.java:54)
   	at redis.clients.jedis.JedisCluster.<init>(JedisCluster.java:93)
   	at org.apache.dubbo.metadata.store.redis.RedisMetadataReport.storeMetadataInCluster(RedisMetadataReport.java:133)
   ```
   
   RedisMetadataReport中相关代码:
   ```
   public RedisMetadataReport(URL url) {
           super(url);
           timeout = url.getParameter(TIMEOUT_KEY, DEFAULT_TIMEOUT);
           if (url.getParameter(CLUSTER_KEY, false)) {
               jedisClusterNodes = new HashSet<>();
               List<URL> urls = url.getBackupUrls();
               for (URL tmpUrl : urls) {
                   jedisClusterNodes.add(new HostAndPort(tmpUrl.getHost(), tmpUrl.getPort()));
               }
           } else {
               int database = url.getParameter(REDIS_DATABASE_KEY, 0);
               pool = new JedisPool(new JedisPoolConfig(), url.getHost(), url.getPort(), timeout, url.getPassword(), database);
           }
       }
   
   // 此处passowrd为空,并未从url中获取并进行初始化
   private void storeMetadataInCluster(BaseMetadataIdentifier metadataIdentifier, String v) {
           try (JedisCluster jedisCluster = new JedisCluster(jedisClusterNodes, timeout, timeout, 2, password, new GenericObjectPoolConfig())) {
               jedisCluster.set(metadataIdentifier.getIdentifierKey() + META_DATA_STORE_TAG, v);
           } catch (Throwable e) {
               String msg = "Failed to put " + metadataIdentifier + " to redis cluster " + v + ", cause: " + e.getMessage();
               logger.error(TRANSPORT_FAILED_RESPONSE, "", "", msg, e);
               throw new RpcException(msg, e);
           }
       }
   ```


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on issue #12233: Dubbo 3.2 中 redis是cluster模式时,不支持password

Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ commented on issue #12233:
URL: https://github.com/apache/dubbo/issues/12233#issuecomment-1537567541

   Fixed in https://github.com/apache/dubbo/pull/12240


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on issue #12233: Dubbo 3.2 中 redis是cluster模式时,不支持password

Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ commented on issue #12233:
URL: https://github.com/apache/dubbo/issues/12233#issuecomment-1536252062

   Would you please help to fix it?


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] goto456 commented on issue #12233: Dubbo 3.2 中 redis是cluster模式时,不支持password

Posted by "goto456 (via GitHub)" <gi...@apache.org>.
goto456 commented on issue #12233:
URL: https://github.com/apache/dubbo/issues/12233#issuecomment-1537080367

   > Would you please help to fix it?
   
   OK,let me fix it.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ closed issue #12233: Dubbo 3.2 中 redis是cluster模式时,不支持password

Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ closed issue #12233: Dubbo 3.2 中 redis是cluster模式时,不支持password
URL: https://github.com/apache/dubbo/issues/12233


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org