pulumi-azure-native: Unable to delete an `azure-native.dbforpostgresql.Configuration` resource: PUT vs PATCH

What happened?

I seem not to be able to delete an azure-native.dbforpostgresql.Configuration resource. As a consequence I can also not destroy a stack without manual intervention. As you can see in the reproducible example below I am only doing a minor configuration change.

Thank you for your great work on this project.

Example

// index.ts

import {
  Configuration,
  Server,
  SkuTier,
} from "@pulumi/azure-native/dbforpostgresql";
import { ResourceGroup } from "@pulumi/azure-native/resources";

const resourceGroup = new ResourceGroup(`deleteme`);

const server = new Server(
  `deleteme`,
  {
    resourceGroupName: resourceGroup.name,
    administratorLogin: "NotForProduction",
    administratorLoginPassword: "NotForProduction",
    sku: {
      name: "Standard_B1ms",
      tier: SkuTier.Burstable,
    },
    version: "16",
    storage: {
      storageSizeGB: 32,
    },
  },
  { parent: resourceGroup },
);

new Configuration(
  "deleteme",
  {
    resourceGroupName: resourceGroup.name,
    serverName: server.name,
    configurationName: "azure.extensions",
    value: "vector",
    source: "user-override",
  },
  { parent: server },
);
root@c38eaf6a2211:/dev/workspace/pulumi/bugs# pulumi up
Please choose a stack, or create a new one: <create a new stack>
Please enter your desired stack name: dev 
Created stack 'dev'
Previewing update (dev):
     Type                                                 Name      Plan       Info
 +   pulumi:pulumi:Stack                                  bugs-dev  create     1 message
 +   └─ azure-native:resources:ResourceGroup              deleteme  create     
 +      └─ azure-native:dbforpostgresql:Server            deleteme  create     
 +         └─ azure-native:dbforpostgresql:Configuration  deleteme  create     

Diagnostics:
  pulumi:pulumi:Stack (bugs-dev):
    Downloading provider: azure-native

Resources:
    + 4 to create

Do you want to perform this update? yes
Updating (dev):
     Type                                                 Name      Status             
 +   pulumi:pulumi:Stack                                  bugs-dev  created (391s)     
 +   └─ azure-native:resources:ResourceGroup              deleteme  created (1s)       
 +      └─ azure-native:dbforpostgresql:Server            deleteme  created (363s)     
 +         └─ azure-native:dbforpostgresql:Configuration  deleteme  created (17s)      

Resources:
    + 4 created

Duration: 6m33s

I have verified that the configuration change has happened in Azure.

After commenting out the Configuration code block and running pulumi up I get the following error:

root@c38eaf6a2211:/dev/workspace/pulumi/bugs# pulumi up
Previewing update (dev):
     Type                                                 Name      Plan       
     pulumi:pulumi:Stack                                  bugs-dev             
     └─ azure-native:resources:ResourceGroup              deleteme             
        └─ azure-native:dbforpostgresql:Server            deleteme             
 -         └─ azure-native:dbforpostgresql:Configuration  deleteme  delete     

Resources:
    - 1 to delete
    3 unchanged

Do you want to perform this update? yes
Updating (dev):
     Type                                                 Name      Status                  Info
     pulumi:pulumi:Stack                                  bugs-dev  **failed**              1 error
     └─ azure-native:resources:ResourceGroup              deleteme                          
        └─ azure-native:dbforpostgresql:Server            deleteme                          
 -         └─ azure-native:dbforpostgresql:Configuration  deleteme  **deleting failed**     1 error

Diagnostics:
  azure-native:dbforpostgresql:Configuration (deleteme):
    error: Code="InternalServerError" Message="An unexpected error occured while processing the request. Tracking ID: '38555a33-74b0-4a0c-86ad-34b644d0ee0f'"

  pulumi:pulumi:Stack (bugs-dev):
    error: update failed

Resources:
    3 unchanged

Duration: 7m42s

The same also happens when running pulumi destroy.

Output of pulumi about

root@c38eaf6a2211:/dev/workspace/pulumi/bugs# pulumi about
CLI          
Version      3.127.0
Go Version   go1.22.5
Go Compiler  gc

Plugins
KIND      NAME    VERSION
language  nodejs  unknown

Host     
OS       debian
Version  12.6
Arch     x86_64

This project is written in nodejs: executable='/usr/local/bin/node' version='v20.16.0'

Current Stack: organization/bugs/dev

TYPE                                        URN
pulumi:pulumi:Stack                         urn:pulumi:dev::bugs::pulumi:pulumi:Stack::bugs-dev
pulumi:providers:azure-native               urn:pulumi:dev::bugs::pulumi:providers:azure-native::default_2_45_0
azure-native:resources:ResourceGroup        urn:pulumi:dev::bugs::azure-native:resources:ResourceGroup::deleteme
azure-native:dbforpostgresql:Server         urn:pulumi:dev::bugs::azure-native:resources:ResourceGroup$azure-native:dbforpostgresql:Server::deleteme
azure-native:dbforpostgresql:Configuration  urn:pulumi:dev::bugs::azure-native:resources:ResourceGroup$azure-native:dbforpostgresql:Server$azure-native:dbforpostgresql:Configuration::deleteme


Found no pending operations associated with dev

Backend        
Name           c38eaf6a2211
URL            azblob://pulumi-state?storage_account=plmiprodst6fe3d9bd
User           root
Organizations  
Token type     personal

Pulumi locates its logs in /tmp by default

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you’ve opened one already).

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 3
  • Comments: 15 (9 by maintainers)

Most upvoted comments

This issue has been addressed in PR #3752 and shipped in release v2.76.0.

The Azure docs state

If you want to reset the value of a parameter, you simply choose to leave out the optional --value parameter, and the service applies the default value.

The Pulumi provider does that (not sending a value on reset of the property), but it made me wonder whether the provider maybe shouldn’t send {"source":"system-default"} either. So I tried that locally but got the same InternalServerError.

I tried both sending {} and {"properties": {}}, same result.

At this point I think there might be an Azure server-side issue here. The only thing I haven’t tried yet is following the cli instructions I linked above and checking whether that works and, if yes, what request it sends.