Comments (6)
Hi dkleehammer,
First of all, thanks for an awesome project.
I'm having this problem with both 3.0.6 and the latest beta (3.0.7-beta03). If I set an incorrect server name in the connect string it tries to connect forever even though I've added the timeout flag to the connect method. Keyboard interrupts don't work until maybe a minute in or so.
I'm on Mac OS X 10.8.2 (64-bit) and the database I'm trying to connect to is a SQL Server 2008 R2 x64 (10.50.1617.0).
I can see that you closed this ticket. Was this fixed?
from pyodbc.
jmagnusson,
Actually, this project is ran by my brother, mkleehammer, but I'm sure he'll check this one. :D
I was incorrect about the keywords in the connection string. The timeout is soley used for query timeouts. We are investigating why the odbc connection timeout isn't being handled properly. We believe we are on the right track and will update pyodbc with the fix as quickly as possible.
dk
from pyodbc.
Did this ever get fixed?
Currently I have a firewall blocking outbound database connections. I've only just found this out after some debugging - unfortunately the timeout keyword seems to be being ignored and it hangs forever. On non firewalled host it works fine but I need me application to raise an error not just hang.
CONN_STRING = 'DSN={};DATABASE={};UID={};PWD={}'.format(SERVER,DATABASE,UID,PWD) conn = pyodbc.connect(CONN_STRING,timeout=15)
from pyodbc.
Is this issue fixed?
from pyodbc.
I don't believe so
On Wed, 6 Apr 2016, 09:13 Sreejith Kesavan, [email protected]
wrote:
Is this issue fixed?
—
You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#11 (comment)
Sent from Android
from pyodbc.
Just discovered this same issue on Windows Server 2019 using ODBC Driver 17 for SQL Server
. I have a canary that is checking health of services using pyodbc
and hit was hanging on this when port is not responding.
Work around is to do a port scan of 1433 before trying to connect.
Here is a helper for scanning ports:
# (bPortOpen, iErrno) = scanPort('<ip>', <port>)
def scanPort(host:str, port:int, timeout:int=4) -> tuple(bool, int):
errno = 0 # see TCP socket error codes https://gist.github.com/gabrielfalcao/4216897
sock = None
try:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.settimeout(timeout)
errno = sock.connect_ex((host, port))
except socket.timeout:
errno=-1
except socket.gaierror:
errno=112
except socket.error:
errno=111
try:
sock.close()
except:
None
return ((errno == 0), errno)
from pyodbc.
Related Issues (20)
- Support for SQL_BLOB ODBC SQL type -98 HOT 2
- im('08001', '[08001] [Microsoft][ODBC Driver 18 for SQL Server]TCP Provider: The wait operation timed out.\r\n (258) (SQLDriverConnect); [08001] [Microsoft][ODBC Driver 18 for SQL Server]Login timeout expired (0); [08001] [Microsoft][ODBC Driver 18 for SQL Server]A network-related or instance-specific error has occurred while establishing a connection to 10.0.0.5\\MSSQL16.MSSQLSERVER,1454. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. (258)')
- Raspberry Pi, Ubuntu 22.04 arm64 ODBC18 SSL error HOT 2
- Can't build release artifacts due to cibuildwheel issue HOT 11
- pyodbc.Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib '/usr/local/lib/libmyodbc8a.so' : file not found (0) (SQLDriverConnect)") HOT 6
- Linux openSUSE Tumbleweed connection to MariaDB stopped working with version 5.x.x HOT 12
- sqlalchemy.exc.OperationalError: (pyodbc.OperationalError) ('08001', '[08001] [Microsoft][ODBC Driver 18 for SQL Server]SSL Provider: [error:0A000102:SSL routines::unsupported protocol] (-1) (SQLDriverConnect)') HOT 1
- Connection is busy with results for another command (0) (SQLExecDirectW) HOT 3
- Transaction is not getting rolled back HOT 7
- MACOS 系统使用 HOT 4
- Memory leak when passing strings within table value parameter to stored proc HOT 9
- Add support for SQLTablePrivileges
- Login Timeout Error when connecting to Synapse database using pyodbc python library in Azure synapse notebook via Managed Identity HOT 1
- reference count encoding in the connect function HOT 5
- PyToCType uses internal function removed from Python 3.13 HOT 3
- I am trying to install pyodbc in MacBook Pro M3 chip - arm64. The drivers are installed succesfully for odbc 13,17 and 18. But pyodbc is not able to detect the drivers.:
- I am trying to install pyodbc in MacBook Pro M3 chip - arm64. The drivers are installed succesfully for odbc 13,17 and 18. But pyodbc is not able to detect the drivers. ERROR: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'ODBC Driver 17 for SQL Server' : file not found (0) (SQLDriverConnect)") HOT 5
- Executing multiple queries HOT 1
- pyodbc.connect() gives an error when executing it with pytest HOT 1
- InterfaceError: Data source name not found with pyodbc despite working with isql HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyodbc.