game-ci / unity-test-runner

Run tests for any Unity project
https://github.com/marketplace/actions/unity-test-runner
MIT License
206 stars 135 forks source link

'Unclassified error occured while trying to activate license.' #251

Closed JackSinkoRB closed 8 months ago

JackSinkoRB commented 9 months ago

Bug description

I'm trying to run some automatic tests but get the error 'Unclassified error occured while trying to activate license.'.

I've set up the license in secrets after following https://game.ci/docs/github/activation#personal-license.

Full error:

Run game-ci/unity-test-runner@v4
/usr/bin/docker run --workdir /github/workspace --cidfile /home/runner/work/_temp/container_tests --rm --env UNITY_LICENSE --env UNITY_LICENSE_FILE --env UNITY_EMAIL --env UNITY_PASSWORD --env UNITY_SERIAL --env UNITY_LICENSING_SERVER= --env UNITY_VERSION=2022.3.10f1 --env PROJECT_PATH=. --env CUSTOM_PARAMETERS= --env TEST_PLATFORMS=playmode --env COVERAGE_OPTIONS=generateAdditionalMetrics;generateHtmlReport;generateBadgeReport;assemblyFilters:+my.assembly.* --env COVERAGE_RESULTS_PATH=CodeCoverage --env ARTIFACTS_PATH=playmode-artifacts --env PACKAGE_MODE=false --env PACKAGE_NAME= --env GITHUB_REF --env GITHUB_SHA --env GITHUB_REPOSITORY --env GITHUB_ACTOR --env GITHUB_WORKFLOW --env GITHUB_HEAD_REF --env GITHUB_BASE_REF --env GITHUB_EVENT_NAME --env GITHUB_WORKSPACE=/github/workspace --env GITHUB_ACTION --env GITHUB_EVENT_PATH --env RUNNER_OS --env RUNNER_TOOL_CACHE --env RUNNER_TEMP --env RUNNER_WORKSPACE --env GIT_PRIVATE_TOKEN= --env CHOWN_FILES_TO= --env GIT_CONFIG_EXTENSIONS --volume /home/runner/work/_temp/_github_home:/root:z --volume /home/runner/work/_temp/_github_workflow:/github/workflow:z --volume /home/runner/work/Gumball/Gumball:/github/workspace:z --volume /home/runner/work/_actions/game-ci/unity-test-runner/v4/dist/test-standalone-scripts:/UnityStandaloneScripts:z --volume /home/runner/work/_actions/game-ci/unity-test-runner/v4/dist/steps:/steps:z --volume /home/runner/work/_actions/game-ci/unity-test-runner/v4/dist/entrypoint.sh:/entrypoint.sh:z --volume /home/runner/work/_actions/game-ci/unity-test-runner/v4/dist/unity-config:/usr/share/unity3d/config/:z --cpus=2 --memory=6575m --env USE_EXIT_CODE=false unityci/editor:ubuntu-2022.3.10f1-linux-il2cpp-3 /bin/bash -c /entrypoint.sh
Unable to find image 'unityci/editor:ubuntu-2022.3.10f1-linux-il2cpp-3' locally
ubuntu-2022.3.10f1-linux-il2cpp-3: Pulling from unityci/editor
aece8493d397: Pulling fs layer
6c95c69724ac: Pulling fs layer
003176c79e7f: Pulling fs layer
df190a31a7f2: Pulling fs layer
4f4fb700ef54: Pulling fs layer
a3481a166284: Pulling fs layer
53b15d6b852d: Pulling fs layer
06c94de13781: Pulling fs layer
44c4cae5b9a2: Pulling fs layer
76e9650b5bc2: Pulling fs layer
df190a31a7f2: Waiting
4f4fb700ef54: Waiting
a3481a166284: Waiting
53b15d6b852d: Waiting
06c94de13781: Waiting
44c4cae5b9a2: Waiting
76e9650b5bc2: Waiting
76ef758d7f19: Pulling fs layer
76ef758d7f19: Waiting
d4db56dd5a96: Pulling fs layer
d4db56dd5a96: Waiting
6c95c69724ac: Verifying Checksum
6c95c69724ac: Download complete
aece8493d397: Verifying Checksum
aece8493d397: Download complete
4f4fb700ef54: Verifying Checksum
4f4fb700ef54: Download complete
df190a31a7f2: Verifying Checksum
df190a31a7f2: Download complete
a3481a166284: Verifying Checksum
a3481a166284: Download complete
53b15d6b852d: Verifying Checksum
53b15d6b852d: Download complete
06c94de13781: Verifying Checksum
06c94de13781: Download complete
003176c79e7f: Verifying Checksum
003176c79e7f: Download complete
76e9650b5bc2: Verifying Checksum
76e9650b5bc2: Download complete
76ef758d7f19: Verifying Checksum
76ef758d7f19: Download complete
aece8493d397: Pull complete
d4db56dd5a96: Verifying Checksum
d4db56dd5a96: Download complete
6c95c69724ac: Pull complete
003176c79e7f: Pull complete
df190a31a7f2: Pull complete
4f4fb700ef54: Pull complete
a3481a166284: Pull complete
53b15d6b852d: Pull complete
06c94de13781: Pull complete
44c4cae5b9a2: Verifying Checksum
44c4cae5b9a2: Download complete
44c4cae5b9a2: Pull complete
76e9650b5bc2: Pull complete
76ef758d7f19: Pull complete
d4db56dd5a96: Pull complete
Digest: sha256:90cbcfafd078c8def4be3eb1828d6d81fb6ed5f73ed46803a4c872ccb5a7a976
Status: Downloaded newer image for unityci/editor:ubuntu-2022.3.10f1-linux-il2cpp-3
Changing to "/github/workspace/_activate-license" directory.
/github/workspace/_activate-license /github/workspace
Requesting activation (personal license)
Unclassified error occured while trying to activate license.
Exit code was: 1
Error: The process '/usr/bin/docker' failed with exit code 1

