game-ci / docker

Series of CI-specialised docker images for Unity.
https://hub.docker.com/u/unityci
MIT License
392 stars 122 forks source link

Unable to activate Unity 2020.3.17 or newer #161

Closed st0nerhat closed 6 months ago

st0nerhat commented 2 years ago

Bug description

I am unable to activate Unity from the command line on the linux container in versions >= 2020.3.17. This effects some versions of Unity 2019.4. It does not effect Unity 2021.2.x. This started happening on Thursday 3/3/22. I'm not sure it has anything to do with the image, but I'm posting this here because the steps are simple and I'm not seeing this reported anywhere else.

How to reproduce

UNITY_VERSION=2020.3.17f1 # (or 2020.3.30f1)
IMAGE=unityci/editor # https://hub.docker.com/r/unityci/editor
IMAGE_VERSION=0.17.2 # https://github.com/game-ci/docker/releases
DOCKER_IMAGE=$IMAGE:$UNITY_VERSION-base-$IMAGE_VERSION

docker run -it --rm \
-e "UNITY_USERNAME=username@example.com" \
-e "UNITY_PASSWORD=example_password" \
-e "UNITY_SERIAL=AN-EXAM-PLE-SERIA-LKEY-1234" \
-e "TEST_PLATFORM=linux" \
-e "WORKDIR=/root/project" \
-v "$(pwd):/root/project" \
$DOCKER_IMAGE \
bash

xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' \
unity-editor \
-logFile /dev/stdout \
-batchmode \
-nographics \
-username "$UNITY_USERNAME" -password "$UNITY_PASSWORD" -serial "$UNITY_SERIAL"

....

LICENSE SYSTEM [202237 5:19:44] License activated successfully with user: **************

LICENSE SYSTEM [202237 5:19:44] Next license update check is after 2022-03-08T05:19:45

[LicensingClient] Licenses updated successfully
No valid Unity Editor license found. Please activate your license.

This returns a zero exit code.

The license is in fact activated and running unity again from the command line succeeds. Returning the license also succeeds.

Expected behavior

....
[LicensingClient] Licenses updated successfully
[Licensing::Module] Serial number assigned to: "XXXX-XXXXX"
[Package Manager] Server::Start -- Port 38965 was selected
....

Additional details

davidmfinol commented 2 years ago

This returns a zero exit code. The license is in fact activated and running unity again from the command line succeeds. Returning the license also succeeds.

@st0nerhat This sounds like the activation did actually succeed, and the No valid Unity Editor license found. Please activate your license. message can simply be disregarded. Is this actually an issue?

st0nerhat commented 2 years ago

The problem comes when I want to run -executeMethod somemethod in the same unity command as when I activate the license. It exits before loading the project or running the command.

davidmfinol commented 2 years ago

I'd recommend first doing the activation in one step, and then running the -executeMethod in a follow-up second step. That's the pattern that our GitHub Actions use, and I don't know if there's anything that we can do from the GameCI side to ensure that that can you both activate and build in a single command.