Hello,
I consistently keep getting these errors (though each time) when calling some cloud code functions. It’s not always on a cold start, but it often is.
NoInternetConnection
Request timeout
Also, it seems more likely to happen on lengthier functions, but again, not always.
Further, there are no network issues when it happens.
Lastly, the functions run fine server side.
For instance, below is code to delete a player’s account. The client first awaits a method call to the module that cleans up player data. If that is successful, the client then calls the Authentication service to delete the account.
If I get the error, the player data is still deleted (though usually not the account, just the cleanup) so I’m guessing in this specific instance, it was the CallModuleEndpointAsync call that caused it (though there is no exception caught by the catch block).
Someone posted a similar issue CloudCode: HttpException: (0) Request timeout , but not sure that solution is going to help as the exception is not being caught and it’s just a repeated call (which I don’t want as the method is generally executed server side).
I’ve tried not awaiting the calls, just to see what happens, and I still get the errors (though again, not every time).
I’ve pasted the error log at the end of this post
Client Side
public async Task DeleteAccount()
{
this.LogWarning($"DeleteAccount()");
try
{
bool isSucces =
await CloudCodeService.Instance.CallModuleEndpointAsync<bool>(
CloudCodeModule.WorldOfWords,
ServerFunction.DeletePlayer
);
if (isSucces)
{
await AuthenticationService.Instance.DeleteAccountAsync();
this.Log($"Account successfully deleted.");
}
}
catch (Exception ex)
{
this.LogWarning($"Account Deletion Exception: {ex}");
OnUiMessage?.Invoke("Account Deletion Exception", $"{ex.Message}");
}
}
CloudCode Module
[CloudCodeFunction(ServerFunction.DeletePlayer)]
public async Task<bool> DeletePlayer(IExecutionContext context)
{
_logger.LogInformation($"DeletePlayer() playerId: {context.PlayerId}");
if (string.IsNullOrEmpty(context.PlayerId))
return false;
await ForfeitAllGames(context, context.PlayerId);
await DeclineAllChallengers(context, context.PlayerId);
await RemovePlayerFromAllLeaderboards(context, context.PlayerId);
await SendMessageToUserIdAsync(context, WordsServerResponse.PlayerDataDeleted, "", context.PlayerId);
return true;
}
ERROR Log
NoInternetConnection
Request timeout
0x00007ff68cb597dd (Unity) StackWalker::GetCurrentCallstack
0x00007ff68cb5e8a9 (Unity) StackWalker::ShowCallstack
0x00007ff68db4bfe1 (Unity) GetStacktrace
0x00007ff68e20729e (Unity) DebugStringToFile
0x00007ff68bb2df38 (Unity) DebugLogHandler_CUSTOM_Internal_Log
0x000002174364b543 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
0x000002174364b47b (Mono JIT Code) UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[ ])
0x000002174364b200 (Mono JIT Code) UnityEngine.Logger:Log (UnityEngine.LogType,object)
0x00000217b659fce5 (Mono JIT Code) UnityEngine.Debug:LogError (object)
0x00000217b659f803 (Mono JIT Code) Unity.Services.CloudCode.CloudCodeInternal:BuildException (bool,long,int,string,Unity.Services.CloudCode.Internal.Http.HttpException) (at ./Library/PackageCache/com.unity.services.cloudcode@2.6.2/Runtime/CloudCode.cs:182)
0x00000217b65ac41b (Mono JIT Code) Unity.Services.CloudCode.CloudCodeInternal/d__16:MoveNext () (at ./Library/PackageCache/com.unity.services.cloudcode@2.6.2/Runtime/CloudCode.cs:153)
0x00000217447beada (Mono JIT Code) System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner:InvokeMoveNext (object)
0x00000216b3ea02e6 (Mono JIT Code) System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
0x000002174484ff0b (Mono JIT Code) System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
0x00000217447be93b (Mono JIT Code) System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner:Run ()
0x00000217447be81a (Mono JIT Code) System.Threading.Tasks.AwaitTaskContinuation:InvokeAction (object)
0x0000021742d83325 (Mono JIT Code) System.Threading.Tasks.AwaitTaskContinuation:RunCallback (System.Threading.ContextCallback,object,System.Threading.Tasks.Task&)
0x0000021742d831c3 (Mono JIT Code) System.Threading.Tasks.SynchronizationContextAwaitTaskContinuation:Run (System.Threading.Tasks.Task,bool)
0x00000217208f6973 (Mono JIT Code) System.Threading.Tasks.Task:FinishContinuations ()
0x00000217208f60f3 (Mono JIT Code) System.Threading.Tasks.Task:FinishStageThree ()
0x00000217208f55d3 (Mono JIT Code) System.Threading.Tasks.Task:FinishStageTwo ()
0x00000217208f50ab (Mono JIT Code) System.Threading.Tasks.Task:Finish (bool)
0x00000217b652434b (Mono JIT Code) System.Threading.Tasks.Task:TrySetException (object)
0x00000217b652418b (Mono JIT Code) System.Runtime.CompilerServices.AsyncTaskMethodBuilder1<TResult_REF>:SetException (System.Exception) 0x00000217b65acc13 (Mono JIT Code) Unity.Services.CloudCode.CloudCodeInternal/<GetModuleResponseAsync>d__21:MoveNext () (at ./Library/PackageCache/com.unity.services.cloudcode@2.6.2/Runtime/CloudCode.cs:243) 0x00000217447beada (Mono JIT Code) System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner:InvokeMoveNext (object) 0x00000216b3ea02e6 (Mono JIT Code) System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) 0x000002174484ff0b (Mono JIT Code) System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) 0x00000217447be93b (Mono JIT Code) System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner:Run () 0x00000217447be81a (Mono JIT Code) System.Threading.Tasks.AwaitTaskContinuation:InvokeAction (object) 0x0000021742d83325 (Mono JIT Code) System.Threading.Tasks.AwaitTaskContinuation:RunCallback (System.Threading.ContextCallback,object,System.Threading.Tasks.Task&) 0x0000021742d831c3 (Mono JIT Code) System.Threading.Tasks.SynchronizationContextAwaitTaskContinuation:Run (System.Threading.Tasks.Task,bool) 0x00000217208f6973 (Mono JIT Code) System.Threading.Tasks.Task:FinishContinuations () 0x00000217208f60f3 (Mono JIT Code) System.Threading.Tasks.Task:FinishStageThree () 0x00000217208f55d3 (Mono JIT Code) System.Threading.Tasks.Task:FinishStageTwo () 0x00000217208f50ab (Mono JIT Code) System.Threading.Tasks.Task:Finish (bool) 0x00000217b652434b (Mono JIT Code) System.Threading.Tasks.Task:TrySetException (object) 0x00000217b652418b (Mono JIT Code) System.Runtime.CompilerServices.AsyncTaskMethodBuilder
1<TResult_REF>:SetException (System.Exception)
0x00000217b65ad743 (Mono JIT Code) Unity.Services.CloudCode.Internal.Apis.CloudCode.CloudCodeApiClient/d__7:MoveNext () (at ./Library/PackageCache/com.unity.services.cloudcode@2.6.2/Runtime/com.unity.services.cloudcode.internal/Apis/CloudCodeApi.cs:138)
0x00000217447beada (Mono JIT Code) System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner:InvokeMoveNext (object)
0x00000216b3ea02e6 (Mono JIT Code) System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
0x000002174484ff0b (Mono JIT Code) System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
0x00000217447be93b (Mono JIT Code) System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner:Run ()
0x00000217447be81a (Mono JIT Code) System.Threading.Tasks.AwaitTaskContinuation:InvokeAction (object)
0x0000021742d83325 (Mono JIT Code) System.Threading.Tasks.AwaitTaskContinuation:RunCallback (System.Threading.ContextCallback,object,System.Threading.Tasks.Task&)
0x0000021742d831c3 (Mono JIT Code) System.Threading.Tasks.SynchronizationContextAwaitTaskContinuation:Run (System.Threading.Tasks.Task,bool)
0x00000217208f6973 (Mono JIT Code) System.Threading.Tasks.Task:FinishContinuations ()
0x00000217208f60f3 (Mono JIT Code) System.Threading.Tasks.Task:FinishStageThree ()
0x00000217208fda0b (Mono JIT Code) System.Threading.Tasks.Task1<TResult_REF>:TrySetResult (TResult_REF) 0x000002174476a413 (Mono JIT Code) System.Runtime.CompilerServices.AsyncTaskMethodBuilder
1<TResult_REF>:SetResult (TResult_REF)
0x00000217b6511bab (Mono JIT Code) Unity.Services.CloudCode.Internal.Http.HttpClient/d__2:MoveNext () (at ./Library/PackageCache/com.unity.services.cloudcode@2.6.2/Runtime/com.unity.services.cloudcode.internal/Http/HttpClient.cs:44)
0x00000217447beada (Mono JIT Code) System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner:InvokeMoveNext (object)
0x00000216b3ea02e6 (Mono JIT Code) System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
0x000002174484ff0b (Mono JIT Code) System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
0x00000217447be93b (Mono JIT Code) System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner:Run ()
0x00000217447be81a (Mono JIT Code) System.Threading.Tasks.AwaitTaskContinuation:InvokeAction (object)
0x0000021742d83325 (Mono JIT Code) System.Threading.Tasks.AwaitTaskContinuation:RunCallback (System.Threading.ContextCallback,object,System.Threading.Tasks.Task&)
0x0000021742d831c3 (Mono JIT Code) System.Threading.Tasks.SynchronizationContextAwaitTaskContinuation:Run (System.Threading.Tasks.Task,bool)
0x00000217208f6973 (Mono JIT Code) System.Threading.Tasks.Task:FinishContinuations ()
0x00000217208f60f3 (Mono JIT Code) System.Threading.Tasks.Task:FinishStageThree ()
0x00000217208fda0b (Mono JIT Code) System.Threading.Tasks.Task1<TResult_REF>:TrySetResult (TResult_REF) 0x000002174476a413 (Mono JIT Code) System.Runtime.CompilerServices.AsyncTaskMethodBuilder
1<TResult_REF>:SetResult (TResult_REF)
0x00000217b651237b (Mono JIT Code) Unity.Services.CloudCode.Internal.Http.HttpClient/d__4:MoveNext () (at ./Library/PackageCache/com.unity.services.cloudcode@2.6.2/Runtime/com.unity.services.cloudcode.internal/Http/HttpClient.cs:69)
0x00000217447beada (Mono JIT Code) System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner:InvokeMoveNext (object)
0x00000216b3ea02e6 (Mono JIT Code) System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
0x000002174484ff0b (Mono JIT Code) System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
0x00000217447be93b (Mono JIT Code) System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner:Run ()
0x00000217447be81a (Mono JIT Code) System.Threading.Tasks.AwaitTaskContinuation:InvokeAction (object)
0x0000021742d83325 (Mono JIT Code) System.Threading.Tasks.AwaitTaskContinuation:RunCallback (System.Threading.ContextCallback,object,System.Threading.Tasks.Task&)
0x0000021742d831c3 (Mono JIT Code) System.Threading.Tasks.SynchronizationContextAwaitTaskContinuation:Run (System.Threading.Tasks.Task,bool)
0x00000217208f6973 (Mono JIT Code) System.Threading.Tasks.Task:FinishContinuations ()
0x00000217208f60f3 (Mono JIT Code) System.Threading.Tasks.Task:FinishStageThree ()
0x00000217208fda0b (Mono JIT Code) System.Threading.Tasks.Task1<TResult_REF>:TrySetResult (TResult_REF) 0x000002174476a413 (Mono JIT Code) System.Runtime.CompilerServices.AsyncTaskMethodBuilder
1<TResult_REF>:SetResult (TResult_REF)
0x00000217b6512b8b (Mono JIT Code) Unity.Services.CloudCode.Internal.Http.HttpClient/d__6:MoveNext () (at ./Library/PackageCache/com.unity.services.cloudcode@2.6.2/Runtime/com.unity.services.cloudcode.internal/Http/HttpClient.cs:105)
0x00000217447beada (Mono JIT Code) System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner:InvokeMoveNext (object)
0x00000216b3ea02e6 (Mono JIT Code) System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
0x000002174484ff0b (Mono JIT Code) System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
0x00000217447be93b (Mono JIT Code) System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner:Run ()
0x00000217447be81a (Mono JIT Code) System.Threading.Tasks.AwaitTaskContinuation:InvokeAction (object)
0x0000021742d83325 (Mono JIT Code) System.Threading.Tasks.AwaitTaskContinuation:RunCallback (System.Threading.ContextCallback,object,System.Threading.Tasks.Task&)
0x0000021742d831c3 (Mono JIT Code) System.Threading.Tasks.SynchronizationContextAwaitTaskContinuation:Run (System.Threading.Tasks.Task,bool)
0x00000217208f6973 (Mono JIT Code) System.Threading.Tasks.Task:FinishContinuations ()
0x00000217208f60f3 (Mono JIT Code) System.Threading.Tasks.Task:FinishStageThree ()
0x00000217208fda0b (Mono JIT Code) System.Threading.Tasks.Task1<TResult_REF>:TrySetResult (TResult_REF) 0x000002174476a413 (Mono JIT Code) System.Runtime.CompilerServices.AsyncTaskMethodBuilder
1<TResult_REF>:SetResult (TResult_REF)
0x00000217b6514e23 (Mono JIT Code) Unity.Services.CloudCode.Internal.Http.HttpClient/<>c__DisplayClass6_0/<b__0>d:MoveNext () (at ./Library/PackageCache/com.unity.services.cloudcode@2.6.2/Runtime/com.unity.services.cloudcode.internal/Http/HttpClient.cs:102)
0x00000217447beada (Mono JIT Code) System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner:InvokeMoveNext (object)
0x00000216b3ea02e6 (Mono JIT Code) System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
0x000002174484ff0b (Mono JIT Code) System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
0x00000217447be93b (Mono JIT Code) System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner:Run ()
0x00000217447be81a (Mono JIT Code) System.Threading.Tasks.AwaitTaskContinuation:InvokeAction (object)
0x0000021742d83325 (Mono JIT Code) System.Threading.Tasks.AwaitTaskContinuation:RunCallback (System.Threading.ContextCallback,object,System.Threading.Tasks.Task&)
0x0000021742d831c3 (Mono JIT Code) System.Threading.Tasks.SynchronizationContextAwaitTaskContinuation:Run (System.Threading.Tasks.Task,bool)
0x00000217208f6973 (Mono JIT Code) System.Threading.Tasks.Task:FinishContinuations ()
0x00000217208f60f3 (Mono JIT Code) System.Threading.Tasks.Task:FinishStageThree ()
0x00000217208fda0b (Mono JIT Code) System.Threading.Tasks.Task1<TResult_REF>:TrySetResult (TResult_REF) 0x00000217447be783 (Mono JIT Code) System.Threading.Tasks.TaskCompletionSource
1<TResult_REF>:TrySetResult (TResult_REF)
0x00000217b554a4d3 (Mono JIT Code) System.Threading.Tasks.TaskCompletionSource1<TResult_REF>:SetResult (TResult_REF) 0x00000217b651fa73 (Mono JIT Code) Unity.Services.CloudCode.Internal.Http.UnityWebRequestHelpers/<>c__DisplayClass0_0:<GetAwaiter>b__0 (UnityEngine.AsyncOperation) (at ./Library/PackageCache/com.unity.services.cloudcode@2.6.2/Runtime/com.unity.services.cloudcode.internal/Http/UnityWebRequestHelpers.cs:35) 0x00000217b554851b (Mono JIT Code) UnityEngine.AsyncOperation:InvokeCompletionEvent () 0x00000217b6019808 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr) 0x00007ffbea444c1e (mono-2.0-bdwgc) mono_jit_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/mini/mini-runtime.c:3445) 0x00007ffbea37d254 (mono-2.0-bdwgc) do_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3068) 0x00007ffbea37d3cc (mono-2.0-bdwgc) mono_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3115) 0x00007ff68ca721c4 (Unity) scripting_method_invoke 0x00007ff68ca4feb4 (Unity) ScriptingInvocation::Invoke 0x00007ff68c6d09b6 (Unity) AsyncOperation::InvokeCoroutine 0x00007ff68d01875c (Unity) UnityWebRequestAsyncOperation::InvokeCoroutine 0x00007ff68d018941 (Unity) UnityWebRequestProto<UnityWebRequestTransport,AtomicRefCounter,RedirectHelper,ResponseHelper,DownloadHandler,UploadHandler,CertificateHandler,HeaderHelper,AsyncOperation>::Job_InvokeCoroutine 0x00007ff68c683d8a (Unity) BackgroundJobQueue::ExecuteMainThreadJobs 0x00007ff68c70652c (Unity)
InitPlayerLoopCallbacks’::`2’::EarlyUpdateExecuteMainThreadJobsRegistrator::Forward
0x00007ff68c6e676c (Unity) ExecutePlayerLoop
0x00007ff68c6e68e0 (Unity) ExecutePlayerLoop
0x00007ff68c6ed175 (Unity) PlayerLoop
0x00007ff68d6c39b5 (Unity) PlayerLoopController::InternalUpdateScene
0x00007ff68d6d087d (Unity) PlayerLoopController::UpdateSceneIfNeededFromMainLoop
0x00007ff68d6ceb61 (Unity) Application::TickTimer
0x00007ff68db51c8a (Unity) MainMessageLoop
0x00007ff68db56b60 (Unity) WinMain
0x00007ff68ef3af6e (Unity) __scrt_common_main_seh
0x00007ffc6ba37344 (KERNEL32) BaseThreadInitThunk
0x00007ffc6c9a26b1 (ntdll) RtlUserThreadStart