VraGenericRestClient fails with "Illegal character in authority" error post VCF 9.1.0 migration
search cancel

VraGenericRestClient fails with "Illegal character in authority" error post VCF 9.1.0 migration

book

Article ID: 454719

calendar_today

Updated On:

Products

VCF Automation

Issue/Introduction

After migrating to VCF 9.1.0 (vRA 8.18.1 patch 3), workflows utilizing VraGenericRestClient may throw an "Illegal character in authority" error during client.execute(). This issue is specific to the VraGenericRestClient object; standard RESTHost objects and external API tools (e.g., Postman) function correctly.

The following code pattern triggers the error in VCF 9.1.0 environments:

// This pattern fails in VCF 9.1.0
var client = _restHost.createRestClient();
var request = client.createRequest("PATCH", "/iaas/api/machines/uuid-here", payload);
var response = client.execute(request);

Environment

VCF Automation 9.1

Resolution

To resolve this, migrate the workflow to use RESTHost as a stable alternative.

Recommended Workaround (Using RESTHost): Instantiate a standard RESTHost and define the request manually. This avoids the URI parsing logic inherent in the generic client.

// Use this pattern as a stable alternative
var restHost = Server.findForType("REST:RESTHost", "your-rest-host-id");
var request = restHost.createRequest("PATCH", "/iaas/api/machines/uuid-here", JSON.stringify(payload));
request.contentType = "application/json";
var response = request.execute(); // Functional alternative

Verification:

  • Replace the VraGenericRestClient calls with RESTHost calls in your workflow.
  • Ensure the Content-Type header is explicitly set to application/json as shown above.
  • Test the workflow; the "Illegal character in authority" error should no longer occur.