How to reproduce

I'm using the workflow:

name: Test project

on: [push, pull_request]

jobs:
  testAllModes:
    name: Test in ${{ matrix.testMode }}
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        testMode:
          - playmode
          - editmode
    steps:
      - uses: actions/checkout@v4
        with:
          lfs: true
      - uses: actions/cache@v3
        with:
          path: ${{ matrix.projectPath }}/Library
          key: Library-${{ matrix.projectPath }}
          restore-keys: |
            Library-
      - uses: game-ci/unity-test-runner@v4
        id: tests
        env:
          UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
        with:
          projectPath: ${{ matrix.projectPath }}
          testMode: ${{ matrix.testMode }}
          artifactsPath: ${{ matrix.testMode }}-artifacts
          githubToken: ${{ secrets.GITHUB_TOKEN }}
          checkName: ${{ matrix.testMode }} Test Results
          coverageOptions: 'generateAdditionalMetrics;generateHtmlReport;generateBadgeReport;assemblyFilters:+my.assembly.*'
      - uses: actions/upload-artifact@v3
        if: always()
        with:
          name: Test results for ${{ matrix.testMode }}
          path: ${{ steps.tests.outputs.artifactsPath }}
      - uses: actions/upload-artifact@v3
        if: always()
        with:
          name: Coverage results for ${{ matrix.testMode }}
          path: ${{ steps.tests.outputs.coveragePath }}
GabLeRoux commented 9 months ago

This is indeed a big problem right now. Since the upgrade to v4, activation broke in game-ci/unity-test-runner@v4. This is the same error as https://github.com/game-ci/unity-builder/issues/485 but the solution provided in following comment https://github.com/game-ci/unity-builder/issues/485#issuecomment-1749412929 won't work.

There is an open discussion about this on discord:
https://discord.com/channels/710946343828455455/1175793166645997698

The solution is most likely to implement the same activation logic as in builder and release a new patch version for the game-ci/unity-test-runner action.

GabLeRoux commented 9 months ago

Just saw a useful message in linked discord thread;

cN3rd: Tried a workaround with manually passing the serial (like you do with a professional license) and it seemed to work

Might be a good workaround until we have an actual fix fix this 👍

JackSinkoRB commented 9 months ago

I don't think Unity personal gives a serial number?

GabLeRoux commented 9 months ago

Yes it does. It's hardcoded in the license file from these locations:

<SerialMasked Value="AA-BBBB-CCCC-DDDD-EEEE-XXXX"/>

But it seems to be masked. I itentionnaly obfuscated the first parts, but the last XXXX are actual Xs. Not sure if it'll work, but it's worth trying.

JackSinkoRB commented 9 months ago

I added the serial to a secret and changed the workflow to:

  - uses: game-ci/unity-test-runner@v4
    id: tests
    env:
      UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
      UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
      UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}

It failed, although it seems to have gotten further than before:

