Search Unity

Unity Personal for CI: License activation not working

Discussion in 'Editor & General Support' started by Zechy, Apr 28, 2021.

  1. Zechy

    Zechy

    Joined:
    Nov 10, 2016
    Posts:
    22
    Hello,

    I am trying to activate license on my AWS CodeBuild. I am using unityci/editor:ubuntu-2020.1.17f1-windows-mono-0.12.0.

    I have script for creating manual activation file
    Code (CSharp):
    1. #!/usr/bin/env bash
    2.  
    3. LOG_OUTPUT=./unity-output.log
    4. ACTIVATION_FILE=./Unity_v2020.1.17f1.alf
    5.  
    6. echo "Retrieving activation file for Unity"
    7. unity-editor -batchmode -nographics -logFile /dev/stdout -quit -createManualActivationFile | tee "$LOG_OUTPUT"
    8. UNITY_EXIT_CODE=$?
    9.  
    10. if [[ $UNITY_EXIT_CODE -eq 0 ]] || [[ $UNITY_EXIT_CODE -eq 1 ]]; then
    11.     echo "Manual activation file successfully created"
    12.     echo "Created as artifact $ACTIVATION_FILE"
    13.     exit 0
    14. else
    15.     echo "Error while requesting activation file"
    16.     exit $UNITY_EXIT_CODE
    17. fi
    Which will successfully create the *.alf file. So I download this artifact. Go to manual license page. Download generated *.ulf file and content of this file is set as env variable UNITY_LICENSE.

    Code (CSharp):
    1. #!/usr/bin/env bash
    2.  
    3. OUTPUT_FILE=./unity-output.log
    4. FILE_PATH=./UnityLicense.ulf
    5.  
    6. echo "Requesting activation"
    7. echo "$UNITY_LICENSE" | tr -d '\r' > $FILE_PATH
    8.  
    9. ACTIVATION_OUTPUT=$(unity-editor -nographics -logFile /dev/stdout -quit -manualLicenseFile "$FILE_PATH")
    10. UNITY_EXIT_CODE=$?
    11. ACTIVATION_SUCCESSFUL=$(echo $ACTIVATION_OUTPUT | grep 'Next license update check is after' | wc -l)
    12. echo "$ACTIVATION_OUTPUT" > "$OUTPUT_FILE"
    13.  
    14. if [[ $ACTIVATION_SUCCESSFUL -eq 1 ]]; then
    15.     UNITY_EXIT_CODE=0
    16. fi
    17.  
    18. rm -f $FILE_PATH
    19.  
    20. if [ $UNITY_EXIT_CODE -eq 0 ]; then
    21.     echo "Unity activation completed."
    22.     exit 0
    23. else
    24.     echo "Error during license activation occured."
    25.     echo "Exit code was: $UNITY_EXIT_CODE"
    26.     exit $UNITY_EXIT_CODE
    27. fi
    The output should contains "Next license update check", but for me, the output ends with info License file loaded.

    Code (CSharp):
    1. [Licensing::Module] Channel doesn't exist: "LicenseClient-root"
    2. [Licensing::Module] Successfully launched the LicensingClient (PId: 83)
    3. [SignatureVerifier] Application signature verification not supported on this platform.
    4. [Licensing::Module] Successfully connected to LicensingClient on channel: "LicenseClient-root" (connect: 0.81s, validation: 0.20s, handshake: 0.00s)
    5. [Licensing::Module] Connected to LicensingClient (PId: 83, launch time: 0.00, total connection time: 1.01s)
    6. Entitlement-based licensing initiated
    7. [LicensingClient] Licenses updated successfully
    8.  
    9. Load manual activation license file.
    10.  
    11. LICENSE SYSTEM [2021428 7:59:57] Load license file from: ./UnityLicense.ulf
    12.  
    13. License file loaded.
    14.  
    I suppose unity for some reason does not process the rest of license activation, but I can't tell why.... What I am missing here?
     
    nedaei1375 likes this.
  2. Zechy

    Zechy

    Joined:
    Nov 10, 2016
    Posts:
    22
    I tried run the docker image locally and guess what? It is working as it should be... Where is the difference?
     
  3. Zechy

    Zechy

    Joined:
    Nov 10, 2016
    Posts:
    22
    I have found something finally. Somewhere I read, that the process of -manualLicenseFile is, that Unity copy license file into /root/.local/share/unity3d/Unity as Unity_lic.ulf. So I write check script into pre_build and post_build phase.

    PRE_BUILD: File neither location does not exists.
    BUILD: Launch activation
    POST_BUILD: Location does exists. File does not exists.
     
  4. Zechy

    Zechy

    Joined:
    Nov 10, 2016
    Posts:
    22
    I can't but just laugh... It was about the env var from AWS... There was probably some malformation to it (the reason could be, that AWS have only single line input for it). I provided the license as a file inside source codes... It's working.