Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-7740

Redis NOAUTH Authentication Error when DB index is specified

XMLWordPrintable

    • False
    • None
    • False

      In order to make your issue reports as actionable as possible, please provide the following information, depending on the issue type.

      Bug report

      For bug reports, provide this information, please:

      What Debezium connector do you use and what version?

      sqlserver - 2.6.0

      What is the connector configuration?

       

      debezium.sink.type=redis 
      debezium.sink.redis.address=XXXXXX 
      debezium.sink.redis.password=XXXXX 
      debezium.sink.redis.ssl.enabled=false 
      debezium.sink.redis.db.index=1 
      debezium.source.connector.class=io.debezium.connector.sqlserver.SqlServerConnector 
      debezium.source.offset.storage.file.filename=data/offsets.dat 
      debezium.source.offset.flush.interval.ms=0 
      debezium.source.database.hostname=XXXXXX 
      debezium.source.database.user=XXX 
      debezium.source.database.password=XXXXXXX 
      debezium.source.database.names=XXXX 
      debezium.source.database.encrypt=false 
      debezium.source.schema.whitelist=dbo 
      debezium.source.table.include.list=(tables) 
      debezium.source.column.include.list=(columns) 
      debezium.source.heartbeat.interval.ms=1000 
      debezium.source.topic.prefix=XXXXX 
      debezium.source.value.converter.schemas.enable=false 
      debezium.source.schema.history.internal=io.debezium.storage.file.history.FileSchemaHistory debezium.source.schema.history.internal.file.filename=data/history.dat

      What behaviour do you expect?

      I expect debezium to write SQL server changes to redis and want to specify a custom DB index.

      What behaviour do you see?

      If I specify any index other than 0 in the debezium.sink.redis.db.index configuration, the debezium fails to start with the error messages below:

      "redis.clients.jedis.exceptions.JedisDataException","message":"NOAUTH Authentication required."

       

      Do you see the same behaviour using the latest relesead Debezium version?

      Yes

      Do you have the connector logs, ideally from start till finish?

      (You might be asked later to provide DEBUG/TRACE level log)

       

      {"timestamp":"2024-04-02T12:10:11.37+03:00","sequence":72,"loggerClassName":"org.jboss.logging.Logger","loggerName":"io.quarkus.runtime.Application","level":"ERROR","message":"Failed to start application (with profile [prod])","threadName":"main","threadId":1,"mdc":{},"ndc":"","hostName":"redis-bnbn-test-vm","processName":"io.debezium.server.Main","processId":1097577,"exception":{"refId":1,"exceptionType":"java.lang.RuntimeException","message":"Failed to start quarkus","frames":[{"class&lt;span class="code-quote">":"io.quarkus.runner.ApplicationImpl","method":"doStart"},{"class&lt;span class="code-quote">":"io.quarkus.runtime.Application","method":"start","line":101},{"class&lt;span class="code-quote">":"io.quarkus.runtime.ApplicationLifecycleManager","method":"run","line":111},{"class&lt;span class="code-quote">":"io.quarkus.runtime.Quarkus","method":"run","line":71},{"class&lt;span class="code-quote">":"io.quarkus.runtime.Quarkus","method":"run","line":44},{"class&lt;span class="code-quote">":"io.quarkus.runtime.Quarkus","method":"run","line":124},{"class&lt;span class="code-quote">":"io.debezium.server.Main","method":"main","line":15}],"causedBy":{"exception":{"refId":2,"exceptionType":"redis.clients.jedis.exceptions.JedisDataException","message":"NOAUTH Authentication required.","frames":[{"class&lt;span class="code-quote">":"redis.clients.jedis.Protocol","method":"processError","line":96},{"class&lt;span class="code-quote">":"redis.clients.jedis.Protocol","method":"process","line":137},{"class&lt;span class="code-quote">":"redis.clients.jedis.Protocol","method":"read","line":192},{"class&lt;span class="code-quote">":"redis.clients.jedis.Connection","method":"readProtocolWithCheckingBroken","line":316},{"class&lt;span class="code-quote">":"redis.clients.jedis.Connection","method":"getStatusCodeReply","line":243},{"class&lt;span class="code-quote">":"redis.clients.jedis.Connection","method":"select","line":382},{"class&lt;span class="code-quote">":"redis.clients.jedis.Connection","method":"initializeFromClientConfig","line":350},{"class&lt;span class="code-quote">":"redis.clients.jedis.Connection","method":"<init>","line":46},{"class&lt;span class="code-quote">":"redis.clients.jedis.Jedis","method":"<init>","line":73},{"class&lt;span class="code-quote">":"io.debezium.storage.redis.RedisConnection","method":"getRedisClient","line":82},{"class&lt;span class="code-quote">":"io.debezium.server.redis.RedisStreamChangeConsumer","method":"connect","line":101},{"class&lt;span class="code-quote">":"io.debezium.server.redis.RedisStreamChangeConsumer_Bean","method":"doCreate"},{"class&lt;span class="code-quote">":"io.debezium.server.redis.RedisStreamChangeConsumer_Bean","method":"create"},{"class&lt;span class="code-quote">":"io.debezium.server.redis.RedisStreamChangeConsumer_Bean","method":"create"},{"class&lt;span class="code-quote">":"io.debezium.server.DebeziumServer","method":"start","line":129},{"class&lt;span class="code-quote">":"io.debezium.server.DebeziumServer_Bean","method":"doCreate"},{"class&lt;span class="code-quote">":"io.debezium.server.DebeziumServer_Bean","method":"create"},{"class&lt;span class="code-quote">":"io.debezium.server.DebeziumServer_Bean","method":"create"},{"class&lt;span class="code-quote">":"io.quarkus.arc.impl.AbstractSharedContext","method":"createInstanceHandle","line":113},{"class&lt;span class="code-quote">":"io.quarkus.arc.impl.AbstractSharedContext$1","method":"get","line":37},{"class&lt;span class="code-quote">":"io.quarkus.arc.impl.AbstractSharedContext$1","method":"get","line":34},{"class&lt;span class="code-quote">":"io.quarkus.arc.impl.LazyValue","method":"get","line":26},{"class&lt;span class="code-quote">":"io.quarkus.arc.impl.ComputingCache","method":"computeIfAbsent","line":69},{"class&lt;span class="code-quote">":"io.quarkus.arc.impl.AbstractSharedContext","method":"get","line":34},{"class&lt;span class="code-quote">":"io.quarkus.arc.impl.ClientProxies","method":"getApplicationScopedDelegate","line":21},{"class&lt;span class="code-quote">":"io.debezium.server.DebeziumServer_ClientProxy","method":"arc$delegate"},{"class&lt;span class="code-quote">":"io.debezium.server.DebeziumServer_ClientProxy","method":"arc_contextualInstance"},{"class&lt;span class="code-quote">":"io.debezium.server.DebeziumServer_Observer_Synthetic_f28a48f6bdce4326db44aec92fdb5c84d535b5d9","method":"notify"},{"class&lt;span class="code-quote">":"io.quarkus.arc.impl.EventImpl$Notifier","method":"notifyObservers","line":346},{"class&lt;span class="code-quote">":"io.quarkus.arc.impl.EventImpl$Notifier","method":"notify","line":328},{"class&lt;span class="code-quote">":"io.quarkus.arc.impl.EventImpl","method":"fire","line":82},{"class&lt;span class="code-quote">":"io.quarkus.arc.runtime.ArcRecorder","method":"fireLifecycleEvent","line":155},{"class&lt;span class="code-quote">":"io.quarkus.arc.runtime.ArcRecorder","method":"handleLifecycleEvents","line":106},{"class&lt;span class="code-quote">":"io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent1144526294","method":"deploy_0"},{"class&lt;span class="code-quote">":"io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent1144526294","method":"deploy"},{"class&lt;span class="code-quote">":"io.quarkus.runner.ApplicationImpl","method":"doStart"},{"class&lt;span class="code-quote">":"io.quarkus.runtime.Application","method":"start","line":101},{"class&lt;span class="code-quote">":"io.quarkus.runtime.ApplicationLifecycleManager","method":"run","line":111},{"class&lt;span class="code-quote">":"io.quarkus.runtime.Quarkus","method":"run","line":71},{"class&lt;span class="code-quote">":"io.quarkus.runtime.Quarkus","method":"run","line":44},{"class&lt;span class="code-quote">":"io.quarkus.runtime.Quarkus","method":"run","line":124},{"class&lt;span class="code-quote">":"io.debezium.server.Main","method":"main","line":15}]}}}} 

       

       

      Implementation ideas (optional)

      This issue seems to be caused by Jedis client trying to send a SELECT command to redis for the specified DB BEFORE authenticating. In the getRedisClient method of the RedisConnection.java class, a new Jedis instance is being created. Redis username and password are not passed to the constructor via DefaultJedisClientConfig.

      Jedis constructor then calls initializeFromClientConfig which checks the credentials and tries to authenticate but since no credentials are provided, it continues executing and then it checks the dbIndex, if it's larger than 0 it sends SELECT command to redis hence throws the exception.

      One solution would be passing the redis username and password in the configuration object while creating the Jedis client instance.

              Unassigned Unassigned
              selmangenc Selman Genç (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: