Unable run the Editor without a desktop environment in batchmode with nographics

Hi All!

I’m trying to set up an automatic test and build system listening to repository changes similar to Unity cloud or Jenkins. I have managed to “install” the editor and figured out the dependencies I needed but when I try to run the project the lecense activation fails on me with the following message:

Initiating legacy licensing moduleDisplayProgressbar: Unity license
Cancelling DisplayDialog: Failed to activate/update license. Timeout occured while trying to update license. Please try again later or contact support@unity3d.com
This should not be called in batch mode.
(Filename: /home/builduser/buildslave/unity/build/Editor/Platform/Linux/EditorUtility.cpp Line: 257)

as a result of:

./Unity -batchmode -nographics -logFile /tmp/unity.log -serial xxxx -username xxxx -password xxxx

I tried with the last version 2018.3 and both with CentOS 7 and Ubuntu 18.04 Minimal with the same result. I also tried with personal activation, tried moving the CACerts.pem file with no luck as well.

If I run the same command in my dev maching wich has ubuntu 18.04 with Gnome it works just fine, so maybe the fact that I dont have a desktop environment is making unity fail for some reason.

Have anyone made it work?

Thanks!!

1 Like

I’m having the same issue on a CentOS 7.5.1804 machine with a pro license

$ Unity -quit -batchmode -nographics -serial xxxx -username "xxxx" -password "xxxx" -logfile
Gives:

[0214/100328:ERROR:browser_main_loop.cc(161)] Running without the SUID sandbox! See https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment for more information on developing with the sandbox on.
Cancelling DisplayDialog: Failed to activate/update license. Timeout occured while trying to update license. Please try again later or contact support@unity3d.com
This should not be called in batch mode.

(Filename: /home/builduser/buildslave/unity/build/Editor/Platform/Linux/EditorUtility.cpp Line: 257)

The same command will work totally fine on mac so I can ensure that my credentials are correct. It looks like to me, before even the first line of my the output, acquiring the license fails or is ignored and then it attempts to open the login popup (which is weird cause I’m running with the -nographics flag).

The SUID sandbox thing is a benign error as reported repeatedly here Unity on Linux: Release Notes and Known Issues page-2

The Cancelling DisplayDialog: happens after a 30-60 second timeout and is probably irrelevant.

This should not be run in batch mode seems like it could be something thats causing issues but running without the -batchmode flag just gives the same output interspersed with some more random warnings for not having a graphics display

Does this repro in any project? Do you have a project you could send me to test it out?

There is no project. This happens when just trying to activate the license through command line

Ah gotcha, will give it a go.

I found this which sounds like it’s the same thing Can't get license in headless/nographics mode (timeout error) From a while ago though

For repo steps I downloaded the installer from
https://beta.unity3d.com/download/6e9a27477296/UnitySetup-2018.3.0f2 then ran it with unity-installer --unattended --components=Unity,WebGL --install-location=xxxx then installed the dependencies gtk3, mesa-libGLU, GConf2, and libpng before finally running Unity -quit -batchmode -nographics -serial xxxx -username "xxxx" -password "xxxx" -logfile

I’m not sure if this is linux installer specific or CentOS specific

1 Like

I tried on CentOS 7.5 with Gnome and had no issues. Guessing you’re right and it has to do with having a desktop environment.

1 Like

Yeah I’m thinking that too. Should I create an issue through the bug reporter or have you done that now?

1 Like

Please submit a bug when you can.

Cool, I will keep an eye on it. Hope it can make it for 2019.1 release.

Thank you very much for you attention and support!

1 Like

Hello!
Can you install xvfb-run on your CentOS 7 machine?

I was able to get it going with that.

First:
sudo ln -s /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem /etc/ssl/certs/ca-certificates.crt

Second:
Set the server time if you haven’t:
https://serverfault.com/a/368609/44799

Third:

xvfb-run --auto-servernum --server-args=‘-screen 0 640x480x24’
/opt/Unity/Editor/Unity
-logFile
-batchmode
-username “$UNITY_USERNAME” -password “$UNITY_PASSWORD”

If you could run that command with -verbose and report back with what it outputs that would be great!

Hey thanks for your work on this! Unfortunately we’ve changed our machine to Ubuntu now so we can’t test this anymore

1 Like

I have a 100% repro with a docker image based on gableroux/unity3d:2018.3.7f1
Obviously I triple checked my user/password/serial

xvfb-run --auto-servernum --server-args=‘-screen 0 640x480x24’ /opt/Unity/Editor/Unity -quit -username “XXXX@imbellus.com” -password “XXXXX” -logFile -batchmode -nographics

Initiating legacy licensing moduleDisplayProgressbar: Unity license
[0708/205217:ERROR:browser_main_loop.cc(161)] Running without the SUID sandbox! See chromium - An open-source project to help move the web forward. - Monorail for more information on developing with the sandbox on.
[0708/205217:ERROR:sandbox_linux.cc(308)] InitializeSandbox() called with multiple threads in process gpu-process
[UnityConnectServicesConfig] config is NOT valid, switching to default
UnityConnectLoginRequest: Failed to login - please check your username or password

(Filename: /home/builduser/buildslave/unity/build/Editor/Src/UnityConnect/UnityConnectLoginRequest.cpp Line: 31)

No sufficient permissions while processing request “https://core.cloud.unity3d.com/api/login”, HTTP error code 401
.Cancelling DisplayDialog: Failed to activate/update license. Timeout occured while trying to update license. Please try again later or contact support@unity3d.com
This should not be called in batch mode.

(Filename: /home/builduser/buildslave/unity/build/Editor/Platform/Linux/EditorUtility.cpp Line: 257)

1 Like

Using a manual license activation, I can somehow get around the activation - partially. although my PRO license is not taken into account :

cp Unity_v2018.x.ulf /root/.local/share/unity3d/Unity/Unity_lic.ulf

  • xvfb-run --auto-servernum ‘–server-args=-screen 0 640x480x24’ /opt/Unity/Editor/Unity -username ‘’ -password ‘’ -projectPath GameClient -buildTarget WebGL -quit -batchmode -silent-crashes -executeMethod Jenkins.PerformBuild_AssetBundles_WebGL -logFile /dev/stdout

Initiating legacy licensing moduleUnable to load libnotify

LICENSE SYSTEM [201975 21:30:48] Next license update check is after 2019-07-05T22:46:24

LICENSE SYSTEM [201975 21:30:48] Time validation failed (1)

[Package Manager] Server::Start – Port 50523 was selected

in my ulf I can see :

and I am wondering if the time check is failing, it is defaulting to my personal license, and not the PRO one.

The culprit was using quotes for the password and special characters, that was likely causing some misinterpretation on the shell command line. Simplifying the password did the trick. I found it by iteration using another account that was actually working.

1 Like