Application unable to connect to Listener intermittently on port 1433

Amisha Bhadauria 0 Reputation points
2024-07-21T04:05:37.09+00:00

We have a named instance that's running on a dynamic port, with a Listener specified on port 1433. All application strings only specify the listener IP and port. A scheduled job connects to the listener once a day, but it sometimes fails with the error message:

"Could not get JDBC Connection; The TCP/IP connection to the host 'LISTENER IP', port 1433 has failed. Error: 'connect timed out. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.'"

We have not received any other error reports from any of the other applications. Could the issue be caused by dynamic ports? Should we assign 1433 to the instance as well? Would this cause any other issues like port conflicts, etc.?

Thank you in advance.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,998 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Erland Sommarskog 112.7K Reputation points MVP
    2024-07-23T19:22:32.65+00:00

    Yes, this is the only job which fails to connect from app server and it runs in the night around 3 am. However, if this run of the job fails, it is again set to run at 5 am as well. But it fails again with the same error.

    So this is something in your environment. ...Or in the job itself? Like something random scribbles the connection string, and the job is trying to connect to a server in the inner of Patagonia?

    So are you suggesting we set a fixed port on the nodes which would be different than 1433?

    I have had some confusion when I had listener and instances on the same port, but I should hasten to add that this was my clusterless AG here at home.

    Just to mention, the connection string only mentions the listener IP with 1433 port.

    Just like it should.

    1 person found this answer helpful.
    0 comments No comments

  2. LucyChenMSFT-4874 5,060 Reputation points
    2024-07-22T02:16:02.63+00:00

    Hi @Amisha Bhadauria ,

    Thank you for your reaching out and Welcome to Microsoft Q&A!

    Please check out this official document!

    In addition, you can check the following configurations:

    • Make sure the SQL Server instance is running.
    • Please go to SQL Server Configuration Manager -> expand SQL Server Network Configuration->Protocols for InstanceName, make sure TCP/IP is enabled.
    • Then go to TCP/IP properties-> IP Addresses tab, make sure SQL Server instance is listening on port 1433 under TCP port.
    • Please make sure you have configured the firewall on the computer running SQL Server to allow access.

    As Erland says, could you please tell us from where does this job run? SQL Server Agent? Or something else?

    Thanks for your understanding. Your time and cooperation are much valued by us. We are looking forward to hearing from you to assist further.

    Best regards,

    Lucy Chen


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    https://docs.microsoft.com/en-us/answers/support/email-notifications


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.