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

GRANT/REVOKE for roles is not working

XMLWordPrintable

      Got Error "no viable alternative at input 'grant reader'"

      Full Trace:

       

      org.apache.kafka.connect.errors.ConnectException: no viable alternative at input 'grant reader'
      at io.debezium.connector.mysql.AbstractReader.wrap(AbstractReader.java:230)
      at io.debezium.connector.mysql.AbstractReader.failed(AbstractReader.java:207)
      at io.debezium.connector.mysql.BinlogReader.handleEvent(BinlogReader.java:604)
      at com.github.shyiko.mysql.binlog.BinaryLogClient.notifyEventListeners(BinaryLogClient.java:1100)
      at com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:951)
      at com.github.shyiko.mysql.binlog.BinaryLogClient.connect(BinaryLogClient.java:594)
      at com.github.shyiko.mysql.binlog.BinaryLogClient$7.run(BinaryLogClient.java:838)
      at java.base/java.lang.Thread.run(Thread.java:829)
      Caused by: io.debezium.text.ParsingException: no viable alternative at input 'grant reader'
      at io.debezium.antlr.ParsingErrorListener.syntaxError(ParsingErrorListener.java:40)
      at org.antlr.v4.runtime.ProxyErrorListener.syntaxError(ProxyErrorListener.java:41)
      at org.antlr.v4.runtime.Parser.notifyErrorListeners(Parser.java:544)
      at org.antlr.v4.runtime.DefaultErrorStrategy.reportNoViableAlternative(DefaultErrorStrategy.java:310)
      at org.antlr.v4.runtime.DefaultErrorStrategy.reportError(DefaultErrorStrategy.java:136)
      at io.debezium.ddl.parser.mysql.generated.MySqlParser.sqlStatements(MySqlParser.java:1156)
      at io.debezium.ddl.parser.mysql.generated.MySqlParser.root(MySqlParser.java:884)
      at io.debezium.connector.mysql.antlr.MySqlAntlrDdlParser.parseTree(MySqlAntlrDdlParser.java:68)
      at io.debezium.connector.mysql.antlr.MySqlAntlrDdlParser.parseTree(MySqlAntlrDdlParser.java:41)
      at io.debezium.antlr.AntlrDdlParser.parse(AntlrDdlParser.java:80)
      at io.debezium.connector.mysql.MySqlSchema.applyDdl(MySqlSchema.java:326)
      at io.debezium.connector.mysql.BinlogReader.handleQueryEvent(BinlogReader.java:807)
      at io.debezium.connector.mysql.BinlogReader.handleEvent(BinlogReader.java:587)
      ... 5 more
      Caused by: org.antlr.v4.runtime.NoViableAltException
      at org.antlr.v4.runtime.atn.ParserATNSimulator.noViableAlt(ParserATNSimulator.java:2026)
      at org.antlr.v4.runtime.atn.ParserATNSimulator.execATN(ParserATNSimulator.java:467)
      at org.antlr.v4.runtime.atn.ParserATNSimulator.adaptivePredict(ParserATNSimulator.java:393)
      at io.debezium.ddl.parser.mysql.generated.MySqlParser.sqlStatements(MySqlParser.java:958)
      ... 12 more
      

      Connector's config

      {
        "name": "db1",
        "config": {
          "connector.class": "io.debezium.connector.mysql.MySqlConnector",
          "database.hostname": "%DATABASE_HOSTNAME%",
          "database.port": "%DATABASE_PORT%",
          "database.user": "%DATABASE_USER%",
          "database.password": "%DATABASE_PASSWORD%",
          "database.server.id": "13001071",
          "snapshot.mode": "initial",
          "snapshot.locking.mode": "none",
          "inconsistent.schema.handling.mode": "warn",
          "max.queue.size": 81290,
          "max.batch.size": 20480,
          "database.server.name": "db1",
          "database.history.kafka.bootstrap.servers": "localhost:9092",
          "database.history.kafka.topic": "db1-history",
          "database.serverTimezone":"Europe/Moscow",
          "database.useCompression": "true",
          "include.schema.changes": "true",
          "errors.log.enable": "true",
          "errors.log.include.messages": "true",
          "decimal.handling.mode": "double",
          "key.converter":"io.confluent.connect.avro.AvroConverter",
          "key.converter.schema.registry.url":"http://10.130.0.10:8081",
          "key.converter.basic.auth.credentials.source": "USER_INFO",
          "key.converter.basic.auth.user.info": "%SCHEMA_REGISTRY_USER%:%SCHEMA_REGISTRY_PASSWORD%",
          "value.converter":"io.confluent.connect.avro.AvroConverter",
          "value.converter.schema.registry.url":"http://10.130.0.10:8081",
          "value.converter.basic.auth.credentials.source": "USER_INFO",
          "value.converter.basic.auth.user.info": "%SCHEMA_REGISTRY_USER%:%SCHEMA_REGISTRY_PASSWORD%",
          "topic.creation.default.compression.type": "gzip",
          "topic.creation.default.replication.factor": "-1",
          "topic.creation.default.partitions": "-1",
          "database.include.list": "",
          "table.include.list": "",
          "database.history.producer.security.protocol":"SASL_PLAINTEXT",
          "database.history.producer.sasl.mechanism":"PLAIN",
          "database.history.producer.sasl.jaas.config":"org.apache.kafka.common.security.plain.PlainLoginModule required username=\"%DB_HISTORY_PRODUCER_USER%\" password=\"%DB_HISTORY_PRODUCER_PASSWORD%\";",
          "database.history.consumer.security.protocol":"SASL_PLAINTEXT",
          "database.history.consumer.sasl.mechanism":"PLAIN",
          "database.history.consumer.sasl.jaas.config":"org.apache.kafka.common.security.plain.PlainLoginModule required username=\"%DB_HISTORY_CONSUMER_USER%\" password=\"%DB_HISTORY_CONSUMER_PASSWORD%\";"
        }
      }

       

      DDL ran on source DB

      grant reader to 'user'@'ip'
      

       

              jpechane Jiri Pechanec
              i.gabdushev ilnur gabdushev (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: