...
Deleting a machine prefix via rest api fails with a 400 bad request error.The /var/log/vmware/vcac/catalina.out logfile displays an error similar to:[UTC:2019-08-16 12:44:19,913 Local:2019-08-16 12:44:19,913] vcac: [component="cafe:iaas-proxy" priority="ERROR" thread="tomcat-http--7" tenant="vsphere.local" context="CFSxB0Yz" parent="" token="CFSxB0Yz"] com.vmware.vcac.platform.service.rest.resolver.ApplicationExceptionHandler.handleUnexpectedException:872 - HTTP/1.1 400 Bad Request : Syntax error at position 28 in 'HostnamePrefixID eq 118714cc-7ec5-4ed5-b14f-88521bbb3248'.Syntax error at position 28 in 'HostnamePrefixID eq 118714cc-7ec5-4ed5-b14f-88521bbb3248'.Microsoft.Data.OData.ODataException at Microsoft.Data.OData.Query.ExpressionLexer.ValidateToken(ExpressionTokenKind t) at Microsoft.Data.OData.Query.UriQueryExpressionParser.ParseFilter(String filter) at Microsoft.Data.OData.Query.ODataUriParser.ParseFilterImplementation(String filter, IEdmType elementType, IEdmEntitySet entitySet) at System.Data.Services.Parsing.RequestExpressionParser.ParseFilter()org.odata4j.exceptions.BadRequestException: HTTP/1.1 400 Bad Request : Syntax error at position 28 in 'HostnamePrefixID eq 118714cc-7ec5-4ed5-b14f-88521bbb3248'.Syntax error at position 28 in 'HostnamePrefixID eq 118714cc-7ec5-4ed5-b14f-88521bbb3248'.Microsoft.Data.OData.ODataException at Microsoft.Data.OData.Query.ExpressionLexer.ValidateToken(ExpressionTokenKind t) at Microsoft.Data.OData.Query.UriQueryExpressionParser.ParseFilter(String filter) at Microsoft.Data.OData.Query.ODataUriParser.ParseFilterImplementation(String filter, IEdmType elementType, IEdmEntitySetentitySet)
The code should convert the machine prefix ID to a GUID before being passed to IaaS, but that does not happen, and thus we get the OData error. We perform that conversion in other API calls, so this is an inconsistency the API.
To resolve the issue the ID part of the request can be wrapped in the OData guid syntax of guid'dddddddd-dddd-dddd-dddd-dddddddddddd'For example, this query will allow the delete to execute successfully:/iaas-proxy-provider/api/machine-prefixes/guid'A88983A0-45E4-4962-A12A-C01D3F627E59'
Click on a version to see all relevant bugs
VMware Integration
Learn more about where this data comes from
Bug Scrub Advisor
Streamline upgrades with automated vendor bug scrubs
BugZero Enterprise
Wish you caught this bug sooner? Get proactive today.