Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kafka_consumer wrong timezone when no parameter ‘--timezone’ and env ‘TZ’ is not set #1082

Closed
dengqee opened this issue Nov 17, 2020 · 1 comment

Comments

@dengqee
Copy link
Contributor

dengqee commented Nov 17, 2020

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do? If possible, provide a recipe for reproducing the error.
    I test the kafka_consumer demo you provided, which set downstream is mysql, no parameter timezone and env 'TZ' is not set. MySQL returns an error:
Error 1298: Unknown or incorrect time zone: 'Local'

cdc changefeed create command:

[root@localhost bin]# ./cdc cli changefeed create --pd=http://127.0.0.1:2379 --changefeed-id kafka-sink-demo --sink-uri="kafka://127.0.0.1:9092/demo?kafka-version=2.4.0&partition-num=6&max-message-bytes=67108864&replication-factor=1"
Create changefeed successfully!
ID: kafka-sink-demo
Info: {"sink-uri":"kafka://127.0.0.1:9092/demo?kafka-version=2.4.0\u0026partition-num=6\u0026max-message-bytes=67108864\u0026replication-factor=1","opts":{},"create-time":"2020-11-16T14:42:24.238472383+08:00","start-ts":420874536675442689,"target-ts":0,"admin-job-type":0,"sort-engine":"memory","sort-dir":".","config":{"case-sensitive":true,"enable-old-value":false,"filter":{"rules":["*.*"],"ignore-txn-start-ts":null,"ddl-allow-list":null},"mounter":{"worker-num":16},"sink":{"dispatchers":null,"protocol":"default"},"cyclic-replication":{"enable":false,"replica-id":0,"filter-replica-ids":null,"id-buckets":0,"sync-ddl":false},"scheduler":{"type":"table-number","polling-time":-1}},"state":"normal","history":null,"error":null}
[root@localhost bin]# ./cdc cli changefeed list
[
  {
    "id": "kafka-sink-demo",
    "summary": {
      "state": "normal",
      "tso": 420874650000031748,
      "checkpoint": "2020-11-16 14:49:36.526",
      "error": null
    }
  }
]

kafka_consumer command:

 ./kafka_consumer --upstream-uri="kafka://127.0.0.1:9092/cdc-test?kafka-version=2.4.0&partition-num=6&max-message-bytes=67108864&replication-factor=1" --downstream-uri="mysql://root:123456@127.0.0.1:3306/"
  1. What did you expect to see?
    kafka_consumer runs successfully, and can consume messages from Kafka and parse them to downstream mysql.
  2. What did you see instead?
    kafka_consumer exit with a FATAL log in file cdc_kafka_consumer.log
...[CDC:ErrMySQLQueryError]Error 1298: Unknown or incorrect time zone: 'Local'...
  1. Versions of the cluster

    • Upstream TiDB cluster version (execute SELECT tidb_version(); in a MySQL client):

      Release Version: v4.0.6
      Edition: Community
      Git Commit Hash: 51d365fc45fdfc039eb204a96268c5bd1c55075f
      Git Branch: heads/refs/tags/v4.0.6
      UTC Build Time: 2020-09-15 09:50:30
      GoVersion: go1.13
      Race Enabled: false
      TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
      Check Table Before Drop: false
      
    • TiCDC version (execute cdc version):

      Release Version: v4.0.6
      Git Commit Hash: 51404d7abdec0b7624a7597497d09f43b084b685
      Git Branch: heads/refs/tags/v4.0.6
      UTC Build Time: 2020-09-15 09:45:01
      Go Version: go version go1.13 linux/amd64
      
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants