I am having connection timeout issue in my postgresql Flexible Server, What could be the solution for the same as i am not able to stop the server from last 30mins

Jesica Parekh 0 Reputation points
2026-08-03T13:03:17.9666667+00:00

User's imageUser's image

Azure Database for PostgreSQL

2 answers

Sort by: Most helpful
  1. Harish Alwar S 0 Reputation points
    2026-08-03T14:54:05.8666667+00:00

    A connection timeout on Azure Database for PostgreSQL Flexible Server is commonly caused by networking issues, firewall rules, DNS resolution, VNet/private endpoint configuration, or temporary Azure maintenance. First, check Azure Service Health to see if there is an ongoing service incident. Then verify that the server is running, confirm the correct hostname, port (5432), SSL settings, and ensure your client IP is allowed through the firewall. If the server cannot be stopped and remains unresponsive for more than 30–60 minutes, collect the error details and open a Microsoft Azure Support ticket, as the issue may require backend intervention.

    Was this answer helpful?

    0 comments No comments

  2. AI answer

    2026-08-03T13:03:43.57+00:00

    A 30-minute Stopping state plus connection timeouts usually points to one of these areas:

    1. Transient platform event or maintenance Azure Database for PostgreSQL flexible server can briefly lose connectivity during maintenance, infrastructure events, or compute changes. Typical transient interruptions are usually under 60 seconds, so 30 minutes is longer than normal.
    2. Persistent connectivity issue Check these first:
      • Server firewall rules allow the client IP.
      • Any client-side firewall allows outbound port 5432.
      • Connection settings are correct: host, port, username, database, and SSL.
      • The client uses SSL correctly. For PostgreSQL flexible server, the connection string examples use sslmode=require.
    3. Server busy or not ready during stop A stop operation can fail or remain unavailable if the server is not in Ready state or is processing another operation. Azure CLI documents errors such as ServerIsNotReady and SeverBusyWithOtherOperation in these cases.

    Recommended path:

    1. Check Azure service health first Review the Microsoft Azure Service Dashboard for any outage or maintenance affecting PostgreSQL in the region.
    2. Validate network access
      • In the server networking/firewall settings, confirm the client public IP is allowed.
      • For testing only, a temporary broad firewall rule can be used to confirm whether firewall rules are the cause. This opens the server to all IP addresses, so remove it immediately after testing and replace it with a restricted rule.
      • Ensure outbound 5432 is open on all firewalls between the client and the internet.
    3. Verify the connection settings Use the server endpoint, port 5432, correct database and admin user, and SSL enabled. Example format: host=<server-name>.postgres.database.azure.com port=5432 dbname=<database-name> user=<admin-user> password=<password> sslmode=require
    4. If this is related to migration or long-lived transfers Connection timeout symptoms such as server closed the connection unexpectedly, SSL SYSCALL error: EOF detected, or unexpected EOF on client connection can be mitigated by adjusting TCP keepalive settings:
      • tcp_keepalives_idle=10
      • tcp_keepalives_interval=10
      • tcp_keepalives_count=60
    5. If the server stays in Stopping beyond normal time This is no longer a normal transient event. If connectivity problems continue, or the duration exceeds 60 seconds repeatedly, the documented action is to file an Azure support request using Get Support.
    6. Recovery option if the server remains unavailable for an extended period If restart/stop operations continue to fail and the server remains inaccessible for a long time, the accepted Microsoft Q&A guidance is to restore service by creating a new flexible server and using Point-in-Time Restore from the latest backup, preferably in another region if geo-redundant backups are enabled.

    Risk note: using a firewall rule that allows all IPs is for temporary testing only and should be removed immediately after validation.


    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

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