Search Unity

Batch mode license activation fails in a Docker container

Discussion in 'Windows' started by tgwozdz_unity, Sep 20, 2019.

  1. tgwozdz_unity

    tgwozdz_unity

    Joined:
    Aug 6, 2019
    Posts:
    8
    Hello!

    I'm trying to set up a Windows Docker container to perform our automated Unity builds. I'm trying to activate the license and I'm getting an error.

    I'm running the following command in the Docker container (in a powershell console).

    Start-Process -FilePath 'c:\program files\unity\editor\unity.exe' -ArgumentList '-batchmode','-quit','-nographics','-logfile','log.txt','-serial','xxx','-username','yyy','-password','zzz' -Wait


    The log then gets the following output:

    BatchMode: Unity has not been activated with a valid License. Could be a new activation or renewal...

    (Filename: C:\buildslave\unity\build\Platforms/Windows/Modules/LicensingLegacy/WinILicensingAdapter.cpp Line: 43)

    DisplayProgressbar: Unity license
    Cancelling DisplayDialog: Updating license failed Failed to update license within 60 seconds. Exiting.
    This should not be called in batch mode.

    (Filename: C:\buildslave\unity\build\Editor/Platform/Windows/EditorUtility.cpp Line: 1162)

    Exiting without the bug reporter. Application will terminate with return code 1


    It seems like Unity might be trying to display some kind of dialog box, but is unable to because it's in a headless container? Is there some way around this? When I run the same command outside of the Docker container, it completes successfully.
     
    nguetter, GuillaumeCL and spauley like this.
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    6,540
    Hey I just heard back from our license team folks. They had these suggestions:

    That means login failed.
    1. Check username and password
    2. Clear Editor cache (C:\Users\<username>\AppData\LocalLow\Unity\Browser\ or ~/Library/Unity/Browser) * ~ means user’s folder in mac system.
    3. Try to activate it again

    Let me know if this helps if we need to do further troubleshooting.
     
  3. tgwozdz_unity

    tgwozdz_unity

    Joined:
    Aug 6, 2019
    Posts:
    8
    The username, password and serial number are correct. I am able to run the same command outside of the Docker container successfully.

    The cache is empty within the Docker container, the container contains a clean install of Unity, however the activation still fails with the same error.

    Is there anything else that could be causing this?
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    6,540
    Which version of Unity are you on? There was a known issue in Unity 2018.1 and 2018.2 that would cause "Cancelling DisplayDialog: Updating license failed Failed to update license within 60 seconds. Exiting.". It was fixed late in 2018.2 cycle.
     
  5. tgwozdz_unity

    tgwozdz_unity

    Joined:
    Aug 6, 2019
    Posts:
    8
    I tried this with both 2019.1.14 and 2018.2.21 with the same results for both.
     
  6. matissehack

    matissehack

    Joined:
    Oct 5, 2019
    Posts:
    2
    I just ran into this exact issue as well.

    I have a Windows container based on mcr.microsoft.com/windows:1903 and I'm trying to activate a fresh install of Unity version 2018.4.2f1 on it. I also tried Unity version 2019.2.8f1 without any luck.

    The command works fine outside the container.
     
  7. Amir_AZNK

    Amir_AZNK

    Unity Technologies

    Joined:
    Jul 9, 2019
    Posts:
    7
    Hi guys,

    I reproduced the same issue on my side. What I did was disabled all network adaptors on my machine and run the activate license command and I got the same logs.

    I suspect that Unity within the container cannot talk to Unity's licensing backend. Try to check connection and let us know.
     
  8. tgwozdz_unity

    tgwozdz_unity

    Joined:
    Aug 6, 2019
    Posts:
    8
    My container can talk to the Internet just fine. For instance, I was able to curl unity.com from within the container successfully. I can also confirm this with a Wireshark dump of network traffic from the container. However when running the unity activate command, I saw no traffic being generated at all when it failed, as if it wasn't even trying to talk over the network.

    Is there anything else I can try?
     
  9. Amir_AZNK

    Amir_AZNK

    Unity Technologies

    Joined:
    Jul 9, 2019
    Posts:
    7
    Hi
    Would it be possible to provide full editor logs?

    Also please check if you can talk to license.unity3d.com

    Regards,
    Amir
     
    Last edited: Oct 16, 2019 at 7:25 PM
  10. tgwozdz_unity

    tgwozdz_unity

    Joined:
    Aug 6, 2019
    Posts:
    8
    Which log would that be? Where would I find it? What i pasted in the original comment is the full contents of log.txt that was generated by the command I pasted. Is there a log elsewhere I can look at?
     
  11. Amir_AZNK

    Amir_AZNK

    Unity Technologies

    Joined:
    Jul 9, 2019
    Posts:
    7
    It seems that the is a problem that prevents full logs to be shown.

    Editor logs on windows machine are located at: C:\Users\<your username>\AppData\Local\Unity\Editor\Editor.log

    It seems that if '-nographics' is used, there is no log. Now lets try this scenario. Remove '-nographics' and '-logfile log.txt' arguments and see if new Editor.log file is generated at the specified location.

    For security reasons don't post your Editor.log file here. Direct message please.

    Regards,
     
  12. tgwozdz_unity

    tgwozdz_unity

    Joined:
    Aug 6, 2019
    Posts:
    8
    Running without the parameters you specified produces no console output at all. The Editor.log file you mentioned is exactly the same as the contents I pasted in the original comment.
     
  13. Amir_AZNK

    Amir_AZNK

    Unity Technologies

    Joined:
    Jul 9, 2019
    Posts:
    7
    I am installing 2019.1.14f now to see what do I get.
     
  14. Amir_AZNK

    Amir_AZNK

    Unity Technologies

    Joined:
    Jul 9, 2019
    Posts:
    7
    Alright. I tried with 2019.1.14f and I got exactly the same output as what you got, however only if I disable my network adaptor. In the case that I am connected to internet I have more logs and activation is successful.

    Technically this log is not helping at all.

    This MIGHT be a legacy issue that was hopefully fixed in one of the current Pre-Releases.

    Kindly install Unity 2020.1.0a8 and 2019.3.0b7 (can be downloaded easily through Unity HUB) and run them within the container. Capture the same Editor.log file across different runs. Hopefully we will get more insight as the root cause of this issue after this experiment.

    Regards,
    Amir
     
  15. tgwozdz_unity

    tgwozdz_unity

    Joined:
    Aug 6, 2019
    Posts:
    8
    Hey Amir,

    I tried again with Unity 2020.1.0a8 and here's the log:


    [Licensing::Module] Channel doesn't exist: "LicenseClient-ContainerAdministrator"
    [Licensing::Module] Successfully launched the LicensingClient (PId: 5944)
    [Licensing::Module] Successfully connected to LicensingClient on channel: "LicenseClient-ContainerAdministrator"
    Entitlement-based licensing initiated
    [LicensingClient] Licenses updated successfully
    BatchMode: Unity has not been activated with a valid License. Could be a new activation or renewal...
    (Filename: C:\buildslave\unity\build\Platforms/Windows/Modules/LicensingLegacy/WinILicensingAdapter.cpp Line: 44)

    DisplayProgressbar: Unity license
    [Licensing::Module] Error: License is not active (com.unity.editor.headless). HasEntitlements will fail.
    Cancelling DisplayDialog: Failed to activate/update license Failed to activate license within 60 seconds. Please try aga
    in later or contact support@unity3d.com
    This should not be called in batch mode.
    (Filename: C:\buildslave\unity\build\Editor/Platform/Windows/EditorUtility.cpp Line: 1116)

    Exiting without the bug reporter. Application will terminate with return code 1
     
  16. Amir_AZNK

    Amir_AZNK

    Unity Technologies

    Joined:
    Jul 9, 2019
    Posts:
    7
    I looked at the logs and still now much from there. I have same logs as your logs only when I don't have internet connection.

    Still I am leaning toward having no internet access. To see that yourself try running it on regular Windows machine (or any machine not within container) as you mentioned you had successful experience activating a license file. You will see the amount of details and addresses that Unity is trying to connect. And then try to ping each one of them from the container (i.e. license.unity3d.com).

    Kindly post your experience here so that we can move forward from there.

    Regards
     
  17. tgwozdz_unity

    tgwozdz_unity

    Joined:
    Aug 6, 2019
    Posts:
    8
    Here's the log from Unity 2019.3.0b7


    [LicensingClient] ERROR Failed to connect to local IPC
    [Licensing::Module] Failed to connect to channel: LicenseClient-ContainerAdministrator
    [Licensing::Module] Successfully launched the LicensingClient
    [Licensing::Module] Successfully connected to LicensingClient on channel: LicenseClient-ContainerAdministrator
    [Licensing::Module] Successfully launched and connected to LicensingClient
    Entitlement-based licensing initiated
    [LicensingClient] Licenses Updated successfully in LicensingClient
    BatchMode: Unity has not been activated with a valid License. Could be a new activation or renewal...
    (Filename: C:\buildslave\unity\build\Platforms/Windows/Modules/LicensingLegacy/WinILicensingAdapter.cpp Line: 45)

    DisplayProgressbar: Unity license
    Assertion failed on expression: 'g_BackgroundThread == nullptr'
    (Filename: C:\buildslave\unity\build\Editor/Src/TaskManager.cpp Line: 192)

    [Licensing::Module] License is not active (com.unity.editor.headless). HasEntitlements will fail.
    Cancelling DisplayDialog: Updating license failed Failed to update license within 60 seconds. Exiting.
    This should not be called in batch mode.
    (Filename: C:\buildslave\unity\build\Editor/Platform/Windows/EditorUtility.cpp Line: 1120)

    Exiting without the bug reporter. Application will terminate with return code 1


    I double checked the network connection and I'm indeed able to ping and connect to license.unity3d.com and any other servers that I tried. Networking appears to be working correctly.
     
  18. matissehack

    matissehack

    Joined:
    Oct 5, 2019
    Posts:
    2
    I ran both 2020.1.0a8 and 2019.3.0b7 and got the same output as tgwozdz_unity. The container definitely has a working network connection and I was able to ping license.unity3d.com (it resolved to 35.195.230.199). Happy to try any other troubleshooting steps you can think of!