Improbable Icon

SpatialOS Forums

Error playing the FPS-Development Scene

System: macOS Mojave 10.14.3
Unity3D: 2019.1.3f1
GDK for Unity: 0.2.5(0ba40d3)
Error log in Unity3D Console:

[UnityGameLogic] Failed to create worker
‘WorkerType’: ‘UnityGameLogic’
‘Message’: ‘Tried to connect 3 times - giving up.’
‘Stacktrace’: ’ at Improbable.Gdk.Core.WorkerConnector+d__12.MoveNext () [0x00212] in /Users/gaojiongjiong/Documents/Projects/gdk-for-unity-fps-starter-project-dup/workers/unity/Library/PackageCache/io.improbable.gdk.core@0.2.5/Worker/WorkerConnector.cs:184
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <1f0c1ef1ad524c38bbc5536809c46b48>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <1f0c1ef1ad524c38bbc5536809c46b48>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <1f0c1ef1ad524c38bbc5536809c46b48>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <1f0c1ef1ad524c38bbc5536809c46b48>:0
at System.Runtime.CompilerServices.TaskAwaiter1[TResult].GetResult () [0x00000] in <1f0c1ef1ad524c38bbc5536809c46b48>:0 at Improbable.Gdk.Core.WorkerConnector+<Connect>d__9.MoveNext () [0x00107] in /Users/gaojiongjiong/Documents/Projects/gdk-for-unity-fps-starter-project-dup/workers/unity/Library/PackageCache/io.improbable.gdk.core@0.2.5/Worker/WorkerConnector.cs:87 ' UnityEngine.Logger:Log(LogType, Object, Object) Improbable.Gdk.Core.ForwardingDispatcher:HandleLog(LogType, LogEvent) (at Library/PackageCache/io.improbable.gdk.core@0.2.5/Logging/ForwardingDispatcher.cs:80) Improbable.Gdk.Core.<Connect>d__9:MoveNext() (at Library/PackageCache/io.improbable.gdk.core@0.2.5/Worker/WorkerConnector.cs:107) System.Runtime.CompilerServices.AsyncTaskMethodBuilder1:SetException(Exception)
Improbable.Gdk.Core.d__12:MoveNext() (at Library/PackageCache/io.improbable.gdk.core@0.2.5/Worker/WorkerConnector.cs:184)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder1:SetException(Exception) Improbable.Gdk.Core.<CreateWorkerInWorldAsync>d__10:MoveNext() (at Library/PackageCache/io.improbable.gdk.core@0.2.5/Worker/WorkerInWorld.cs:67) System.Runtime.CompilerServices.AsyncTaskMethodBuilder1:SetException(Exception)
Improbable.Gdk.Core.d__11:MoveNext() (at Library/PackageCache/io.improbable.gdk.core@0.2.5/Worker/ConnectionHandlers/SpatialOSConnectionHandlerBuilder.cs:88)
UnityEngine.UnitySynchronizationContext:ExecuteTasks()

Description: I’ve set up the enviroment according to the guide of FPS Starter Project and clone the project from git. I opened the project by Unity3D and I want to try local development first. So I press Cmd+L according to the guide. A Console window appeared and for a while the message is: SpatialOS ready. Access the inspector at http://localhost:21000/inspector. I checked the listening port by lsof command that spatial was listening on port 1443, 22000 and 21000. Further I checked that the firewall was closed. But after I opened the FPS-Development Scene and press the play button, the game UI was always showing connecting and for a while the above error message appeared in the console.

Hey @Jiongjiong-Gao,

It indeed looks like the worker is having some issues connecting to your local deployment as the WorkerConnector class is throwing a ConnectionFailedException.
Would you be able to run the following command for me and paste the output/attach a file with the output?

spatial diagnose --log_level=debug

Thank you! I’ll try it tomorrow.

Thank you! I’ve found the problem!
After exec the command spatial diagnose --log_level=debug, it shows that the port 7777 is occupied and can not connect to https://connect.spatial.improbable.io:302/_healthz.
After adjusting the program occupied the port 7777 and adjusting proxy config, I can play the FPS-Development Scene successfully. Thank you very much!
In the network-settings part of the doc, it only says keep port 22000 free, not referring to port 7777.

1 Like

Hey @Jiongjiong-Gao, that’s a great spot! I’ll let the documentation team know about this so we can update the requirements page and investigate any other potential issues.

Thanks for the feedback!