Run game-ci/unity-test-runner@v4
/usr/bin/docker run --workdir /github/workspace --cidfile /home/runner/work/_temp/container_tests --rm --env UNITY_LICENSE --env UNITY_LICENSE_FILE --env UNITY_EMAIL --env UNITY_PASSWORD --env UNITY_SERIAL --env UNITY_LICENSING_SERVER= --env UNITY_VERSION=2022.3.10f1 --env PROJECT_PATH=. --env CUSTOM_PARAMETERS= --env TEST_PLATFORMS=editmode --env COVERAGE_OPTIONS=generateAdditionalMetrics;generateHtmlReport;generateBadgeReport;assemblyFilters:+my.assembly.* --env COVERAGE_RESULTS_PATH=CodeCoverage --env ARTIFACTS_PATH=editmode-artifacts --env PACKAGE_MODE=false --env PACKAGE_NAME= --env GITHUB_REF --env GITHUB_SHA --env GITHUB_REPOSITORY --env GITHUB_ACTOR --env GITHUB_WORKFLOW --env GITHUB_HEAD_REF --env GITHUB_BASE_REF --env GITHUB_EVENT_NAME --env GITHUB_WORKSPACE=/github/workspace --env GITHUB_ACTION --env GITHUB_EVENT_PATH --env RUNNER_OS --env RUNNER_TOOL_CACHE --env RUNNER_TEMP --env RUNNER_WORKSPACE --env GIT_PRIVATE_TOKEN= --env CHOWN_FILES_TO= --env GIT_CONFIG_EXTENSIONS --volume /home/runner/work/_temp/_github_home:/root:z --volume /home/runner/work/_temp/_github_workflow:/github/workflow:z --volume /home/runner/work/Gumball/Gumball:/github/workspace:z --volume /home/runner/work/_actions/game-ci/unity-test-runner/v4/dist/test-standalone-scripts:/UnityStandaloneScripts:z --volume /home/runner/work/_actions/game-ci/unity-test-runner/v4/dist/steps:/steps:z --volume /home/runner/work/_actions/game-ci/unity-test-runner/v4/dist/entrypoint.sh:/entrypoint.sh:z --volume /home/runner/work/_actions/game-ci/unity-test-runner/v4/dist/unity-config:/usr/share/unity3d/config/:z --cpus=2 --memory=6575m --env USE_EXIT_CODE=false unityci/editor:ubuntu-2022.3.10f1-linux-il2cpp-3 /bin/bash -c /entrypoint.sh
Unable to find image 'unityci/editor:ubuntu-2022.3.10f1-linux-il2cpp-3' locally
ubuntu-2022.3.10f1-linux-il2cpp-3: Pulling from unityci/editor
aece8493d397: Pulling fs layer
6c95c69724ac: Pulling fs layer
003176c79e7f: Pulling fs layer
df190a31a7f2: Pulling fs layer
4f4fb700ef54: Pulling fs layer
a3481a166284: Pulling fs layer
53b15d6b852d: Pulling fs layer
06c94de13781: Pulling fs layer
df190a31a7f2: Waiting
4f4fb700ef54: Waiting
a3481a166284: Waiting
53b15d6b852d: Waiting
44c4cae5b9a2: Pulling fs layer
76e9650b5bc2: Pulling fs layer
76ef758d7f19: Pulling fs layer
06c94de13781: Waiting
44c4cae5b9a2: Waiting
76e9650b5bc2: Waiting
76ef758d7f19: Waiting
d4db56dd5a96: Pulling fs layer
d4db56dd5a96: Waiting
6c95c69724ac: Verifying Checksum
6c95c69724ac: Download complete
aece8493d397: Verifying Checksum
aece8493d397: Download complete
df190a31a7f2: Verifying Checksum
df190a31a7f2: Download complete
4f4fb700ef54: Verifying Checksum
4f4fb700ef54: Download complete
a3481a166284: Verifying Checksum
a3481a166284: Download complete
53b15d6b852d: Verifying Checksum
53b15d6b852d: Download complete
06c94de13781: Verifying Checksum
06c94de13781: Download complete
76e9650b5bc2: Verifying Checksum
76e9650b5bc2: Download complete
76ef758d7f19: Verifying Checksum
76ef758d7f19: Download complete
003176c79e7f: Verifying Checksum
003176c79e7f: Download complete
aece8493d397: Pull complete
d4db56dd5a96: Verifying Checksum
d4db56dd5a96: Download complete
6c95c69724ac: Pull complete
003176c79e7f: Pull complete
df190a31a7f2: Pull complete
4f4fb700ef54: Pull complete
a3481a166284: Pull complete
53b15d6b852d: Pull complete
06c94de13781: Pull complete
44c4cae5b9a2: Verifying Checksum
44c4cae5b9a2: Download complete
44c4cae5b9a2: Pull complete
76e9650b5bc2: Pull complete
76ef758d7f19: Pull complete
d4db56dd5a96: Pull complete
Digest: sha256:90cbcfafd078c8def4be3eb1828d6d81fb6ed5f73ed46803a4c872ccb5a7a976
Status: Downloaded newer image for unityci/editor:ubuntu-2022.3.10f1-linux-il2cpp-3
Changing to "/github/workspace/_activate-license" directory.
/github/workspace/_activate-license /github/workspace
Requesting activation (professional license)
Unity Editor version:    2022.3.10f1 (ff3792e53c62)
Branch:                  2022.3/staging
Build type:              Release
Batch mode:              YES
System name:             Linux
Distro version:          game-ci/unity-actions#18~22.04.1-Ubuntu SMP Tue Nov 21 19:25:02 UTC 2023
Kernel version:          6.2.0-1018-azure
Architecture:            x86_64
Available memory:        6921 MB
CreateDirectory '/root/.cache/unity3d' failed:  (current dir: /github/workspace/_activate-license)
User *** logged in successfully
[UnityConnect::TryLogin] Request Succeeded.
[Licensing::Module] Trying to connect to existing licensing client channel...
[Licensing::IpcConnector] Connection attempt to the License Client on channel: "LicenseClient-root" failed because channel doesn't exist; code: "0x80000002"
[Licensing::Module] Successfully launched the LicensingClient (PId: 28)
[Licensing::IpcConnector] Successfully connected to the License Client on channel: "LicenseClient-root" at "2023-12-10T01:29:38.828834Z"
[SignatureVerifier] Application signature verification not supported on this platform.
[Licensing::Client] Handshaking with LicensingClient:
  Version:                 1.13.1+ca5f299
  Session Id:              ec599a7f9250432b8d4bd2307882d5ce
  Correlation Id:          c4a2b027c1f86b351ae25808f8336206
  External correlation Id: 1403733608355365329
  Machine Id:              D7nTUnjNAmtsUMcnoyrqkgIbYdM=
