Comments (8)
In some failing cases, the output will be different.
tl; dr
How to check activation result:
unity-editor -quit -logFile activation.log -manualLicenseFile <UNITY_LICENSE_FILE>
[ -z "`grep -e 'Next license update check is after' activation.log`" ] && echo 'error: Failed to load license file'
[ -n "`grep -e 'Failed to load license file from' activation.log`" ] && echo 'error: Failed to load license file'
[ -n "`grep -e 'LICENSE SYSTEM.* != ' activation.log`" ] && echo 'error: Machine ID is different'
Success
$ unity-editor -quit -logFile /dev/stdout -manualLicenseFile success.ulf
...
Load manual activation license file.
LICENSE SYSTEM [2021120 17:25:14] Load license file from: success.ulf
LICENSE SYSTEM [2021120 17:25:14] Next license update check is after 2021-01-21T17:04:09
License file loaded.
Failed: Machine ID is different
$ unity-editor -quit -logFile /dev/stdout -manualLicenseFile unmatched_machine_id.ulf
...
Load manual activation license file.
LICENSE SYSTEM [2021120 17:11:47] Load license file from: unmatched_machine_id.ulf
LICENSE SYSTEM [2021120 17:11:47] Next license update check is after 2021-01-21T17:10:34
LICENSE SYSTEM [2021120 17:11:47] 576562626572264761624c65526f7578 != B2DD8DE7-7E63-5962-95B4-3EEA5A1718C0
LICENSE SYSTEM [2021120 17:11:47] 576562626572264761624c65526f7578 != C02VQ158HTDG
License file loaded.
Failed: The input file is not found
$ unity-editor -quit -logFile /dev/stdout -manualLicenseFile non_exist.ulf
...
Load manual activation license file.
LICENSE SYSTEM [2021120 17:20:50] Load license file from: non_exist.ulf
LICENSE SYSTEM [2021120 17:20:50] Failed to load license file from: non_exist.ulf
License file loaded.
Failed: The input file is empty
$ unity-editor -quit -logFile /dev/stdout -manualLicenseFile empty.ulf
...
Load manual activation license file.
LICENSE SYSTEM [2021120 17:13:55] Load license file from: empty.ulf
LICENSE SYSTEM [2021120 17:13:55] Failed to load license file from: empty.ulf
License file loaded.
Failed: The input file is alf
$ unity-editor -quit -logFile /dev/stdout -manualLicenseFile Unity.alf
...
Load manual activation license file.
LICENSE SYSTEM [2021120 17:17:5] Load license file from: Unity.alf
LICENSE SYSTEM [2021120 17:17:5] Could not find digest XML element in license file.
License file loaded.
Failed: The structure of the input file is different
$ unity-editor -quit -logFile /dev/stdout -manualLicenseFile different_structure.ulf
...
Load manual activation license file.
LICENSE SYSTEM [2021120 17:15:16] Load license file from: different_structure.ulf
License file loaded.
from docker.
Thank you for reporting this issue.
This is a bug in Unity editor itself, which doesn't omit a non-zero exit code when hardware ids mismatch or in some cases where invalid licenses are given.
Workaround
Most people move past this by fixing their activation while setting up their project, since the actual build step uses proper exit codes (which you can extend yourself inside the build script).
Additional information
It's a bug that predates this very repository and has been reported in unity-actions, unity-builder and in repository of the preceeding images gableroux/unity3d and the gableroux/unity3d-gitlab-ci-example.
Since we can't rely on exit code (pre-build-time anyway) we would have to either inject something in the binary or somehow extract the right information out of the output. So far nobody has come up with a reliable way to do this.
To anyone reading this, feel free to reopen if you have suggestions on how to solve this in an elegant way.
from docker.
So if we want to support this, we should have some way to parse unity's output to provide more insights on the error. It is probably feasible, but the solution should be discussed as this is definitely something that can make things more complicated in the project (and we want to keep actions as simple as possible here).
Edit: I missed the How to check activation result:
part above sorry for confusion.
Should we execute unity command with tee
instead? example: | tee unity_stdout.log
and after the step, cat unity_stdout.log | grep '<some possible errors>'
?
-logFile /dev/stdout
should be kept otherwise, output won't be streamed to job's stdout.
Or is it possible (and desired) to run suggested command above and then proceed with a build in the actions?
from docker.
If we pipe it into an application, it should be something that can also forward non-zero exit codes while still logging to console.
Or perhaps we can use PIPESTATUS[0]
as explained in this answer on StackOverflow.
from docker.
Reopening as it seems we have some ways to move forward. I have attempted it before, back when starting builder action, but I didn't manage to get it to work back then.
PRs are most welcome on this one :)
from docker.
Closed. For details - @webbertakken
from docker.
When a license activation fails, additional context can be output using the solution described above.
For example:
- Run Unity with
-createManualActivationFile
option to create and output a new alf file- Users can fix the license activation error without any new workflow (
unity-request-activation-file
action)
- Users can fix the license activation error without any new workflow (
- Output about "how to activate a license" (i.e. "what should you do next")
- e.g. "See the
Converting into a license
section in https://game.ci/docs/github/activation"
- e.g. "See the
Do you have any suggestions?
from docker.
I really like that idea, however I would keep them separate for now. The idea is to fully automate activation.
There's an issue for it game-ci/unity-builder#193.
So I'd keep the scope to activation only for now (thus excluding requesting activation file).
from docker.
Related Issues (20)
- unity-hub headless option does not seem to work properly HOT 5
- Missing WebGL/Android building docker containers for Windows HOT 2
- Build Failed on unityci/editor:2021.3.22f1-windows-mono-1.1 HOT 1
- Support for Windows Server 2022 HOT 1
- Build fails for editor-ubuntu-2023.1.0f1-webgl-1.1.2 with URP
- Update ubuntu version from 18.04 to 22.04 HOT 3
- Manifest unknown for certain images on unityci/editor but not for others. HOT 2
- Stop supporting EOL versions of Unity Editor
- manifest for unityci/editor:2022.3.8f1-linux-il2cpp-1 not found HOT 1
- manifest for unityci/editor:windows-2021.3.16f1-webgl-2 not found HOT 1
- "Build succeeded" but still getting "There was an error..." HOT 1
- Pass env vars set in workflow file to docker environment HOT 6
- Fail to build containers because of failing git lfs checkout HOT 2
- docker: invalid reference format: repository name must be lowercase. HOT 4
- Unable to Generate Logs and Hanging Execution with unityci/editor Docker Image on Mac with Apple Silicon HOT 1
- xvfb-run is not invoked as root user when using runAsHostUser
- GameCI WebGL builds have no audio. HOT 1
- Licensing issue with non root user
- Intermittent crashes when running unity builds on docker.
- Dedicated Server support for Linux is not installed after updating from 2022.3.16f1 to 6000.0.0f1 HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker.