Skip to content

fix(ubuntu): pass -username/-password to -returnlicense, restoring parity with mac/windows - #271

Open
wschnepp wants to merge 1 commit into
game-ci:mainfrom
wschnepp:fix/return-license-credentials
Open

wschnepp wants to merge 1 commit into
game-ci:mainfrom
wschnepp:fix/return-license-credentials

Conversation

@wschnepp

@wschnepp wschnepp commented Sep 11, 2026

Copy link
Copy Markdown

Changes

  • dist/platforms/ubuntu/steps/return_license.sh: pass -username/-password to
    unity-editor -returnlicense in the serial branch, matching activate.sh and the
    mac/windows return scripts.
  • scripts/test-licensing-steps.sh: assert a serial return carries both credentials.

The problem

On Ubuntu, a serial-mode license return can never succeed. Every run ends with:

[Licensing::Module] Error: Access token is unavailable; failed to update
[Licensing::Module] Error: Failed to return entitlement license
[Licensing::Module] Error: Serial number unavailable for ULF return; skipping operation
##[warning] Failed to return the Unity license after 4 attempts - this seat may still be held

activate.sh launches the editor with -serial/-username/-password and logs
User *** logged in successfully. return_license.sh launches a fresh editor and a
fresh licensing client with no credentials at all, so it has no access token and cannot
release the entitlement. The seat is then held until Unity expires it server-side.

Because Access token is unavailable and Serial number unavailable are both in
UNITY_LICENSE_RETURN_TRANSIENT_PATTERN, this permanent auth failure is also retried with
the full 20s + 40s + 80s backoff before giving up — 146 seconds per run, every run.

This is a one-platform regression, not a new feature

Every other return script in the repo already passes these flags:

Script -username/-password
dist/platforms/mac/steps/return_license.sh yes
dist/platforms/windows/steps/return_license.ps1 yes
dist/platforms/windows/return_license.ps1 yes
plugins/unity/**/platforms/ubuntu/return_license.sh (vendored, pre-extraction) yes
dist/platforms/ubuntu/steps/return_license.sh no

The windows script's own comment already states the rule this restores:

-returnlicense missing -username/-password - both required for a SERIAL-mode return,
same as mac/steps/return_license.sh and the host-mode windows/return_license.ps1
already pass

The pre-extraction Ubuntu copy still vendored under plugins/unity/ passes them
unconditionally, so Ubuntu had this behaviour for years and lost it when the steps script
was extracted.

Verification

Same image, same container, same scripts — only these two flags differ.

Before (current main, four attempts over 146s):

[Licensing::Module] Error: Access token is unavailable; failed to update
[Licensing::Module] Error: Failed to return entitlement license

After (this branch, sourcing the real activate.sh + return_license.sh with
dist/platforms/ubuntu/steps mounted at /steps in unityci/editor:ubuntu-6000.3.8f1-windows-mono-3):

Licensing method: serial
ACTIVATE_EXIT=0
[Licensing::Module] Successfully returned the entitlement license
[Licensing::Client] Successfully returned ULF license with serial number : "SC-..."
RETURN_EXIT=0

4.5 seconds, first attempt, no backoff.

Unit tests: scripts/test-licensing-steps.sh reports 60 passed with the fix. With the
change to return_license.sh reverted and the new assertions kept, exactly the two new
assertions fail (58 passed, 2 FAILED) — nothing else moves.

Version coverage

Unity documents -returnlicense as taking -username/-password identically across every
line in this repo's test matrix — checked 2018.4, 2019.4, 2020.3, 2022.3 and 6000.x, spanning
both the pre-entitlement ULF system and Unity 6 licensing:
https://docs.unity3d.com/Manual/ManagingYourUnityLicense.html

Checklist

  • Read the contribution guide and accept the code of conduct
  • Readme (updated or not needed)
  • Tests (added, updated or not needed)

Summary by CodeRabbit

  • Tests
    • Added regression coverage to verify that serial-mode license returns pass the account username and password to the licensing service.

…ot fail

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 5e18e42c-0736-48c8-974a-98cd28797385

📥 Commits

Reviewing files that changed from the base of the PR and between b971614 and bb3ed20.

⛔ Files ignored due to path filters (1)
  • dist/platforms/ubuntu/steps/return_license.sh is excluded by !**/dist/**
📒 Files selected for processing (1)
  • scripts/test-licensing-steps.sh

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The licensing step tests serial returns with complete serial and account credentials. The test asserts that the licensing client receives both the username and password.

Changes

Licensing regression coverage

Layer / File(s) Summary
Serial return credential assertion
scripts/test-licensing-steps.sh
Adds a serial return test that verifies forwarding of the account username and password to the licensing client.

Priority: ➖ Normal

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Suggested reviewers: frostebite

Merge Risk: ⚪ Minimal · up to bb3ed

The serial license return fix and regression coverage are ready to merge; no actionable current-head risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the Ubuntu serial-mode license return fix and the credentials passed to -returnlicense.
Description check ✅ Passed The description includes the required Changes and Checklist sections. It explains the problem, implementation, verification results, and test coverage. All checklist items are addressed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@wschnepp

Copy link
Copy Markdown
Author

@webbertakken / @frostebite Hey, sorry to ask, but do i have to do something more for this to actually be merged?

I see that there were additional similar fixes merged on the main branch just a few hours ago, so i am wondering why this has not been included.

Our CI action is being slowed down by this problem and we'd be happy for this to be resolved

@frostebite

Copy link
Copy Markdown
Member

Thanks for this — the diagnosis is exactly right, and it turned out to be bigger than the serial path.

Four days after you opened this, #277 hit the identical three error strings on the personal path, found from our licensing matrix logs rather than from your PR. Same root cause: the return launches a fresh editor with no credentials, so it has no access token and cannot release the entitlement. You got there first.

Your branch is behind a fairly heavy rewrite of return_license.sh and scripts/test-licensing-steps.sh (#274, #276, #277, #278), so I've carried your commit — authorship intact — up to current main in #280, since I can't push to your fork from here. Your fix is untouched; only a merge and an asset rebuild on top. Your two assertions still pass and are still load-bearing: removing the credentials fails exactly those two and nothing else.

Worth saying that your test is the only guard on this. The licensing matrix can't catch it — its serial cells grade unmeasurable because it runs activate and return-license in separate containers, so the return is refused on machine bindings regardless.

Happy to merge #280 in your name, or if you'd rather update this branch yourself, say so and I'll close #280 instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants