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

Debezium throws exception even when SQL user has read access

XMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • False
    • Critical

      Bug report

      Debezium Server is throwing errors when there is no CDC table enabled yet which causes the container to be in error state and keep restarting. The error goes away once any CDC table is enabled. This is causing false errors when we first deploy the container.

      { "timestamp": "2024-02-06T11:21:09.949Z", "sequence": 107, "loggerClassName": "org.slf4j.impl.Slf4jLogger", "loggerName": "io.debezium.server.ConnectorLifecycle", "level": "ERROR", "message": "Connector completed: success = 'false', message = 'Connector configuration is not valid. User debeziumUser does not have access to CDC schema in the following databases: testDB. This user can only be used in initial_only snapshot mode', error = 'null'", "threadName": "pool-7-thread-1", "threadId": 25, "mdc": {}, "ndc": "", "hostName": "sandboxhost-638428126072881500", "processName": "io.debezium.server.Main", "processId": 1571 }

      What Debezium connector do you use and what version?

      Debezium Server v2.6

      What is the connector configuration?

      SQL

      What is the captured database version and mode of deployment?

      Azure cloud

      What behavior do you expect?

      No errors are thrown when CDC is enabled on database but not on tables

      What behavior do you see?

      Debezium is thrown an exception because it wrongly tries to read from CDC tables instead of checking if user has access on CDC database.

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

      Yes

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

      { "timestamp": "2024-02-06T11:21:09.949Z", "sequence": 107, "loggerClassName": "org.slf4j.impl.Slf4jLogger", "loggerName": "io.debezium.server.ConnectorLifecycle", "level": "ERROR", "message": "Connector completed: success = 'false', message = 'Connector configuration is not valid. User debeziumUser does not have access to CDC schema in the following databases: testDB. This user can only be used in initial_only snapshot mode', error = 'null'", "threadName": "pool-7-thread-1", "threadId": 25, "mdc": {}, "ndc": "", "hostName": "sandboxhost-638428126072881500", "processName": "io.debezium.server.Main", "processId": 1571 }

      How to reproduce the issue using our tutorial deployment?

      • Create SQL user and grant db_datareader role for the selected database 
      • Enable CDC on database.
      • Debezium Server will throw error that user has no read access

      Implementation ideas (optional)

       

      {{}}

      select name, is_tracked_by_cdc from sys.tables;

      {{}}

      If we execute this query and returns only 1 record then the sql user does not have sufficient access. But if it returns more then the sql user has read access.

      So we can keep the current check, if it fails then execute the above query as a fallback check.

              Unassigned Unassigned
              sayed.reda.thesis Sayed Reda (Inactive)
              Jiri Pechanec
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: