Build created on remote build agent is not finding appId

Options
Hello all!

Im using PUN and when creating a build locally i can connect as well as running in the editor. Both can connect to the same room and all this works.

However, I am building my project on a remote build agent. The build agent fetches the code from source control, and creates a build based out of this.
The build works, except that i can't connect to the Photon servers, with the following error being thrown:
"The appId this client sent is unknown on the server (Cloud). Check settings. If using the Cloud, check account."

I believe this is because the build did not include the appId which is configured in the PhotonServerSettings file.
Anyone has any idea why this might be?
I can see my appId sitting in the PhotonServerSettings file in Source Control, so it is available there, just not picked up on build.

Thanks in advance for any help!

Comments

  • KevinDW
    Options
    I noticed by monitoring the files during the build on the remote agent the following happens:

    1) The PhotonServerSettings file is pulled including the AppId
    2) Build command is run (Unity.exe -batchmode -buildTarget standalone -projectPath xxxx -nographics -executeMethod AzureDevOps.PerformBuild -logfile xxxx)
    3) After a while the correct PhotonServerSettings file is replaced with a blank one.

    I think this behaviour is similar to when i open a project from source control on a new computer. The wizard will open prompting you for the appid, even though it was already available.

    This got me to thinking the reason might be that somefile preventing the wizard from opening is not included in the repo, and i am excluding some files i shouldnt with my .gitignore

    Below is my gitignore, anyone have any idea where Photon might be storing something related to this which I am excluding?

    [Ll]ibrary/ [Tt]emp/ [Oo]bj/ [Bb]uild/ [Bb]uilds/ Assets/AssetStoreTools* # Visual Studio cache directory .vs/ # Autogenerated VS/MD/Consulo solution and project files ExportedObj/ .consulo/ *.csproj *.unityproj *.sln *.suo *.tmp *.user *.userprefs *.pidb *.booproj *.svd *.pdb *.opendb # Unity3D generated meta files *.pidb.meta *.pdb.meta # Unity3D Generated File On Crash Reports sysinfo.txt # Builds *.apk *.unitypackage
  • KevinDW
    Options
    After some extra investigation I noticed that on the remote agent the PhotonServerSettings file is cleared during the build. What happens on the agent is:

    1) Project is pulled from git, including the correct PhotonServerSettings file (with the appId in it)
    2) Build starts through command line
    3) After a few minutes, the correct PhotonServerSettings file is replaced with a default one

    I noticed that i have similar behaviour when opening my project for the first time after doing a clean pull from git.
    This has led me to believe I am excluding something with .gitignore which is causing this behaviour.
    Below you can find my gitignore file. Does anyone have any idea which file(s) might be causing this behaviour?

    [Ll]ibrary/ [Tt]emp/ [Oo]bj/ [Bb]uild/ [Bb]uilds/ Assets/AssetStoreTools* # Visual Studio cache directory .vs/ # Autogenerated VS/MD/Consulo solution and project files ExportedObj/ .consulo/ *.csproj *.unityproj *.sln *.suo *.tmp *.user *.userprefs *.pidb *.booproj *.svd *.pdb *.opendb # Unity3D generated meta files *.pidb.meta *.pdb.meta # Unity3D Generated File On Crash Reports sysinfo.txt # Builds *.apk *.unitypackage
  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @KevinDW,

    Thank you for choosing Photon!

    What PUN version are you using?
    What Unity version is this built with?
  • BigGameCo
    Options
    We have been having this same problem for some time now, using Photon with the Unity Cloud Build. Just upgraded everything and the problem still exists using PUN 2.16 and Unity 2019.3.1
  • aboogoost
    Options
    I'm having this problem as well but simply from using git as version control.

    When checking out another branch the PUN wizard window will open and PhotonServerSettings will be replaced with an empty version. I can't find where this happens - I assume it is inside the Photon editor code. It would be nice to disable this to prevent having to constantly look up the appId.
  • Tobias
    Options
    The PhotonEditor.OnProjectChanged() is where the settings should be created.
    In PUN v2.16, it will contain this check:

    #if UNITY_CLOUD_BUILD
    return;
    #endif

    So, in theory, the cloud build should not re-create the settings.
    Are you sure that v2.16 gives you this behaviour? We'll take another look at it.
  • Has anyone solved this? Our team is having to manually put in appId and server settings after a project clone (using git) because the settings aren't being stored anywhere visible to git.
  • vml933
    Options
    Same problem here, any solution ?