Internal server error while creating postgres flexible server

Uday Kiran Reddy 11 Reputation points
2022-01-24T14:41:58.457+00:00

With below terraform template, when I try to create postgres flexible server, getting error as:

 Error: waiting for creation of the Postgresql Flexible Server "testaksk8s-del-postgres-del" (Resource Group "testaksk8s-del-postgres"): Code="InternalServerError" Message="An unexpected error occured while processing the request. Tracking ID: '4a1b5b2f-3d37-4fd3-9d36-7572b53e8287'"
│
│   with azurerm_postgresql_flexible_server.example,
│   on 12-postgres.tf line 15, in resource "azurerm_postgresql_flexible_server" "example":
│   15: resource "azurerm_postgresql_flexible_server" "example" {

The templates link: https://github.com/uday-globuslive/test-postgres-templates

Same issue with azure cli also:

C:\Users\user1>az postgres flexible-server create --admin-password "erwin@2020" --admin-user postgres --backup-retention 7 --high-availability Disabled --location eastus2 --name testaksk8s-del-postgres-del --private-dns-zone /subscriptions/f733ab10-e6a2-406d-9c23-cafe4ec0e71e/resourceGroups/testaksk8s-del-postgres/providers/Microsoft.Network/privateDnsZones/deve.private.postgres.database.azure.com --resource-group "testaksk8s-del-postgres" --sku-name Standard_D2s_v3 --storage-size 128 --subnet "/subscriptions/f733ab10-e6a2-406d-9c23-cafe4ec0e71e/resourceGroups/testaksk8s-del/providers/Microsoft.Network/virtualNetworks/testaksk8s/subnets/testaksk8s-subnet2" --version 13 --zone 1
Checking the existence of the resource group 'testaksk8s-del-postgres'...
Resource group 'testaksk8s-del-postgres' exists ? : True
You have supplied a Subnet ID. Verifying its existence...
Using existing Vnet "testaksk8s" in resource group "testaksk8s-del"
Using existing Subnet "testaksk8s-subnet2" in resource group "testaksk8s-del"
Using the existing private dns zone deve.private.postgres.database.azure.com in resource group "testaksk8s-del-postgres"
Creating PostgreSQL Server 'testaksk8s-del-postgres-del' in group 'testaksk8s-del-postgres'...
Your server 'testaksk8s-del-postgres-del' is using sku 'Standard_D2s_v3' (Paid Tier). Please refer to https://aka.ms/postgres-pricing for pricing details
(InternalServerError) An unexpected error occured while processing the request. Tracking ID: '7c903c34-671c-4570-83b0-639ef964d0b1'
Code: InternalServerError
Message: An unexpected error occured while processing the request. Tracking ID: '7c903c34-671c-4570-83b0-639ef964d0b1'
Azure Database for PostgreSQL
{count} votes

2 answers

Sort by: Most helpful
  1. GeethaThatipatri-MSFT 29,542 Reputation points Microsoft Employee Moderator
    2022-02-08T16:13:41.06+00:00

    Hi, @Uday Kiran Reddy to close this thread this was addressed here and the resolution is to update the code as mentioned below.
    please let us know if you need any additional information, we are happy to help. if you find the above reply useful. If yes, do click on 'Mark as answer' This will help other community members facing similar queries to refer to this solution.
    172284-image.png

    Regards
    Geetha

    0 comments No comments

  2. Aaron Waidmann 1 Reputation point
    2022-02-16T08:55:06.277+00:00

    Hi!
    So, something you could be missing is that your flexible server is blocking your (or your pipelines) network traffic.
    You are going to need one (or many) azurerm_postgresql_flexible_server_firewall_rule to allow traffic to your flexible server.

    There seems to be an issue with the database resource returning an internal server error though.

    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.