Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug [Matchmaker]: BadRequest: (21400). Message: (400) HTTP/1.1 400 Bad Reque

Discussion in 'Matchmaker' started by kirkokuev, Aug 28, 2023.

  1. kirkokuev

    kirkokuev

    Joined:
    Aug 9, 2014
    Posts:
    15
    Hello, we are facing the following problem:

    we have made a server for multiplayer game, based on Fusion BR200 example (the code for matchmaking and backfilling is untouched, and taken from the example). Configuration for the multiplay was taken from the Fusion BR200 cookbook
    https://doc.photonengine.com/docs/c...tiplay-integration-documentation-by-unity.pdf

    And now we are experiencing the error in the title. When multiple clients are trying to join the game we are seeing following lines in server log


    Roster changed, updating backfill 29a69733-0aa3-42db-8d8b-ac3bb950b457
    NetworkApplication.<UpdateBackfill>d__24:MoveNext()
    System.Runtime.CompilerServices.AsyncTaskMethodBuilder:Start(TStateMachine&)
    NetworkApplication.Backfill:UpdateBackfill()
    NetworkApplication.<OnTick>d__23:MoveNext()
    System.Runtime.CompilerServices.AsyncVoidMethodBuilder:Start(TStateMachine&)
    NetworkApplication.Backfill:OnTick()
    NetworkApplication.Scene:OnTick()
    [Matchmaker]: BadRequest (21400). Message: (400) HTTP/1.1 400 Bad Request
    Unity.Services.Matchmaker.WrappedMatchmakerService:ResolveErrorWrapping(MatchmakerExceptionReason, Exception)
    Unity.Services.Matchmaker.<TryCatchRequest>d__13`1:MoveNext()
    System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)
    System.Runtime.CompilerServices.MoveNextRunner:Run()
    System.Threading.Tasks.AwaitTaskContinuation:RunCallback(ContextCallback, Object, Task&)
    System.Threading.Tasks.Task:FinishContinuations()
    System.Threading.Tasks.Task:TrySetException(Object)
    System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:SetException(Exception)
    Unity.Services.Matchmaker.Apis.Backfill.<UpdateBackfillTicketAsync>d__10:MoveNext()
    System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)
    System.Runtime.CompilerServices.MoveNextRunner:Run()
    System.Threading.Tasks.AwaitTaskContinuation:RunCallback(ContextCallback, Object, Task&)
    System.Threading.Tasks.Task:FinishContinuations()
    System.Threading.Tasks.Task`1:TrySetResult(TResult)
    System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:SetResult(TResult)
    Unity.Services.Matchmaker.Http.<MakeRequestAsync>d__1:MoveNext()
    System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)
    System.Runtime.CompilerServices.MoveNextRunner:Run()
    System.Threading.Tasks.AwaitTaskContinuation:RunCallback(ContextCallback, Object, Task&)
    System.Threading.Tasks.Task:FinishContinuations()
    System.Threading.Tasks.Task`1:TrySetResult(TResult)
    System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:SetResult(TResult)
    Unity.Services.Matchmaker.Http.<CreateWebRequestAsync>d__3:MoveNext()
    System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)
    System.Runtime.CompilerServices.MoveNextRunner:Run()
    System.Threading.Tasks.AwaitTaskContinuation:RunCallback(ContextCallback, Object, Task&)
    System.Threading.Tasks.Task:FinishContinuations()
    System.Threading.Tasks.Task`1:TrySetResult(TResult)
    System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:SetResult(TResult)
    Unity.Services.Matchmaker.Http.<CreateHttpClientResponse>d__4:MoveNext()
    System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)
    System.Runtime.CompilerServices.MoveNextRunner:Run()
    System.Threading.Tasks.AwaitTaskContinuation:RunCallback(ContextCallback, Object, Task&)
    System.Threading.Tasks.Task:FinishContinuations()
    System.Threading.Tasks.Task`1:TrySetResult(TResult)
    System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:SetResult(TResult)
    Unity.Services.Matchmaker.Http.<<CreateHttpClientResponse>b__0>d:MoveNext()
    System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)
    System.Runtime.CompilerServices.MoveNextRunner:Run()
    System.Threading.Tasks.AwaitTaskContinuation:RunCallback(ContextCallback, Object, Task&)
    System.Threading.Tasks.Task:FinishContinuations()
    System.Threading.Tasks.Task`1:TrySetResult(TResult)
    System.Threading.Tasks.TaskCompletionSource`1:TrySetResult(TResult)
    System.Threading.Tasks.TaskCompletionSource`1:SetResult(TResult)
    UnityEngine.AsyncOperation:InvokeCompletionEvent()


    Along with these errors we see following behaviour on the clients.
    First 1-2 of the clients can succesfully join the server, while all of the next clients will receive failed matchmaking tickets with reason "maximum capacity reached", even though we have 200 maximum players enabled on the server. If we have more than 1 server enabled on the multiplay, the clients are being spawned on another allocated server.

    As far I understood this happens when we try to update the backfill ticket, the request seems to be broken Since we were not modifying the code from the BR200 example I wonder what can be causing this error, did the backend part changed since the BR200 and if so, what changes need to be made to the client code to make correct request?
     
    Filip8429 likes this.