IRL2 / SubtleGame

A psychophysics game for interactive molecular dynamics
Other
1 stars 0 forks source link

http error: "stream error received: stream no longer needed" #200

Closed rhoslynroebuck closed 3 months ago

rhoslynroebuck commented 4 months ago

I just tried running SubtleGame with a recording of the buckyballs simulations (instead of a live simulation) for the trials task and received the error below. @Ragzouken jonathan said this might be with the http handler

HttpRequestException: http2 error: stream error received: stream no longer needed Cysharp.Net.Http.ResponseContext.GetResponseAsync () (at ./Library/PackageCache/com.cysharp.yetanotherhttphandler@37998fea90/ResponseContext.cs:165) Cysharp.Net.Http.NativeHttpHandlerCore.SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) (at ./Library/PackageCache/com.cysharp.yetanotherhttphandler@37998fea90/NativeHttpHandlerCore.cs:180) Cysharp.Net.Http.YetAnotherHttpHandler.SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) (at ./Library/PackageCache/com.cysharp.yetanotherhttphandler@37998fea90/YetAnotherHttpHandler.cs:160) Grpc.Net.Client.Internal.GrpcCall2[TRequest,TResponse].RunCall (System.Net.Http.HttpRequestMessage request, System.Nullable1[T] timeout) (at <6a01c03706164f53b83767284ab52486>:0) Rethrow as RpcException: Status(StatusCode="Internal", Detail="Error starting gRPC call. HttpRequestException: http2 error: stream error received: stream no longer needed", DebugException="System.Net.Http.HttpRequestException: http2 error: stream error received: stream no longer needed") Nanover.Grpc.Multiplayer.MultiplayerClient.UpdateState (System.String token, System.Collections.Generic.Dictionary2[TKey,TValue] updates, System.Collections.Generic.List1[T] removals) (at Assets/Plugins/Nanover/Grpc/Multiplayer/MultiplayerClient.cs:55) Nanover.Core.Async.TaskExtensions.AwaitInBackgroundIgnoreCancellation (System.Threading.Tasks.Task task) (at Assets/Plugins/Nanover/Core/Async/TaskExtensions.cs:39) System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) (at <b89873cb176e44a995a4781c7487d410>:0) UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at <10871f9e312b442cb78b9b97db88fdcb>:0) UnityEngine.UnitySynchronizationContext.Exec () (at <10871f9e312b442cb78b9b97db88fdcb>:0) UnityEngine.UnitySynchronizationContext.ExecuteTasks () (at <10871f9e312b442cb78b9b97db88fdcb>:0)

rhoslynroebuck commented 4 months ago

This is happening inconsistently so it's hard to pin down what the cause is. This has happened when both the traj + state are loaded, and when only the traj is loaded onto the server. But not every time sometimes there is no http error, but the player does not update the shared state properly, e.g. when they click 'start task' for the Trials, the 'Player.TaskStatus' key is not updated. However, this seems to work fine for the nanotube task (which uses a live sim, not a recording).

rhoslynroebuck commented 4 months ago

when changing to recording:

thread 'tokio-runtime-worker' panicked at nanover-rs\src\tracked_simulation\replay.rs:95:14:
Could not lock the scene: KeyLocked
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'tokio-runtime-worker' panicked at nanover-rs\src\services\state.rs:117:58:
called `Result::unwrap()` on an `Err` value: PoisonError { .. }
rhoslynroebuck commented 4 months ago

Summary of testing: When the box is placed in front of the player, it does it with a lock. This lock doesn't get released (a bug that is already fixed in the latest Rust server, https://github.com/IRL2/nanover-rs/pull/221)). I will try to build the latest Rust server, and Mark will work on implementing a way of moving the simulation box without a lock, since it is unnecessary in this case and is causing problems.

rhoslynroebuck commented 3 months ago

Fixed with #237.