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] Maps Routing batch response being truncated #47707

Open
patrickhacens opened this issue Jan 3, 2025 · 1 comment
Open

[BUG] Maps Routing batch response being truncated #47707

patrickhacens opened this issue Jan 3, 2025 · 1 comment
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. Maps needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.

Comments

@patrickhacens
Copy link

Library name and version

Azure.Maps.Routing 1.0.0-beta.4

Describe the bug

Big responses returned through the GetRouteDirectionsBatchAsync method gets truncated

Expected behavior

The method to return data and be deserialized into Response<RouteDirectionsBatchResult>

Actual behavior

Exception being thrown

System.Text.Json.JsonReaderException: 'Expected depth to be zero at the end of the JSON payload. There is an open JSON object or array that should be closed. LineNumber: 0 | BytePositionInLine: 3123601.'

   at System.Text.Json.ThrowHelper.ThrowJsonReaderException(Utf8JsonReader& json, ExceptionResource resource, Byte nextByte, ReadOnlySpan`1 bytes)
   at System.Text.Json.Utf8JsonReader.ReadSingleSegment()
   at System.Text.Json.Utf8JsonReader.Read()
   at System.Text.Json.JsonDocument.Parse(ReadOnlySpan`1 utf8JsonSpan, JsonReaderOptions readerOptions, MetadataDb& database, StackRowStack& stack)
   at System.Text.Json.JsonDocument.Parse(ReadOnlyMemory`1 utf8Json, JsonReaderOptions readerOptions, Byte[] extraRentedArrayPoolBytes, PooledByteBufferWriter extraPooledByteBufferWriter)
   at System.Text.Json.JsonDocument.Parse(ReadOnlyMemory`1 json, JsonDocumentOptions options)
   at System.Text.Json.JsonDocument.Parse(String json, JsonDocumentOptions options)
   at Azure.Maps.Routing.Models.GetDirectionsOperation.<WaitForCompletionAsync>d__19.MoveNext() in C:\Users\patri\source\repos\azure-sdk-for-net\sdk\maps\Azure.Maps.Routing\src\Models\Operation\GetDirectionsOperation.cs:line 103
   at System.Threading.Tasks.ValueTask`1.get_Result()
   at Azure.Maps.Routing.Models.GetDirectionsOperation.<WaitForCompletionAsync>d__15.MoveNext() in C:\Users\patri\source\repos\azure-sdk-for-net\sdk\maps\Azure.Maps.Routing\src\Models\Operation\GetDirectionsOperation.cs:line 74
   at System.Threading.Tasks.ValueTask`1.get_Result()
   at Azure.Maps.Routing.MapsRoutingClient.<GetDirectionsBatchAsync>d__26.MoveNext() in C:\Users\patri\source\repos\azure-sdk-for-net\sdk\maps\Azure.Maps.Routing\src\MapsRoutingClient.cs:line 905
...

JSON response being truncated

Reproduction Steps

using Azure;
using Azure.Core.GeoJson;
using Azure.Maps.Routing;

AzureKeyCredential credential = new AzureKeyCredential("<credentials>");
MapsRoutingClient routeClient = new(credential);

RouteDirectionOptions azureRouteOptions = new()
{
	TravelMode =  TravelMode.Truck,
	InstructionsType = RouteInstructionsType.Text,
	Language = RoutingLanguage.EnglishUsa,
	UseTrafficData = false,
};

GeoPosition origin = new(-88.3, 41.92);
List<GeoPosition> geoPositions = [
	new(-111.38, 47.65),
	new(-111.34, 47.26),
	new(-111.25, 47.48),
	new(-112.6, 47.58),
	new(-113.37, 48.78),
	new(-110.87, 47.26),
	new(-111.26, 47.53),
	new(-111.57, 48.02),
	new(-113.27, 48.59),
	new(-109.92, 46.8)
];

List<RouteDirectionQuery> queries = [];

foreach (var destination in geoPositions)
{
	queries.Add(new RouteDirectionQuery([
				new GeoPosition(origin.Longitude, origin.Latitude),
				new GeoPosition(destination.Longitude, destination.Latitude)],
				azureRouteOptions));
}


var response = routeClient.GetDirectionsBatch(WaitUntil.Completed, queries);

Environment

VS 17.10.3

.NET SDK:
Version: 8.0.302
Commit: ef14e02af8
Workload version: 8.0.300-manifests.5273bb1c
MSBuild version: 17.10.4+10fbfbf2e

Runtime Environment:
OS Name: Windows
OS Version: 10.0.22631
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\8.0.302\

.NET workloads installed:
[maui-windows]
Installation Source: VS 17.10.35013.160
Manifest Version: 8.0.40/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maui\8.0.40\WorkloadManifest.json
Install Type: FileBased

[maccatalyst]
Installation Source: VS 17.10.35013.160
Manifest Version: 17.2.8053/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maccatalyst\17.2.8053\WorkloadManifest.json
Install Type: FileBased

[ios]
Installation Source: VS 17.10.35013.160
Manifest Version: 17.2.8053/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.ios\17.2.8053\WorkloadManifest.json
Install Type: FileBased

[android]
Installation Source: VS 17.10.35013.160
Manifest Version: 34.0.95/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.android\34.0.95\WorkloadManifest.json
Install Type: FileBased

[wasm-tools-net6]
Installation Source: VS 17.10.35013.160
Manifest Version: 8.0.5/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.workload.mono.toolchain.net6\8.0.5\WorkloadManifest.json
Install Type: FileBased

[wasm-tools]
Installation Source: VS 17.10.35013.160
Manifest Version: 8.0.5/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.workload.mono.toolchain.current\8.0.5\WorkloadManifest.json
Install Type: FileBased

[aspire]
Installation Source: VS 17.10.35013.160
Manifest Version: 8.0.0/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.aspire\8.0.0\WorkloadManifest.json
Install Type: FileBased

Host:
Version: 8.0.6
Architecture: x64
Commit: 3b8b000a0e

.NET SDKs installed:
8.0.302 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.31 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.31 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.31 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
Not set

global.json file:
C:\Users\patri\source\repos\azure-sdk-for-net\global.json

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download

@github-actions github-actions bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Jan 3, 2025
@jsquire jsquire added Service Attention Workflow: This issue is responsible by Azure service team. Client This issue points to a problem in the data-plane of the library. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team Maps and removed needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. labels Jan 4, 2025
Copy link

github-actions bot commented Jan 4, 2025

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @dubiety.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. Maps needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

2 participants