Exception thrown when calling ReadyServerForPlayersAsync with Multiplay 1.0.4 package

I’m getting a serialization error when calling this method after server has been allocated:
MultiplayService.Instance.ReadyServerForPlayersAsync()

This did not happen in 1.0.0-pre.9. I’m using Multiplay 1.0.4 package with Matchmaking.

Stack trace:
Unity.Services.Multiplay.Http.ResponseDeserializationException: Value cannot be null.
Parameter name: s —> System.ArgumentNullException: Value cannot be null.
Parameter name: s
at System.IO.StringReader…ctor (System.String s) [0x00009] in <4d56092c9a8849cab50a947b257065a3>:0
at (wrapper remoting-invoke-with-check) System.IO.StringReader…ctor(string)
at Unity.Services.Multiplay.Http.IsolatedJsonConvert.DeserializeObject (System.String value, System.Type type, Newtonsoft.Json.JsonSerializerSettings settings) [0x00007] in <36b9d87424c14cd4ae0be3147b90d289>:0
at Unity.Services.Multiplay.Http.IsolatedJsonConvert.DeserializeObject[T] (System.String value, Newtonsoft.Json.JsonSerializerSettings settings) [0x00000] in <36b9d87424c14cd4ae0be3147b90d289>:0
at Unity.Services.Multiplay.Http.ResponseHandler.TryDeserializeResponse[T] (Unity.Services.Multiplay.Http.HttpClientResponse response) [0x0001f] in <36b9d87424c14cd4ae0be3147b90d289>:0
— End of inner exception stack trace —
at Unity.Services.Multiplay.Http.ResponseHandler.TryDeserializeResponse[T] (Unity.Services.Multiplay.Http.HttpClientResponse response) [0x00036] in <36b9d87424c14cd4ae0be3147b90d289>:0
at Unity.Services.Multiplay.Http.ResponseHandler.HandleAsyncResponse[T] (Unity.Services.Multiplay.Http.HttpClientResponse response, System.Collections.Generic.Dictionary`2[TKey,TValue] statusCodeToTypeMap) [0x000e1] in <36b9d87424c14cd4ae0be3147b90d289>:0
at Unity.Services.Multiplay.Apis.GameServer.GameServerApiClient.ReadyServerAsync (Unity.Services.Multiplay.GameServer.ReadyServerRequest request, Unity.Services.Multiplay.Configuration operationConfiguration) [0x0011f] in <36b9d87424c14cd4ae0be3147b90d289>:0
at Unity.Services.Multiplay.Internal.WrappedMultiplayService.ReadyServerForPlayersAsync () [0x000d7] in <36b9d87424c14cd4ae0be3147b90d289>:0

2 Likes

//Here is my stack trace. pretty similar to yours I’m also on version 1.0.4.

DEDICATED_SERVER CHARACTER SELECT
ReadyServerForPlayersAsync
Unloading 18 unused Assets to reduce memory usage. Loaded Objects now: 3344.
Total: 5.937589 ms (FindLiveObjects: 0.190790 ms CreateObjectMapping: 0.171029 ms MarkObjects: 5.464814 ms DeleteObjects: 0.110351 ms)
ArgumentNullException: Value cannot be null.
Parameter name: s
at System.IO.StringReader…ctor (System.String s) [0x00009] in <6a7073c34fd84694af6ceb3e0d94723f>:0
at (wrapper remoting-invoke-with-check) System.IO.StringReader…ctor(string)
at Unity.Services.Multiplay.Http.IsolatedJsonConvert.DeserializeObject (System.String value, System.Type type, Newtonsoft.Json.JsonSerializerSettings settings) [0x00007] in <16bc70132e78455e91d545a8a968b91f>:0
at Unity.Services.Multiplay.Http.IsolatedJsonConvert.DeserializeObject[T] (System.String value, Newtonsoft.Json.JsonSerializerSettings settings) [0x00000] in <16bc70132e78455e91d545a8a968b91f>:0
at Unity.Services.Multiplay.Http.ResponseHandler.TryDeserializeResponse[T] (Unity.Services.Multiplay.Http.HttpClientResponse response) [0x0001f] in <16bc70132e78455e91d545a8a968b91f>:0
Rethrow as ResponseDeserializationException: Value cannot be null.
Parameter name: s
at Unity.Services.Multiplay.Http.ResponseHandler.TryDeserializeResponse[T] (Unity.Services.Multiplay.Http.HttpClientResponse response) [0x00036] in <16bc70132e78455e91d545a8a968b91f>:0
at Unity.Services.Multiplay.Http.ResponseHandler.HandleAsyncResponse[T] (Unity.Services.Multiplay.Http.HttpClientResponse response, System.Collections.Generic.Dictionary`2[TKey,TValue] statusCodeToTypeMap) [0x000e1] in <16bc70132e78455e91d545a8a968b91f>:0
at Unity.Services.Multiplay.Apis.GameServer.GameServerApiClient.ReadyServerAsync (Unity.Services.Multiplay.GameServer.ReadyServerRequest request, Unity.Services.Multiplay.Configuration operationConfiguration) [0x0011f] in <16bc70132e78455e91d545a8a968b91f>:0
at Unity.Services.Multiplay.Internal.WrappedMultiplayService.ReadyServerForPlayersAsync () [0x000d7] in <16bc70132e78455e91d545a8a968b91f>:0
at CharacterSelectReady.Start () [0x00073] in <028fd712e4084c83a5b93542dea3550e>:0
at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.b__7_0 (System.Object state) [0x00000] in <6a7073c34fd84694af6ceb3e0d94723f>:0
at UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () [0x00002] in <8382331eb16a45de892e077c2a31245f>:0
at UnityEngine.UnitySynchronizationContext.Exec () [0x0005d] in <8382331eb16a45de892e077c2a31245f>:0
at UnityEngine.UnitySynchronizationContext.ExecuteTasks () [0x00014] in <8382331eb16a45de892e077c2a31245f>:0
DEDICATED_SERVER MultiplayEventCallbacks_Allocate
Already auto allocated!

