Cannot run a major upgrade on Azure Postgres Flexible Server with pgBouncer

Théo Mouchabac 0 Reputation points
2024-08-10T08:28:06.69+00:00

Hi,

I am trying to perform a major upgrade on my Azure Database for PostgreSQL flexible server from version 14 to version 16. However I am getting an internal server error from the upgrade process, with no detailed information about the exact cause apart from status set to Conflict:

An unexpected error occured while processing the request. Tracking ID: '4ff63968-8165-4649-8435-ef444053a65f' (Code: InternalServerError)

I followed the guidelines here:
https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/concepts-major-version-upgrade#limitations

I have read the documentation about requirements on the PostGIS extension, which is installed on my server and have updated the search_path to include postgis and its activated dependencies.

The documentation also states that the major upgrade cannot be performed if the following extension is active : dblink.

This extensions seems to have been enabled on my server with a previous activation of pgBouncer (which I am not using anyway).

I have thus disabled pgBouncer from the server parameters, however it appears that the schema created by pgBouncer persists and is recreated after a server restart.

I also cannot drop the schema directly because it is owned by the azuresu user.

The only way which had made it disappear was by cascade dropping the dblink extension. However, it reappears after a server restart too.

I have also enabled server logs, but I cannot manage to extract any meaningful information from them about the possible failure causes.

I am guessing that pgBouncer is still present in the background and being the only visibly related element to the conflicting extension, prevents the major upgrade from starting.

So my question is, is there a way to completely disable pgBouncer after the server parameter was disabled ?

Thank you

Azure Database for PostgreSQL
{count} votes

1 answer

Sort by: Most helpful
  1. Vinodh247 20,141 Reputation points
    2024-08-10T13:56:19.4333333+00:00

    Hi Théo Mouchabac,

    Thanks for reaching out to Microsoft Q&A.

    So my question is, is there a way to completely disable pgBouncer after the server parameter was disabled ?

    Make sure your pgbouncer is not getting activated again by any other settings. Since dblink is causing conflicts during the upgrade, you need to drop this extension and its dependent objects (DROP EXTENSION dblink CASCADE;). Also, If the schema created by pgBouncer persists, it might be due to it being automatically recreated. You might need to check your server's initialization scripts or any automated processes that could be reinstating it.

    Please 'Upvote'(Thumbs-up) and 'Accept' as an answer if the reply was helpful. This will benefit other community members who face the same issue.

    0 comments No comments

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.