Search Unity

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

Discussion in 'Linux' started by pegedi1525, Jan 7, 2019.

  1. pegedi1525

    pegedi1525

    Joined:
    Jun 1, 2018
    Posts:
    2
    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!!
     
    nguetter likes this.
  2. nguetter

    nguetter

    Joined:
    Sep 5, 2018
    Posts:
    6
    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:
    Initiating legacy licensing moduleDisplayProgressbar: Unity license
    [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 https://forum.unity.com/threads/unity-on-linux-release-notes-and-known-issues.350256/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
     
  3. PixelJ

    PixelJ

    Unity Technologies

    Joined:
    Nov 1, 2018
    Posts:
    216
    Does this repro in any project? Do you have a project you could send me to test it out?
     
  4. nguetter

    nguetter

    Joined:
    Sep 5, 2018
    Posts:
    6
    There is no project. This happens when just trying to activate the license through command line
     
  5. PixelJ

    PixelJ

    Unity Technologies

    Joined:
    Nov 1, 2018
    Posts:
    216
    Ah gotcha, will give it a go.
     
  6. nguetter

    nguetter

    Joined:
    Sep 5, 2018
    Posts:
    6
  7. nguetter

    nguetter

    Joined:
    Sep 5, 2018
    Posts:
    6
    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
     
    PixelJ likes this.
  8. PixelJ

    PixelJ

    Unity Technologies

    Joined:
    Nov 1, 2018
    Posts:
    216
    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.
     
    nguetter likes this.
  9. nguetter

    nguetter

    Joined:
    Sep 5, 2018
    Posts:
    6
    Yeah I'm thinking that too. Should I create an issue through the bug reporter or have you done that now?
     
    PixelJ likes this.
  10. PixelJ

    PixelJ

    Unity Technologies

    Joined:
    Nov 1, 2018
    Posts:
    216
    Please submit a bug when you can.
     
    Last edited: Feb 19, 2019
  11. PixelJ

    PixelJ

    Unity Technologies

    Joined:
    Nov 1, 2018
    Posts:
    216
  12. pegedi1525

    pegedi1525

    Joined:
    Jun 1, 2018
    Posts:
    2
    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!
     
    PixelJ likes this.
  13. PixelJ

    PixelJ

    Unity Technologies

    Joined:
    Nov 1, 2018
    Posts:
    216
    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:

    https://gitlab.com/gableroux/unity3d-gitlab-ci-example

    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!
     
  14. nguetter

    nguetter

    Joined:
    Sep 5, 2018
    Posts:
    6
    Hey thanks for your work on this! Unfortunately we've changed our machine to Ubuntu now so we can't test this anymore
     
    PixelJ likes this.
  15. ovandenbos

    ovandenbos

    Joined:
    Jul 8, 2019
    Posts:
    2
    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 https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment 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)

    #
     
    ENOUGH- likes this.
  16. Deleted User

    Deleted User

    Guest

    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 :

    <Entitlements>
    <Entitlement Ns="unity_editor" Tag="UnityPersonal" Type="EDITOR" ValidTo="9999-12-31T00:00:00"/>
    <Entitlement Ns="unity_editor" Tag="UnityPro" Type="EDITOR" ValidTo="2019-11-28T20:03:00"/>
    </Entitlements>

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

    ovandenbos

    Joined:
    Jul 8, 2019
    Posts:
    2
    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.
     
    axelstewart likes this.