Share via

Unable to upgrade PostgraSQL from 13.23 to 17.7

Srihari Parameswaran 0 Reputation points
2026-02-16T10:31:28.55+00:00

We were trying to upgrade our Production SQL server from 13.23 to 17.7 but in the middle we were getting an error saying '{   "code": "InternalServerError",   "message": "An unexpected error occured while processing the request. Tracking ID: 'd2e6e059-65df-4723-a9a3-e0f7f32fd726'" }'

Azure Database for PostgreSQL
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. SAI JAGADEESH KUDIPUDI 485 Reputation points Microsoft External Staff Moderator
    2026-02-18T16:06:10.0366667+00:00

    Hi Srihari Parameswaran,
    Follow the steps below to resolve the PostgreSQL upgrade failure from 13.23 to 17.7.

    Step 1: Confirm PostgreSQL 17 support in the region
    First, verify that PostgreSQL 17 is available as an upgrade option for your server in the Azure Portal. Major version upgrades are enabled in phases by region, and if PostgreSQL 17 is not enabled for your server, the upgrade may fail with an InternalServerError.

    Step 2: Remove all read replicas
    Next, ensure that no read replicas are configured on the server. Azure does not allow in‑place major version upgrades when read replicas exist, so all replicas must be removed before retrying the upgrade.

    Step 3: Check and remove unsupported extensions (per database
    Then, check all databases on the server for unsupported extensions. Azure validates extensions at the database level, not just at the server level. If any database contains unsupported extensions such as timescaledb, dblink, postgres_fdw, pgaudit, or hypopg, the upgrade will fail. Remove these extensions before proceeding.

    Step 4: Remove logical replication slots
    After that, verify that there are no logical replication slots configured. Logical replication slots can block the major version upgrade and must be dropped prior to starting the upgrade.

    Step 5: Ensure sufficient free storage
    Confirm that the server has at least 10–20% free storage space available. Azure requires this free space to create temporary files during the upgrade process, and insufficient storage can cause the upgrade to fail.

    Step 6: Run the Azure pre‑upgrade validation
    Finally, retry the upgrade from the Azure Portal and review the pre‑upgrade validation results. If the pre‑check completes successfully, the upgrade should proceed without errors.

    This guidance aligns with Microsoft’s official recommendations for major version upgrades on Azure Database for PostgreSQL Flexible Server.
    Reference Link:
    Major version upgrades – Azure Database for PostgreSQL https://learn.microsoft.com/azure/postgresql/configure-maintain/concepts-major-version-upgrade [learn.microsoft.com]
    How to perform a major version upgrade https://learn.microsoft.com/azure/postgresql/configure-maintain/how-to-perform-major-version-upgrade [docs.azure.cn]


  2. Q&A Assist
    2026-02-16T10:31:40.46+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    The error message you encountered during the upgrade process from PostgreSQL 13.23 to 17.7 indicates an unexpected internal server error. This can happen for various reasons, including unsupported server configurations or issues with the upgrade process itself.

    Here are some common considerations and limitations that could lead to such errors:

    1. Unsupported Server Configurations: Ensure that your server configurations are compatible with the upgrade. For example, if you have read replicas, they must be deleted before the upgrade.
    2. Network Traffic Rules: Verify that your server can send and receive traffic on the necessary ports (5432 and 6432) and that there are no network security group (NSG) restrictions that could block the upgrade.
    3. Logical Replication Slots: These are not supported during in-place major version upgrades, so ensure none are present.
    4. Extensions: Some PostgreSQL extensions may block the upgrade if they are not supported in the target version. Check for any unsupported extensions and remove them before attempting the upgrade.
    5. Free Storage: Ensure that your server has at least 10-20% free storage available, as insufficient space can lead to upgrade failures.
    6. Precheck Procedure: The upgrade process includes a precheck that identifies potential issues. If this precheck fails, it will block the upgrade and provide a detailed error message.

    If you continue to experience issues, consider reviewing the upgrade logs for more detailed information about the error. This can help in diagnosing the problem and determining the next steps for a successful upgrade.


    References:

    0 comments No comments

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.