[Microsoft][ODBC Driver 18 for SQL Server]Unable to complete login process due to delay in prelogin response (258)')

Gabriel Pimentel 0 Reputation points
2024-04-01T19:38:07.29+00:00

1.172 / 5.000

I'm trying to integrate an application with the Azure database but I'm facing some difficulties. The application uses the Python language with the Django framework.

Here is the application's settings.py:

DATABASES = {

'default': {

'ENGINE': 'sql_server.pyodbc',

'NAME':'etsrooms-d1-bd',

'USER':'admin.gabriel',

'PASSWORD':############',

'HOST':'tcp:etsrooms-d1-server.database.windows.net',

'PORT':'1433',

'OPTIONS':{ 'driver':'ODBC Driver 18 for SQL Server',

},

},

}

I ran this command in the terminal:

python manager.py dumpdata

And I got this error:

CommandError: Unable to serialize database: ('08001', '[08001] [Microsoft][ODBC Driver 18 for SQL Server]TCP Provider: Timeout error [258]. (258) (SQLDriverConnect); [ 08001] [Microsoft][ODBC 18 Driver for SQL Server]Login timeout expired (0); [08001] [Microsoft][ODBC 18 Driver for SQL Server]Invalid connection string attribute (0); [08001] [ Microsoft][ODBC 18 Driver for SQL Server] Unable to complete login process due to delay in pre-login response (258)')

Azure SQL Database
Azure
Azure
A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.
1,045 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. hossein jalilian 7,205 Reputation points
    2024-04-01T20:27:36.03+00:00

    Thanks for posting your question in the Microsoft Q&A forum.

    It seems like the issue you're experiencing may be related to the database connection settings or communication between your application and the database.

    1. Ensure that your application can reach the Azure SQL database server. Verify that there are no network issues or firewall restrictions blocking the connection.
    2. Double-check the connection string in your settings.py file. Make sure that the database name, username, password, host, and port are correct. Ensure that the ODBC driver specified is compatible with the database and installed on your system.
    3. Try connecting to the Azure SQL database using a SQL client tool or command-line utility from the same environment where your Python application is running. This can help verify if the connection parameters are correct and if there are any connectivity issues.

    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful

    0 comments No comments

  2. Alberto Morillo 33,866 Reputation points MVP
    2024-04-01T22:29:07.34+00:00

    Could you try to use this article to make sure things are setup correctly? It is an old article but it may be useful.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.