Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] API returns error when updating existing mongo cluster #31377

Open
sinbai opened this issue Nov 1, 2024 · 1 comment
Open

[BUG] API returns error when updating existing mongo cluster #31377

sinbai opened this issue Nov 1, 2024 · 1 comment
Assignees
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@sinbai
Copy link

sinbai commented Nov 1, 2024

API Spec link

https://github.com/Azure/azure-rest-api-specs/blob/main/specification/mongocluster/resource-manager/Microsoft.DocumentDB/stable/2024-07-01/mongoCluster.json#L279

API Spec version

2024-07-01

Describe the bug

When updating an existing mongocluster through the MongoClusters_CreateOrUpdate API using the response returned by the MongoClusters_Get API, an error was received, the update operation failed.

Expected behavior

Update should succeed. The API shouldn't care if this is set (like most of the other Azure APIs).

Actual behavior

Update failed, the API returns the following error.

{"error":{"code":"bad_request","message":"Found schema errors for api-version 2024-07-01. Errors: The property '#/systemData' of type null did not match the following type: object in schema 25debcc2-6915-5536-9566-a2ecd765b755"}}

Reproduction Steps

  • Step1: Get an existing mongocluster which compute tier is free.
GET /subscriptions/.../resourceGroups/acctestRG-241101100238280187/providers/Microsoft.DocumentDB/mongoClusters/acctest-mc241101100238280187?api-version=2024-07-01 HTTP/1.1
X-Ms-Correlation-Request-Id: 95471b42-6c6b-a3e0-af45-b43d8cc12b27


AzureRM Response:
HTTP/2.0 200 OK
Date: Fri, 01 Nov 2024 02:12:58 GMT
X-Ms-Correlation-Request-Id: 95471b42-6c6b-a3e0-af45-b43d8cc12b27

{
  "id": "/subscriptions/.../resourceGroups/acctestRG-241101100238280187/providers/Microsoft.DocumentDB/mongoClusters/acctest-mc241101100238280187",
  "name": "acctest-mc241101100238280187",
  "type": "Microsoft.DocumentDB/mongoClusters",
  "tags": {
  },
  "location": "eastus",
  "systemData": {
    "createdAt": "2024-11-01T02:03:51.3222716Z",
    "createdBy": "e0228b2d-03d1-4463-b866-a871d418a0be",
    "createdByType": "Application",
    "lastModifiedAt": "2024-11-01T02:03:51.3222716Z",
    "lastModifiedBy": "e0228b2d-03d1-4463-b866-a871d418a0be",
    "lastModifiedByType": "Application"
  },
  "properties": {
    "provisioningState": "Succeeded",
    "clusterStatus": "Ready",
    "administrator": {
      "userName": "admintest"
    },
    "serverVersion": "6.0",
    "compute": {
      "tier": "Free"
    },
    "storage": {
      "sizeGb": 32
    },
    "sharding": {
      "shardCount": 1
    },
    "highAvailability": {
      "targetMode": "Disabled"
    },
    "connectionString": "mongodb+srv://<user>:<password>@acctest-mc241101100238280187.mongocluster.cosmos.azure.com/?tls=true&authMechanism=SCRAM-SHA-256&retrywrites=false&maxIdleTimeMS=120000",
    "backup": {
    },
    "privateEndpointConnections": [

    ],
    "publicNetworkAccess": "Enabled",
    "infrastructureVersion": "1.0"
  }
}
  • Step2: Using the data response in Step 1, update only the compute tier from free to M30 .
PUT /subscriptions/.../resourceGroups/acctestRG-241101100238280187/providers/Microsoft.DocumentDB/mongoClusters/acctest-mc241101100238280187?api-version=2024-07-01 HTTP/1.1
X-Ms-Correlation-Request-Id: 95471b42-6c6b-a3e0-af45-b43d8cc12b27

{
   "id":"/subscriptions/.../resourceGroups/acctestRG-241101100238280187/providers/Microsoft.DocumentDB/mongoClusters/acctest-mc241101100238280187",
   "location":"eastus",
   "name":"acctest-mc241101100238280187",
   "properties":{
      "administrator":{
         "userName":"adminTest"
      },
      "backup":{
         
      },
      "clusterStatus":"Ready",
      "compute":{
         "tier":"M30"
      },
      "connectionString":"mongodb+srv://\u003cuser\u003e:\u003cpassword\[email protected]/?tls=true\u0026authMechanism=SCRAM-SHA-256\u0026retrywrites=false\u0026maxIdleTimeMS=120000",
      "highAvailability":{
         "targetMode":"Disabled"
      },
      "infrastructureVersion":"1.0",
      "privateEndpointConnections":[
         
      ],
      "provisioningState":"Succeeded",
      "publicNetworkAccess":"Enabled",
      "serverVersion":"6.0",
      "sharding":{
         "shardCount":1
      },
      "storage":{
         "sizeGb":32
      }
   },
   "systemData":null,
   "tags":{
      
   },
   "type":"Microsoft.DocumentDB/mongoClusters"
}

AzureRM Response:
HTTP/2.0 400 Bad Request
Date: Fri, 01 Nov 2024 02:13:01 GMT
X-Ms-Correlation-Request-Id: 95471b42-6c6b-a3e0-af45-b43d8cc12b27


{"error":{"code":"bad_request","message":"Found schema errors for api-version 2024-07-01. Errors: The property '#/systemData' of type null did not match the following type: object in schema 25debcc2-6915-5536-9566-a2ecd765b755"}}


Environment

No response

@sinbai sinbai added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Nov 1, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added question The issue doesn't require a change to the product in order to be resolved. Most issues start as that customer-reported Issues that are reported by GitHub users external to the Azure organization. labels Nov 1, 2024
@v-jiaodi v-jiaodi added the Mgmt This issue is related to a management-plane library. label Nov 1, 2024
@v-jiaodi
Copy link
Member

v-jiaodi commented Nov 1, 2024

@olivertowers Please help take a look, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

3 participants