question

Bob avatar image
Bob asked

Unity - GSDK_CONFIG_FILE not found

I followed the integration instructions from: https://github.com/PlayFab/gsdk and got the error above. I tried several other repositories including: https://github.com/PlayFab/MpsSamples and https://github.com/natepac/playfabmirrorgameexample with all of them having the same issue. I tried to debug using the MockVMAgent and kept getting failure messages when container is both true and false. Im not really sure what the issue is as I thought the GSDK_CONFIG_FILE was supposed to be generated automatically.

5 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Gosen Gao avatar image Gosen Gao commented ·

May I know the detailed error message and at what step did you encounter this error?

0 Likes 0 ·
Bob avatar image Bob commented ·

For sure! After cloning the repository and making sure the necesarry Start, ReadyForPlayers and ENABLE_PLAYFABSERVER_API were all defned I built the project as a server build using Unity. After many attempts to get the project working on PlayFabserver I I ran the program locally and the console closed immediately. I was only able to determine the error through a screen capture. Here is the error:

Environment variable GSDK_CONFIG_FILE not defined

NullReferenceException: Object reference not set to an instance of an object

at PlayFab.PlayFabMultiplayerAgentAPI.Start() [0x0004b] in <855e0d6a6a4648999fa2ea418591dceb>:0

at AgentListener.Start () [0x0000b] in <44eb5325efe04220a4478cf0a08b6181>:0

0 Likes 0 ·
Benjamin Ikes avatar image Benjamin Ikes Bob commented ·

I am not a pro but I had the same problem! If you have a windows build try making a #IfUNITy_SERVER #endif around your code that only should run on the server!! :D hope it help not a pro tho having also issues here as a noob

0 Likes 0 ·
Bob avatar image Bob Benjamin Ikes commented ·

Thanks Ben! I actually tried that on the code that I'm writing. Also not entirely sure how it works but from my understanding this only prevents the code from running when on a client build. For all the tests that I have done I'm building and running this project as a Unity Server build

0 Likes 0 ·
Show more comments

1 Answer

·
Gosen Gao avatar image
Gosen Gao answered

I followed the README of MpsSamples/UnityMirror at master PlayFab/MpsSamples GitHub to do a quick test with LocalMultiplayerAgentPublish, everything works fine for me. I checked the GSDK_CONFIG_FILE in the docker container and confirmed that it was generated based on the MultiplayerSettings.json file inside LocalMultiplayerAgentPublish. I recommend you to follow the official documentation -- Locally debugging game servers and integration with PlayFab to set up LocalMultiplayerAgentPublish to try again.

7 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Bob avatar image Bob commented ·

I tried following the readme from MpsSamples/UnityMirror but I unfortunetly ran into a few hiccups. When I downloaded the project there was an error on line 244 of Kcp transport that I managed to shoe in a fix for. After that the rest of the setup went smoothly until I reached the section on setup.ps1. I'm new to docker so I'm not entirely sure if I set it up properly or not but it is using WSL2 backend and the appropriate linux kernels are installed. However when attempting to run the setup.ps1 file I get an error despite running docker desktop and it telling me that the docker engine is running:

Start-Service : Cannot find any service with service name 'docker'

I have actually followed the page on locally debugging game servers and integration with PlayFab before and got errors when RunContainer was set to be both true and false. The only difference seems to be the setup.ps1 file which I wasn't able to run and not sure what it is responsible for.

0 Likes 0 ·
Gosen Gao avatar image Gosen Gao Bob commented ·

We notice that you have mentioned WSL2, but locally testing server build doesn’t require WSL2, neither the Linux kernel. It is only used when targeting a Linux build. Meanwhile, if you are using Unity Mirror sample and test your server build in Windows, please make sure your docker has been switched to the Windows container. I recommend you to run some common docker cmd in the PowerShell to ensure that your docker is running properly.

0 Likes 0 ·
Bob avatar image Bob Bob commented ·

My computer is running windows 10 Home and I am unable to switch to windows containers. Based on Locally debug game servers and integration with PlayFab there is also a section on verifying gsdk integration when RunContainer is set to false. I have tried this method using MpsSamples/UnityMirror but I still get an error even though this is not supposed to use containers/docker? My error:

Is there any way I can get around this issue without having to updrage to Windows Pro?

0 Likes 0 ·
Gosen Gao avatar image Gosen Gao Bob commented ·

According to the error message, there should be something wrong with the configuration. What is the path of the compressed file of your project? Could you please share us your MultiplayerSettings.json file so that we can look into it? Please remove any sensitive info.

0 Likes 0 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.