azure-remix-stack icon indicating copy to clipboard operation
azure-remix-stack copied to clipboard

Trouble provisioning database

Open jstoone opened this issue 2 years ago • 2 comments

As we've been accepted into the Microsoft Founders Hub, I am now looking into the migration path we can take to move from Fly.io to Azure.

I've tried following the steps, but when running the provisioning steps I get the following output:

(main) [1] % azd provision                                                                                                       ~/Sites/azure/azure-notes-app

Provisioning Azure resources (azd provision)
Provisioning Azure resources can take some time


  You can view detailed progress in the Azure Portal:
  https://portal.azure.com/#blade/HubsExtension/DeploymentDetailsBlade/overview/id/%2Fsubscriptions%2F7016d301-b77a-4084-83ed-f61ec4c3c495%2Fproviders%2FMicrosoft.Resources%2Fdeployments%2Fazure-notes-app-1684586540

  (✓) Done: Resource group: rg-azure-notes-app
  (✓) Done: Log Analytics workspace: log-6pdjv6yqsrp3w
  (✓) Done: Application Insights: appi-6pdjv6yqsrp3w
  (✓) Done: Portal dashboard: dash-6pdjv6yqsrp3w
  (✓) Done: Container Apps Environment: cae-6pdjv6yqsrp3w
  (x) Failed: Azure Database for PostgreSQL flexible server: psql-db-6pdjv6yqsrp3w
  (✓) Done: Container Registry: cr6pdjv6yqsrp3w

ERROR: deployment failed: failing invoking action 'provision', error deploying infrastructure: deploying to subscription:

Deployment Error Details:
InternalServerError: An unexpected error occured while processing the request. Tracking ID: '2adc0978-33cc-48b6-b4fc-359447d4b1e8'

  |       | Creating/Updating resourcesTraceID: 06dd6919ecb123e5efee779f15834831
When I look into the deployment job in Azure Portal I see the following Failed job, giving a bit of a non-descript error for creating `remix-db`:
{
  "code": "DeploymentFailed",
  "target": "/subscriptions/7016d301-b77a-4084-83ed-f61ec4c3c495/resourceGroups/rg-azure-notes-app/providers/Microsoft.Resources/deployments/db-remix",
  "message": "At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.",
  "details": [
    {
      "code": "ResourceDeploymentFailure",
      "target": "/subscriptions/7016d301-b77a-4084-83ed-f61ec4c3c495/resourceGroups/rg-azure-notes-app/providers/Microsoft.DBforPostgreSQL/flexibleServers/psql-db-6pdjv6yqsrp3w",
      "message": "The resource write operation failed to complete successfully, because it reached terminal provisioning state 'Failed'.",
      "details": [
        {
          "code": "InternalServerError",
          "message": "An unexpected error occured while processing the request. Tracking ID: '2adc0978-33cc-48b6-b4fc-359447d4b1e8'"
        }
      ]
    }
  ]
}

jstoone avatar May 20 '23 13:05 jstoone

Could this have anything to do with flexible servers being out of preview? Also if I wanted PostgreSQL v14, could I just change the version parameter in infra/core/database/postgres.bicep?

jstoone avatar May 20 '23 13:05 jstoone

Can you generate a debug log with the --debug flag? That should show more details of why the provisioning failed.

Also if I wanted PostgreSQL v14, could I just change the version parameter in infra/core/database/postgres.bicep?

Yep. I could make that a parameter that defaults to the latest version to save hand editing the Bicep.

aaronpowell avatar May 23 '23 02:05 aaronpowell