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

Unexpected packet from server (got Data) #468

Open
charles-001 opened this issue Dec 16, 2024 · 0 comments
Open

Unexpected packet from server (got Data) #468

charles-001 opened this issue Dec 16, 2024 · 0 comments

Comments

@charles-001
Copy link

charles-001 commented Dec 16, 2024

Describe the bug
When using reladiff, I get the error below when it tries to connect to ClickHouse using this driver. I don't think the issue lies with reladiff since the traceback is coming from the driver.

Traceback (most recent call last):
  File "/Users/cthompson/.pyenv/versions/3.11.9/bin/reladiff", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/cthompson/.pyenv/versions/3.11.9/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/cthompson/.pyenv/versions/3.11.9/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/Users/cthompson/.pyenv/versions/3.11.9/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/cthompson/.pyenv/versions/3.11.9/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/cthompson/.pyenv/versions/3.11.9/lib/python3.11/site-packages/reladiff/__main__.py", line 218, in main
    return _main(**kw)
           ^^^^^^^^^^^
  File "/Users/cthompson/.pyenv/versions/3.11.9/lib/python3.11/site-packages/reladiff/__main__.py", line 367, in _main
    schemas = list(differ._thread_map(_get_schema, safezip(dbs, table_paths)))
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/cthompson/.pyenv/versions/3.11.9/lib/python3.11/concurrent/futures/_base.py", line 619, in result_iterator
    yield _result_or_cancel(fs.pop())
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/cthompson/.pyenv/versions/3.11.9/lib/python3.11/concurrent/futures/_base.py", line 317, in _result_or_cancel
    return fut.result(timeout)
           ^^^^^^^^^^^^^^^^^^^
  File "/Users/cthompson/.pyenv/versions/3.11.9/lib/python3.11/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/Users/cthompson/.pyenv/versions/3.11.9/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/Users/cthompson/.pyenv/versions/3.11.9/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/cthompson/.pyenv/versions/3.11.9/lib/python3.11/site-packages/reladiff/__main__.py", line 48, in _get_schema
    return db.query_table_schema(table_path)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/cthompson/.pyenv/versions/3.11.9/lib/python3.11/site-packages/sqeleton/databases/base.py", line 449, in query_table_schema
    rows = self.query(self.select_table_schema(path), list)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/cthompson/.pyenv/versions/3.11.9/lib/python3.11/site-packages/sqeleton/databases/base.py", line 386, in query
    res = self._query(sql_code)
          ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/cthompson/.pyenv/versions/3.11.9/lib/python3.11/site-packages/sqeleton/databases/base.py", line 630, in _query
    return r.result()
           ^^^^^^^^^^
  File "/Users/cthompson/.pyenv/versions/3.11.9/lib/python3.11/concurrent/futures/_base.py", line 456, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/Users/cthompson/.pyenv/versions/3.11.9/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/Users/cthompson/.pyenv/versions/3.11.9/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/cthompson/.pyenv/versions/3.11.9/lib/python3.11/site-packages/sqeleton/databases/base.py", line 636, in _query_in_worker
    return self._query_conn(self.thread_local.conn, sql_code)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/cthompson/.pyenv/versions/3.11.9/lib/python3.11/site-packages/sqeleton/databases/base.py", line 584, in _query_conn
    return apply_query(callback, sql_code)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/cthompson/.pyenv/versions/3.11.9/lib/python3.11/site-packages/sqeleton/databases/base.py", line 135, in apply_query
    return callback(sql_code)
           ^^^^^^^^^^^^^^^^^^
  File "/Users/cthompson/.pyenv/versions/3.11.9/lib/python3.11/site-packages/sqeleton/databases/base.py", line 569, in _query_cursor
    c.execute(sql_code.code, sql_code.args)
  File "/Users/cthompson/.pyenv/versions/3.11.9/lib/python3.11/site-packages/clickhouse_driver/dbapi/cursor.py", line 117, in execute
    raise OperationalError(orig)
clickhouse_driver.dbapi.errors.OperationalError: Code: 102. Unexpected packet from server $host:9000 (expected ProfileEvents, Progress, Log, Exception or TimezoneUpdate, got Data)

To Reproduce
Run reladiff like this:

reladiff --verbose --debug -i --case-sensitive \
mysql://"$MYSQL_USER":"$MYSQL_PASSWORD"@$MYSQL_HOST:$PORT/$DATABASE $TABLE \
clickhouse://"$CLICKHOUSE_USER":"$CLICKHOUSE_PASSWORD"@"$CLICKHOUSE_HOST:9000/$DATABASE" $TABLE \
--bisection-factor 500 \
--threads 5 \
--update-column created_at \
--min-age 10min \
--columns created_at \
--columns id \
--columns user_id

Versions
Package: 0.2.9
ClickHouse: 24.8.4
Python: 3.11.9

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

1 participant