[Licensing::Module] Successfully connected to LicensingClient on channel: "LicenseClient-root" (connect: 0.75s, validation: 0.08s, handshake: 0.00s)
[Licensing::IpcConnector] Successfully connected to the License Notification on channel: "LicenseClient-root-notifications" at "2023-12-10T01:29:38.911103Z"
[Licensing::Module] Connected to LicensingClient (PId: 28, launch time: 0.00, total connection time: 0.83s)
[Licensing::Client] Successfully updated the access token
[Licensing::Module] Successfully updated the access token M1_U8Joa88...
[Licensing::Client] Successfully processed license management request
[Licensing::Module] Successfully activated the entitlement license
[Licensing::Client] Successfully queried for the EntitlementGroupsDetails
[Licensing::Client] Error: Code 20110 while processing request (status: serial invalid)
[Licensing::Module] License activation has failed. Aborting.
Checking for leaked weakptr:
  Found no leaked weakptrs.
Memory Statistics:
[ALLOC_TEMP_TLS] TLS Allocator
  StackAllocators : 
    [ALLOC_TEMP_CurlRequest]
      Initial Block Size 64.0 KB
      Current Block Size 64.0 KB
      Peak Allocated Bytes 0 B
      Overflow Count 0
    [ALLOC_TEMP_CoreBusinessMetricsCache]
      Initial Block Size 64.0 KB
      Current Block Size 64.0 KB
      Peak Allocated Bytes 0 B
      Overflow Count 0
    [ALLOC_TEMP_Profiler.Dispatcher]
      Initial Block Size 64.0 KB
      Current Block Size 64.0 KB
      Peak Allocated Bytes 0 B
      Overflow Count 0
    [ALLOC_TEMP_AssetGarbageCollectorHelper]
      Initial Block Size 64.0 KB
      Current Block Size 64.0 KB
      Peak Allocated Bytes 0 B
      Overflow Count 0
[ALLOC_MEMORYPROFILER]
  Requested Block Size 1.0 MB
  Peak Block count 1
  Peak Allocated memory 4.5 KB
  Peak Large allocation bytes 0 B
##utp:{"type":"MemoryLeaks","version":2,"phase":"Immediate","time":1702171782938,"processId":22,"allocatedMemory":94355,"memoryLabels":[{"Default":530},{"Thread":64},{"Manager":6794},{"Serialization":52},{"BaseObject":12376},{"String":5886},{"HashMap":12372},{"Utility":1024},{"Curl":1112},{"GI":2920},{"CloudService":168},{"VR":80},{"Secure":6608},{"EditorUtility":256},{"RestService":1022},{"License":3608},{"UnityConnect":25432},{"Collab":25},{"LocalIPC":212},{"ProfilerEditor":10831},{"TLS":2983}]}
Unclassified error occured while trying to activate license.
Exit code was: 1
Error: The process '/usr/bin/docker' failed with exit code 1
GabLeRoux commented 9 months ago

Yeah last bit about XXXX is probably what's causing the serial to be wrong.

...
[Licensing::Client] Error: Code 20110 while processing request (status: serial invalid)
[Licensing::Module] License activation has failed. Aborting.
...

I did not find any related docs. I found the serial in Unity > About, but it's also masked.

edit: we have some logic here that does it.

JackSinkoRB commented 9 months ago

It seems to work after following the instructions from v3

https://game.ci/docs/3/github/activation#personal-license

AndrewKahr commented 8 months ago

Can you try game-ci/unity-test-runner@unity-builder-parity and see if the activation issues got better

AndrewKahr commented 8 months ago

Closing as many are reporting activation is fixed