terraform-ibm-modules / terraform-ibm-icd-postgresql

Implements an instance of the IBM Cloud Databases for PostgreSQL service.
Apache License 2.0
0 stars 2 forks source link

Incorrect value being used for wal_level configuration #512

Closed ocofaigh closed 3 weeks ago

ocofaigh commented 3 weeks ago

In https://github.com/terraform-ibm-modules/terraform-ibm-icd-postgresql/pull/508 an update was made in the DA (and complete example) to change the value of the wal_level configuration from hot_standby to replica. The PR was force merged, to get a fix for another hot issue in, however the PR tests actually failed with this error:

Error: [0m Error: [ERROR] Error updating database configuration failed Unprocessable Entity
│ {
│     "StatusCode": 422,
│     "Headers": {
│         "Cache-Control": [
│             "no-store"
│         ],
│         "Cf-Cache-Status": [
│             "DYNAMIC"
│         ],
│         "Cf-Ray": [
│             "8dddfa94e9dc6075-ORD"
│         ],
│         "Content-Security-Policy": [
│             "frame-ancestors *.bluemix.net *.compose.fastkit *.cloud.ibm.com cloud.ibm.com"
│         ],
│         "Content-Type": [
│             "application/json; charset=utf-8"
│         ],
│         "Date": [
│             "Tue, 05 Nov 2024 15:46:50 GMT"
│         ],
│         "Referrer-Policy": [
│             "strict-origin-when-cross-origin"
│         ],
│         "Server": [
│             "cloudflare"
│         ],
│         "Strict-Transport-Security": [
│             "max-age=63072000; includeSubDomains"
│         ],
│         "X-Content-Type-Options": [
│             "nosniff"
│         ],
│         "X-Download-Options": [
│             "noopen"
│         ],
│         "X-Envoy-Upstream-Service-Time": [
│             "412"
│         ],
│         "X-Permitted-Cross-Domain-Policies": [
│             "none"
│         ],
│         "X-Request-Id": [
│             "3b44c6aa-c575-4ac6-b668-d2e959ff33c4"
│         ],
│         "X-Runtime": [
│             "0.409703"
│         ],
│         "X-Xss-Protection": [
│             "0"
│         ]
│     },
│     "Result": {
│         "errors": {
│             "configuration.wal_level": [
│                 "must be one of: hot_standby, logical"
│             ]
│         }
│     },
│     "RawResult": null
│ }
│ 
│ 
│   with module.postgresql_db.module.postgresql_db.ibm_database.postgresql_db,
│   on ../../main.tf line 55, in resource "ibm_database" "postgresql_db":
│   55: resource "ibm_database" "postgresql_db" {
│ 
╵}

We need to revert that change

ocofaigh commented 3 weeks ago

ICD confirmed there is a backend schema bug here. They advised us to leave out the wal_level setting meaning it will default to replica

ocofaigh commented 3 weeks ago

Fixed in https://github.com/terraform-ibm-modules/terraform-ibm-icd-postgresql/releases/tag/v3.17.11