GitHub user dosubot[bot] added a comment to the discussion: Production 
deployment issue in

<!-- Answer -->
A login timeout (`HYT00`) from pyodbc almost always means your Superset pod 
cannot reach the SQL Server—this is usually a network/firewall, DNS, or Azure 
SQL configuration issue, not a problem with your Docker image or driver install 
(which look correct) 
[source](https://github.com/apache/superset/blob/c74fae9663e4e4341baa106209219244eb5dc629/docs/docs/configuration/databases.mdx).

Here’s how to troubleshoot:

1. **Check network connectivity from your Superset pod**:  
   Exec into the running pod and run:
   ```
   nslookup apsqlminnd002.e88744a491af.database.windows.net
   nc -vz apsqlminnd002.e88744a491af.database.windows.net 1433
   ```
   If DNS or port 1433 is blocked, you’ll see a failure. In that case, make 
sure your AKS cluster’s outbound IP(s) are allowed in the Azure SQL Server 
firewall, and that no Network Security Group or AKS Network Policy is blocking 
egress to port 1433.

2. **Verify the ODBC driver is installed**:  
   In the same pod, run:
   ```
   python -c "import pyodbc; print(pyodbc.drivers())"
   ```
   You should see `ODBC Driver 18 for SQL Server` in the output.

3. **Test a direct pyodbc connection**:  
   Still inside the pod, run a minimal script:
   ```python
   import pyodbc
   conn_str = (
       "DRIVER={ODBC Driver 18 for SQL Server};"
       "SERVER=apsqlminnd002.e88744a491af.database.windows.net;"
       "DATABASE=Multitenant_Staging_Mechanical2;"
       "UID=dynamicapp_user;"
       "PWD=goddyun@m1ct$tu$r;"
       "Encrypt=yes;"
       "TrustServerCertificate=yes;"
       "Connection Timeout=30;"
   )
   print(pyodbc.connect(conn_str))
   ```
   If this times out, it’s a network/firewall issue. If it fails with 
authentication, check your username/password.

4. **Check your connection string encoding**:  
   The value after `odbc_connect=` must be URL-encoded **once** (not 
double-encoded). For example, `@` becomes `%40`, `$` becomes `%24`. If you see 
`%2540` or `%2524`, it’s double-encoded and will fail 
[source](https://github.com/apache/superset/blob/c74fae9663e4e4341baa106209219244eb5dc629/docs/docs/configuration/databases.mdx).

5. **If the direct test works but Superset still fails**:  
   Double-check that the exact same connection string is used in Superset, and 
that you’re not double-encoding the password.

If you’re using Azure SQL, make sure:
- The AKS cluster’s outbound IP(s) are whitelisted in the Azure SQL Server 
firewall.
- The SQL Server allows connections on port 1433.
- Your credentials are correct and have access to the database.

If you follow these steps, you’ll pinpoint whether the problem is network, 
driver, credentials, or connection string formatting. Let me know what you find 
from the direct pod tests!


<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*

---
<sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/7642da54-1d56-4670-bda0-6846aeaef3db?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/7642da54-1d56-4670-bda0-6846aeaef3db?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/7642da54-1d56-4670-bda0-6846aeaef3db?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/7642da54-1d56-4670-bda0-6846aeaef3db?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/7642da54-1d56-4670-bda0-6846aeaef3db?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/7642da54-1d56-4670-bda0-6846aeaef3db?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/7642da54-1d56-4670-bda0-6846aeaef3db?feedback_type=other)</sup>&nbsp;&nbsp;[![Join
 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Sh
 are on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/discussions/33957)

GitHub link: 
https://github.com/apache/superset/discussions/33957#discussioncomment-13640505

----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: 
notifications-unsubscr...@superset.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org
For additional commands, e-mail: notifications-h...@superset.apache.org

Reply via email to