Search Issue Tracker

Fixed in 2020.2.X

Fixed in 2019.4.X, 2020.1.X

Votes

19

Found in

2018.4

Issue ID

1193364

Regression

Yes

Cannot activate license within a docker container

Windows

-

Following this bug report in our forums (https://forum.unity.com/threads/batch-mode-license-activation-fails-in-a-docker-container.748325/), we have discovered that the reason that the license activation fails from within this docker instance is that our implementation of GetInternetReachability seems to fail within the docker container.

I didn't double-check the instance given by the customer ("matissehack/unity"), and can only assume that it represents the same thing that we would have if we had built it ourselves.

Basically, we call CoCreateInstance(CLSID_NetworkListManager, ...), and then call GetConnectivity on the returned instance. This latter call fails, which (eventually) prevents license activation.

Reference: https://stackoverflow.com/questions/17648194/how-can-i-start-my-application-when-network-connection-is-available

Note: the above description was for a bug that a client reported using Unity within a Windows docker container.
But it became an umbrella for more bugs using Unity within a Linux docker container.

  1. Resolution Note (fix version 2020.2):

    The docker instance masks the machine Id (/etc/machine-id), required for building the license file.
    It is not acceptable that it be left empty.

  2. Resolution Note (fix version 2020.2):

    Fixed in version 2020.2.0b9

  3. Resolution Note (fix version 2020.1):

    Fixed in version 2020.1.0f1

  4. Resolution Note (fix version 2019.4):

    Fixed in version 2019.4.7f1

Comments (9)

  1. risulkarim-voodoo

    Nov 16, 2021 13:33

    I am encountering a similar issue from Unity version 2019.4.30f1 and onwards.
    My CI Platform is CircleCI and I am using game.ci docker images (based on Ubuntu 18.04). I have unity pro license.

    The docker image tags with the Unity version 2019.4.21, 2019.4.22, 2019.4.29 worked fine for my existing project. I am seeing a difference in the log when I try to run exact same command for newer versions (2019.4.30 and onwards, including 2020.3.21). I found a key difference, which seems to be, unity 2019.4.30 and onwards can not detect my license to be "Pro" (in log it appears to be Pro License: NO). I am sharing log for the following command to release a seat example:

    unity-editor -username "${UNITY_USERNAME}" -password "${UNITY_PASSWORD}" -serial "${UNITY_SERIAL}" -batchmode -nographics -returnlicense -quit || echo "Seat is free."

    On Unity 2019.4.29, the output for the command looks like this

    '[LicensingClient] ERROR Failed to connect to local IPC
    [Licensing::Module] Failed to connect to channel: LicenseClient-root
    [Licensing::Module] Successfully launched the LicensingClient
    [SignatureVerifier] Application signature verification not supported on this platform.
    [Licensing::Module] Successfully connected to LicensingClient on channel: LicenseClient-root
    [Licensing::Module] Successfully launched and connected to LicensingClient
    Entitlement-based licensing initiated
    [LicensingClient] Licenses Updated successfully in LicensingClient

    LICENSE SYSTEM [20211116 13:4:25] Failed to return license: Unity license has not been activated, and cannot be returned.
    Seat is free.
    CircleCI received exit code 0'

    The same command on 2019.4.30 would produce the following log.

    'Unity Editor version: 2019.4.30f1 (e8c891080a1f)
    Branch: 2019.4/*******
    Build type: Debug
    Batch mode: YES
    System name: Linux
    Distro version: #117-Ubuntu SMP Mon Aug 2 21:43:04 UTC 2021
    Kernel version: 4.15.0-1110-aws
    Architecture: x86_64
    Available memory: 70340 MB
    [LicensingClient] ERROR Failed to connect to local IPC
    [Licensing::Module] Failed to connect to channel: LicenseClient-root
    [Licensing::Module] Successfully launched the LicensingClient
    [SignatureVerifier] Application signature verification not supported on this platform.
    [Licensing::Module] Successfully connected to LicensingClient on channel: LicenseClient-root
    [Licensing::Module] Successfully launched and connected to LicensingClient
    Entitlement-based licensing initiated
    [LicensingClient] Licenses Updated successfully in LicensingClient
    [Licensing::Module] License is not active (com. unity. editor .headless). HasEntitlements will fail.
    Pro License: NO

    LICENSE SYSTEM [20211116 12:57:26] Failed to return license: Unity license has not been activated, and cannot be returned.
    Checking for leaked weakptr:
    Found no leaked weakptrs.
    ##utp:{"type":"MemoryLeaks","version":2,"phase":"Immediate","time":1637067446176,"processId":246,"allocatedMemory":73206,"memoryLabels":[{"Default":-552},{"Manager":680},{"Serialization":40},{"BaseObject":12296},{"String":14012},{"DynamicArray":86},{"Curl":1112},{"PoolAlloc":120},{"GI":3064},{"VR":80},{"RestService":256},{"License":264},{"UnityConnect":21160},{"Collab":57},{"LocalIPC":99},{"ProfilerEditor":19880},{"Licensing":552}]}
    Seat is free.
    CircleCI received exit code 0'

    Similarly, the following android build command works perfectly fine with 2019.4.29.
    unity-editor -username "${UNITY_USERNAME}" -password "${UNITY_PASSWORD}" -serial "${UNITY_SERIAL}" -batchmode -nographics -accept-apiupdate -buildTarget Android -executeMethod Voodoo.CI.BuildAndroid.Build

    but when it comes to 2019.4.30 and onwards, the build fails due to missing a valid license. Although It seems to gets activated as expected. The log would look like this.

    'Unity Editor version: 2019.4.30f1 (e8c891080a1f)
    Branch: 2019.4/*******
    Build type: Debug
    Batch mode: YES
    System name: Linux
    Distro version: #117-Ubuntu SMP Mon Aug 2 21:43:04 UTC 2021
    Kernel version: 4.15.0-1110-aws
    Architecture: x86_64
    Available memory: 70340 MB
    [LicensingClient] ERROR Failed to connect to local IPC
    [Licensing::Module] Failed to connect to channel: LicenseClient-root
    [Licensing::Module] Successfully launched the LicensingClient
    [SignatureVerifier] Application signature verification not supported on this platform.
    [Licensing::Module] Successfully connected to LicensingClient on channel: LicenseClient-root
    [Licensing::Module] Successfully launched and connected to LicensingClient
    Entitlement-based licensing initiated
    [LicensingClient] Licenses Updated successfully in LicensingClient
    [Licensing::Module] License is not active (com.unity.editor.headless). HasEntitlements will fail.
    Pro License: NO
    DisplayProgressbar: Unity license
    [1116/125727:ERROR:browser_main_loop.cc(161)] Running without the SUID sandbox! See xxxxx
    xcode.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment for more information on developing with the sandbox on.
    [1116/125727:ERROR:sandbox_linux.cc(308)] InitializeSandbox() called with multiple threads in process gpu-process
    [UnityConnectServicesConfig] config is NOT valid, switching to *******
    User ******************* logged in successfully

    LICENSE SYSTEM [20211116 12:57:32] Starting license activation with account *******************

    LICENSE SYSTEM [20211116 12:57:32] Opening xxxxxxlicense.unity3d.com/update/poll?cmd=9&tx_id=62c6bd40d972c8bc1ab8c9c3e1a19a00&(serial removed)

    LICENSE SYSTEM [20211116 12:57:32] Posting <?xml version="1.0" encoding="UTF-8"?><root><SystemInfo><IsoCode>C.UTF</IsoCode><UserName>(unset)</UserName><OperatingSystem>Linux 4.15 Ubuntu 18.04 64bit</OperatingSystem><OperatingSystemNumeric>415</OperatingSystemNumeric><ProcessorType>Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz</ProcessorType><ProcessorSpeed>3400</ProcessorSpeed><ProcessorCount>36</ProcessorCount><ProcessorCores>36</ProcessorCores><PhysicalMemoryMB>70340</PhysicalMemoryMB><ComputerName>b43979efe61d</ComputerName><ComputerModel>PC</ComputerModel><UnityVersion>2019.4.30f1</UnityVersion><SupportedLicenseVersion>6.x</SupportedLicenseVersion></SystemInfo><License id="Terms"><MachineID Value="D7nTUnjNAmtsUMcnoyrqkgIbYdM=" /><MachineBindings><Binding Key="1" Value="576562626572264761624c65526f7578" /><Binding Key="2" Value="576562626572264761624c65526f7578" /></MachineBindings><UnityVersion Value="2019.4.30f1" /></License></root>

    LICENSE SYSTEM [20211116 12:57:33] Received xxxxxxxxxlicense.unity3d.com/update/poll?cmd=9&tx_id=62c6bd40d972c8bc1ab8c9c3e1a19a00&(serial removed)

    LICENSE SYSTEM [20211116 12:57:33] Headers:
    HTTP/1.1 200 OK
    X-RX: GEN-f2384761-e2f7-4257-9956-27ae0ba3f682
    sc-request-id: e6a6df48-d1d1-4192-90d8-340a7fb8f0ac
    sc-token-expires-in: 7245
    Cache-Control: no-cache, no-store, must-revalidate
    Pragma: no-cache
    Expires: 0
    Vary: Accept-Encoding
    Content-Encoding: deflate
    Content-Type: text/plain
    Content-Length: 161

    LICENSE SYSTEM [20211116 12:57:33] Opening xxxxxxxxactivation.unity3d.com/license.fcgi?CMD=9&TX=62c6bd40d972c8bc1ab8c9c3e1a19a00&RX=GEN-f2384761-e2f7-4257-9956-27ae0ba3f682

    LICENSE SYSTEM [20211116 12:57:33] Posting <?xml version="1.0" encoding="UTF-8"?><root><SystemInfo><IsoCode>C.UTF</IsoCode><UserName>(unset)</UserName><OperatingSystem>Linux 4.15 Ubuntu 18.04 64bit</OperatingSystem><OperatingSystemNumeric>415</OperatingSystemNumeric><ProcessorType>Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz</ProcessorType><ProcessorSpeed>3400</ProcessorSpeed><ProcessorCount>36</ProcessorCount><ProcessorCores>36</ProcessorCores><PhysicalMemoryMB>70340</PhysicalMemoryMB><ComputerName>b43979efe61d</ComputerName><ComputerModel>PC</ComputerModel><UnityVersion>2019.4.30f1</UnityVersion><SupportedLicenseVersion>6.x</SupportedLicenseVersion></SystemInfo><License id="Terms"><MachineID Value="D7nTUnjNAmtsUMcnoyrqkgIbYdM=" /><MachineBindings><Binding Key="1" Value="576562626572264761624c65526f7578" /><Binding Key="2" Value="576562626572264761624c65526f7578" /></MachineBindings><UnityVersion Value="2019.4.30f1" /></License></root>

    LICENSE SYSTEM [20211116 12:57:34] Received xxxxxxactivation.unity3d.com/license.fcgi?CMD=9&TX=62c6bd40d972c8bc1ab8c9c3e1a19a00&RX=xxxxxxxxxxxxxxxx

    LICENSE SYSTEM [20211116 12:57:34] Headers:
    HTTP/1.1 200 OK
    sc-request-id: xxx
    Vary: Accept-Encoding
    Content-Encoding: deflate
    sc-token-expires-in: 7244
    Cache-Control: no-cache, no-store, must-revalidate
    Pragma: no-cache
    Expires: 0
    Content-Type: text/xml
    Content-Length: 1136

    LICENSE SYSTEM [20211116 12:57:34] License activated successfully with user: *******************

    LICENSE SYSTEM [20211116 12:57:34] Next license update check is after 2021-11-17T12:57:33

    [LicensingClient] Licenses Updated successfully in LicensingClient
    No valid Unity Editor license found. Please activate your license.
    Checking for leaked weakptr:
    Found no leaked weakptrs.
    ##utp:{"type":"MemoryLeaks","version":2,"phase":"Immediate","time":1637067494366,"processId":319,"allocatedMemory":119339,"memoryLabels":[{"Default":-456},{"Manager":800},{"Serialization":40},{"BaseObject":12296},{"String":14465},{"DynamicArray":214},{"Curl":1112},{"PoolAlloc":120},{"GI":3064},{"VR":80},{"Secure":41592},{"EditorUtility":3480},{"RestService":256},{"License":264},{"UnityConnect":21320},{"Collab":57},{"LocalIPC":99},{"ProfilerEditor":19880},{"Licensing":656}]}
    CircleCI received exit code 0'

    It's clearly an issue with either Unity Hub or Unity 2019.4.30 and onwards. Really looking forward to a solution from Unity side.

  2. jonalbert

    Dec 14, 2020 17:46

    patientfusion.us

  3. Unity2-3drepo

    Jun 18, 2020 15:54

    We were using containers successfully until 2019.3. We only just upgraded to 2019.3

  4. btristan

    Feb 27, 2020 22:13

    +1

    This is blocking an upgrade to Unity 2019.3 in Ubuntu containers as well.

  5. Sarbakan-Support

    Feb 13, 2020 13:45

    Looks like we can't upgrade to 2019.3 or 2020.1 either.
    At least this issue was reopened after being marked as "won't fix" at first.

  6. ScionOfDesign

    Feb 11, 2020 17:26

    If this is not fixed it will prevent us from upgrading to 2019.3.

  7. danielo_unity

    Feb 10, 2020 17:54

    After further investigation, this API (INetworkListManager::GetConnectivity) was found to be not working because the netprofm service ("Network List Service") is disabled within this container (matissehack/unity) or the base image, either by accident or by design.
    Re-enabling netprofm is insufficient, as it depends on another service (nlasvc), which must also be re-enabled.
    Furthermore, another critical service is also required, by licensing and perhaps elsewhere: WMI (wmiApSrv).
    I have not investigated beyond this point (license activation passes), but would speculate that there will be other issues (not a huge amount, but some).
    docker is not really used internally. We use VMs. docker support will take time and effort (and users).

  8. Nepoxx

    Feb 06, 2020 16:29

    How is "won't fix" acceptable for this issue?

    There's no explanation as to why, nor any workarounds. There's a lot of people using this to automate their Unity builds, this is clearly not acceptable.

    I feel like you guys are actively making sure automating our builds is a pain to sell your Unity cloud build.

  9. fake_aki

    Nov 12, 2019 12:02

    Seems like the check is just done the wrong way around, since INetworkListManager::GetConnectivity is obviously not an authoritative source of knowledge in practice. The right way would be to attempt to connect to the service first, and to perform a general Internet connectivity check on the network interface as an additional diagnostic if it fails.

    Running Unity in a Docker container is a common pattern for building CI, so this is going to present a major blocker to updating for many people. In our case, releases up to 2019.1 are working well, but with 2019.3 betas we've started to run into trouble.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.