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

Is there a way to debug the connection? #192

Open
RMHogervorst opened this issue Dec 9, 2021 · 4 comments
Open

Is there a way to debug the connection? #192

RMHogervorst opened this issue Dec 9, 2021 · 4 comments

Comments

@RMHogervorst
Copy link

I've tried connecting to a mssql server like this:

import os
os.environ['RUST_LOG']="connectorx=debug,connectorx_python=debug"
import connectorx as cx

url = "mssql://user_name:password@server_host:port/db_name"
df = cx.read_sql(url, "select top 10 * from dbo.stupidtablename")

But all I get back is:

[datetime DEBUG connectorx_python::pandas] Running dispatcher
[datetime DEBUG connectorx::dispatcher] Fetching metadata
Traceback to connectorx/__init__py
RuntimeError: Timed out in bb8

Is there a way for me to debug connection info?
It must not reach the server or something like that

@wangxiaoying
Copy link
Contributor

Hi @RMHogervorst , thanks for the log! Indeed it looks like it cannot connect to mssql. Maybe one thing you can do is to use another client tool to make sure the host and port are correct. What I usually use is mssql-cli. It is easy to install (pip install mssql-cli) and you can try out your connection info using command: mssql-cli -S"${server_host},${port}" -U${user} -P${password} -d${db_name}.

@sundeeprpatil
Copy link

Hi @wangxiaoying 👍 thank you for the advice.
I dont have issues talking to dB via my laptop (either via pyodbc / mssql-cli).
I think it's could be some cloud related/ network issue. My code is running as web app service and its quering some data from SQL sitting in a VM. Any advice / comments would help.

@wangxiaoying
Copy link
Contributor

Hi @sundeeprpatil , I'm not sure what's the error message you got. But if it's the same timed out, then I think it is because the database is not reachable from the code's running environment. Instead of running on your laptop, you need to run mssql-cli inside the same VM to see whether it works.

@sundeeprpatil
Copy link

sundeeprpatil commented May 4, 2022 via email

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