HTTP 500 Error & status":405,"error":"Method Not Allowed when updating TKGI cluster tags via REST API
search cancel

HTTP 500 Error & status":405,"error":"Method Not Allowed when updating TKGI cluster tags via REST API

book

Article ID: 441882

calendar_today

Updated On:

Products

VMware Tanzu Kubernetes Grid Integrated Edition

Issue/Introduction

Users attempting to update cluster tags in VMware Tanzu Kubernetes Grid Integrated Edition (TKGI) via REST API receive an HTTP 500 Internal Server Error & status":405,"error":"Method Not Allowed. This occurs even when the user has successfully generated an authentication token and can retrieve tags using a GET request.

 

  • curl -v -s -k -H "Authorization: Bearer $AUTH_TOKEN" -H 'accept: application/json' -X GET https://${TKGI_ENDPOINT}:9021/v1/clusters/${TKGI_CLUSTER_NAME} | jq  ".parameters.cluster_tags" > $BACKUP_FILE_NAME

 

curl  -H "Authorization: Bearer $AUTH_TOKEN" -H "Content-Type: application/json" -d @tags.json -X PATH https://${TKGI_ENDPOINT}:9021/v1/clusters/${TKGI_CLUSTER_NAME} 


<!doctype html><html lang="en"><head><title>HTTP Status 500 – Internal Server Error</title><style>


 

curl  -H "Authorization: Bearer $AUTH_TOKEN" -H "Content-Type: application/json" -d @tags.json -X PUT https://${TKGI_ENDPOINT}:9021/v1/clusters/${TKGI_CLUSTER_NAME} 

{"timestamp":"2026-06-03T09:22:42.903+00:00","status":405,"error":"Method Not Allowed","path":"/v1/clusters/test"}

 

 

Environment

VMware Tanzu Kubernetes Grid Integrated Edition (TKGI)

Cause

The issue is caused by using unsupported HTTP methods such as PUT, POST, or PATH for updating cluster tags. 

Resolution

The TKGI API specifically requires the PATCH method for this operation. User need to run the below commands to update the tags.

 

curl -X PATCH "https://${TKGI_ENDPOINT}:9021/v1/clusters/${TKGI_CLUSTER_NAME}" \
     -H "Accept: application/json" \
     -H "Content-Type: application/json" \
     -k \
     -H "Authorization: Bearer $my_token" \
     -d '{
       "cluster_tags": [
         {
           "name": "user",
           "value": "test",
           "category": null
         },
         {
           "name": "env",
           "value": "production",
           "category": null
         },
         {
           "name": "managerUrl",
           "value": "https://${nsxmgrx}:443",
           "category": null
         }
       ],
       "delete_all_tags": false
     }'

 

Additional Information

Authentication of TKGI API requests

Authenticate with UAA to get AUTH_TOKEN