azure-devops-java-sdk icon indicating copy to clipboard operation
azure-devops-java-sdk copied to clipboard

Can't get pipeline approvals when using DeploymentsRequestBuilder

Open tomaszburzynski88 opened this issue 9 months ago • 5 comments

Hi I am getting error during trying to get approvals.

Caused by: org.azd.exceptions.AzDException: ApiResponseParsingException: Unexpected character ('<' (code 60)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false') at [Source: REDACTED (StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION disabled); line: 1, column: 1] at org.azd.abstractions.serializer.JsonSerializer.deserialize(JsonSerializer.java:78) ~[azd-6.0.2.jar:na] at org.azd.abstractions.internals.ClientRequestAdapter.execute(ClientRequestAdapter.java:136) ~[azd-6.0.2.jar:na] at org.azd.release.deployments.DeploymentsRequestBuilder.list(DeploymentsRequestBuilder.java:65) ~[azd-6.0.2.jar:na]

tomaszburzynski88 avatar Apr 09 '25 16:04 tomaszburzynski88

Hi @tomaszburzynski88, Can you please share the raw response from Api? In the catch block call ResponseHandler.getResponse() this returns the raw response.

hkarthik7 avatar Apr 09 '25 17:04 hkarthik7

Hi @hkarthik7, I have the kind of issues by using version 6.0.2 with a different API call: client.git().repositories().git(repository)

The raw response is an HTML with: title (redacted) = The controller for path &#39;/redacted/_apis/git/repositories/redacted&#39; was not found or does not implement IController and part of the body:

  <div class="title">404 - Page not found</div>
  <div class="details">Looks like this page doesn't exist or can't be found. Make sure the URL is correct.</div>

The called URL is (redacted): https://dev.azure.com/redacted/redacted/_apis/git/repositories/redacted?api-version=7.1-preview.2

By using a curl, I have the same result.

But it works by changing the api-version to:

c4rth avatar Apr 13 '25 13:04 c4rth

After more tests for repositories and repository:

No issues with AzDClientApi.

The errors occur with AzDServiceClient.

c4rth avatar Apr 13 '25 14:04 c4rth

@c4rth, Thanks for raising this, I've opened a new issue #85 which will be fixed in next version.

hkarthik7 avatar Apr 16 '25 04:04 hkarthik7

@tomaszburzynski88, The fix is applied in v6.0.3.

hkarthik7 avatar May 06 '25 05:05 hkarthik7