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

[Bug] mysql-connector-python-8.2.0 cannot connect to FE #29334

Closed
2 of 3 tasks
gavinchou opened this issue Dec 29, 2023 · 5 comments
Closed
2 of 3 tasks

[Bug] mysql-connector-python-8.2.0 cannot connect to FE #29334

gavinchou opened this issue Dec 29, 2023 · 5 comments

Comments

@gavinchou
Copy link
Contributor

gavinchou commented Dec 29, 2023

Search before asking

  • I had searched in the issues and found no similar issues.

Version

2.0.3 (or may be all versions of doris)

What's Wrong?

Cannot connect to doris with mysql-connector-python-8.2.0 (install with pip3 by default on macOS ventura)

pip3 install mysql-connector-python

the following code does not work (I've customized the port in fe.conf)

import mysql.connector

cnx = mysql.connector.connect(user='gavin', password='pass', host='localhost', port=8902)
cnx.connect()
cursor = cnx.cursor()
cursor.execute("show databases;")
for i in cursor:
    print(i)
cnx.close()

it throws the following error

Traceback (most recent call last):
  File "/Users/user/workspace/python/mysql-connector/mysql_test.py", line 3, in <module>
    cnx = mysql.connector.connect(user='user', password='gavin', host='localhost', port=8902)
  File "/Users/user/Library/Python/3.9/lib/python/site-packages/mysql/connector/pooling.py", line 294, in connect
    return MySQLConnection(*args, **kwargs)
  File "/Users/user/Library/Python/3.9/lib/python/site-packages/mysql/connector/connection.py", line 169, in __init__
    self.connect(**kwargs)
  File "/Users/user/Library/Python/3.9/lib/python/site-packages/mysql/connector/abstracts.py", line 1237, in connect
    self._open_connection()
  File "/Users/user/Library/Python/3.9/lib/python/site-packages/mysql/connector/connection.py", line 355, in _open_connection
    self._do_auth(
  File "/Users/user/Library/Python/3.9/lib/python/site-packages/mysql/connector/connection.py", line 288, in _do_auth
    ok_pkt = self._authenticator.authenticate(
  File "/Users/user/Library/Python/3.9/lib/python/site-packages/mysql/connector/authentication.py", line 376, in authenticate
    pkt = bytes(sock.recv())
  File "/Users/user/Library/Python/3.9/lib/python/site-packages/mysql/connector/network.py", line 631, in recv
    return self._netbroker.recv(self.sock, self.address)
  File "/Users/user/Library/Python/3.9/lib/python/site-packages/mysql/connector/network.py", line 231, in recv
    header = self._recv_chunk(sock, size=PACKET_HEADER_LENGTH)
  File "/Users/user/Library/Python/3.9/lib/python/site-packages/mysql/connector/network.py", line 178, in _recv_chunk
    raise InterfaceError(errno=2013)
mysql.connector.errors.InterfaceError: 2013: Lost connection to MySQL server during query

however the older version of mysql-connector-python works

 pip3 install --force-reinstall -v "mysql-connector-python==8.0.16"

What You Expected?

Get connected to doris FE with mysql-connector-python-8.2.0

How to Reproduce?

install with pip3 mysql-connector-python-8.2.0 (by default on macOS ventura)

pip3 install mysql-connector-python

run the following code

import mysql.connector

cnx = mysql.connector.connect(user='gavin', password='pass', host='localhost', port=8902)
cnx.connect()
cursor = cnx.cursor()
cursor.execute("show databases;")
for i in cursor:
    print(i)
cnx.close()

Anything Else?

A tcpdump shows that doris FE ended the connection prematurely

image

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@Vallishp
Copy link
Contributor

Hi, can you please share fe.log? Also did you change default port config? 8030 is http config by default. For mysql default is 9030. Code snap shows 8030. Can you please recheck it?

@gavinchou
Copy link
Contributor Author

Hi, can you please share fe.log? Also did you change default port config? 8030 is http config by default. For mysql default is 9030. Code snap shows 8030. Can you please recheck it?

@Vallishp I've customized the query port in fe.conf, the port is for demonstration, and I've already mentioned that "the older version of mysql-connectory-python works". There is also a tcpdump what happened when mysql-connectory-python-8.2.0 tried to connect doris, please check the last section of the issue report.

@Vallishp
Copy link
Contributor

Vallishp commented Jan 2, 2024

@gavinchou I was able to test with latest master version for Doris.
image

May be can you please check and share fe.log file. From tcpdump connection getting closed. We might get some clue from the fe.log about.

@gavinchou
Copy link
Contributor Author

@Vallishp Thank you for your reply, I tried to reinstall 8.2.0 and cannot reproduce the issue I just reported, that's weird... There may be something wrong that I didn't notice.

This issue can be closed.

@me440378
Copy link

hi.
Is this problem related to #31857?
Is it solved by upgrading doris?

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

3 participants