linuxamazon-web-servicesunity-game-enginebuild-server

Headless Unity return error Multiple Unity instances


I have installed Unity 2021.3.15f1 on EC2 Amazon, AWS Linux. I am trying to run unity build using commands and flag to use batchmode, but even I am invoking the command only once, there is a message

It looks like another Unity instance is running with this project open.

Multiple Unity instances cannot open the same project.

Project: /repo/VR-Survival
Fatal Error! It looks like another Unity instance is running with this project open.

Multiple Unity instances cannot open the same project.

I've checked if there is any process of Unity, but no. Restarts of EC2 instance doesn't help either. Any ideas how to solve this?

Command: xvfb-run /home/ec2-user/Editor/Unity -batchmode -nographics -projectPath /repo/VR-Survival/ -quit -logfile ~/editor.log -serial [my serial number] -username pawelmalysz@xxx.com -password my_password

Full logs (censored)

[ec2-user@ip-xxxx ~]$ cat editor.log
Unity Editor version:    2021.3.15f1 (e8e88683f834)
Branch:                  2021.3/staging
Build type:              Release
Batch mode:              YES
System name:             Linux
Distro version:          #1 SMP PREEMPT_DYNAMIC Tue Aug  1 20:47:25 UTC 2023
Kernel version:          6.1.41-63.114.amzn2023.x86_64
Architecture:            x86_64
Available memory:        15779 MB
User pawelmalysz@xxxx.com logged in successfully
[LicensingClient] Channel doesn't exist: "LicenseClient-ec2-user"
[Licensing::Module] Successfully launched the LicensingClient (PId: 2200)
No usable version of libssl was found
[LicensingClient] Channel doesn't exist: "LicenseClient-ec2-user"
[Licensing::Module] Timed-out after 60.00s, waiting for channel: "LicenseClient-ec2-user"
IPC channel to LicensingClient doesn't exist; falling back to Legacy licensing

LICENSE SYSTEM [202391 9:1:38] Next license update check is after 2023-08-19T08:54:23


LICENSE SYSTEM [202391 9:1:38] Current license is already valid and activated. Skipping license activation process (Provided username/password will be ignored).
Pro License: YES
Initialize udev device monitor.
[Package Manager] Server::Start -- Port 42797 was selected

COMMAND LINE ARGUMENTS:
/home/ec2-user/Editor/Unity
-batchmode
-nographics
-projectPath
/repo/VR-Survival/
-quit
-logfile
/home/ec2-user/editor.log
-serial
(hidden)
-username
pawelmalysz@xxxx.com
-password
(hidden)
-executeMethod
/repo/VR-Survival/Assets/Editor/Scripts/BuildScript.cs
Successfully changed project path to: /repo/VR-Survival/
/repo/VR-Survival
It looks like another Unity instance is running with this project open.

Multiple Unity instances cannot open the same project.

Project: /repo/VR-Survival
Fatal Error! It looks like another Unity instance is running with this project open.

Multiple Unity instances cannot open the same project.

Project: /repo/VR-Survival

Script:

using UnityEditor;

public class BuildScript
{
    public static void BuildLinux()
    {
        string[] scenes = { "Assets/Scenes/SplashSceen", "Assets/Scenes/MainMenu", "Assets/Scenes/Oregano", "Assets/Scenes/OtherScene" };
        string buildPath = "/home/ec2-user/SNBuild";
        Console.Log("TEST TEST");
        Debug.Log("TEST 2 Test 2");
        BuildReport buildReport = BuildPipeline.BuildPlayer(scenes, buildPath, BuildTarget.StandaloneLinux64, BuildOptions.None);

        if (buildReport.summary.result == BuildResult.Succeeded)
        {
            UnityEngine.Debug.Log("Build completed successfully.");
        }
        else
        {
            UnityEngine.Debug.LogError("Build failed. Error: " + buildReport.summary);
        }
    }
}

Any ideas what should I try or where should I look for an answer?


Solution

  • Removing the Temp folder helped.