I’ve the same exception when running the build on a test allocation. My logs is similar to @earthcrosser .

Edit : tried to update to 23.3f1, but the bug is still occurring (rolled back to 22.18 now). I’m unable to test a server build right now, there is no workaround …

Hi just curious what are the build settings that you are using. I’ve tried Dedicated Server and linux build but I’m not sure what to choose in project settings. I have ILCPP and and .NET Standard 2.1 chosen in player setting configuration right now. I can’t seem to find a straight answer on what those should be.

I’m building to Linux Dedicated, with Mono and .Net Standard 2.1. I don’t think the build settings are the cause, because the build starts correctly on Multiplay. It’s just the call to “ReadyServerForPlayersAsync()” that fails.

I’ve looked a bit into the methods call from the error callstack, it’s looks like the method expect a JSON response after an HTTP request, but it gets nothing; an empty byte array, which will returns a null string object that is then passed to a StringReader … And it doesn’t like empty string.

So I guess there a deeper issue with the Multiplay SDK / Services, I don’t think it is normal that the service returns an empty response …

@BSimonSweet @lsaeteurn well I uninstalled the package com.unity.services.multiplay and then re-installed but I set the version to 1.0.3 and the problem went away. (sheesh what a pain). Anyway hope this works for you all as well.

1 Like

Having exactly the same error here, same logs. Anybody has finally found a workaround or solution?

What version of the package do you have installed? My solution was to go to version 1.0.3.

I downgraded to 1.0.3 but still facing the exception :frowning:

This solution works for me. I’ll keep working with version 1.0.3, but Unity needs to fix the bug on 1.0.4.

Any news on this thread? I’m still encountering the issue with 1.0.3

I did same but now I’m encountering error at GetPayload Async, which package version do you use for Matchmaker?

It’s working for me after downgrading to version: 1.0.0-pre.10

I’m not using Matchmaker right now, but will later. And I’ve not yet used the GetPlayloadAsync method, so I can not help you :confused:

How did you change the version? It is not published on the package manager…

You can do that manually in the manifest.json file of your project.

9097111--1260676--upload_2023-6-22_11-58-57.png

I also get the same error, so I just don’t call the function. It doesn’t seem to be called in example projects either, so I’m not totally sure what it does. Players still get allocated and connect instantly via matchmaker.

The issue is fixed in v1.0.5: Changelog | Multiplay | 1.0.5

3 Likes

Thanks for that update @spikyworm5