python
network_error
ai_generated
true
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not translate host name "db.example.com" to address: Temporary failure in name resolution
ID: python/sqlalchemy-connection-ssl-error
80%Fix Rate
85%Confidence
0Evidence
2025-11-10First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3.x | active | — | — | — |
Root Cause
DNS resolution failure for database hostname.
generic中文
数据库主机名的 DNS 解析失败。
Workarounds
-
90% success Check DNS configuration and network connectivity.
nslookup db.example.com ping db.example.com
-
85% success Use IP address temporarily and fix DNS.
engine = create_engine('postgresql://user:[email protected]/dbname')
Dead Ends
Common approaches that don't work:
-
Hardcoding IP address in connection string.
60% fail
IP may change; not portable.
-
Increasing connection timeout.
80% fail
DNS failure persists regardless of timeout.