fix: non-user-friendly error when trying to install the worker agent as domain user #457
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What was the problem/requirement? (What/Why)
When trying to run the worker agent installer and configure the worker agent to run as a domain user, the installer fails a non-user-friendly message.
For example, on a domain-joined worker host, running:
produces the error:
If you then try adding the
--grant-required-access
, you then see:This is because the
install-deadline-worker
command was not designed for use with domain users (see #458). The installer calls win32 APIs that do not support specifying domain users in one format or another (User Principal Name (UPN) or Down-Level Logon Name).While working on this, I discovered that
InstallerFailedException
exceptions being raised by validation checks in the Windows installer code were not being caught. This resulted in the validation errors showing up as non-friendly Python stack traces instead of clean looking error messages.What was the solution? (How)
The Windows installer code was modified to validate the user name supplied in the
--user
argument. If the username contains a\
or@
character, which is a signal that the username is UPN or down-level logon name, then the installer fails fast with a clear and actionable error:I also modified the installer entrypoint to handle
InstallerFailedException
exceptions and format them into human-readable output.What is the impact of this change?
install-deadline-worker
) and supplying a domain user for the agent to run as with the--user
argument get a user-friendly and actionable error message indicating this is not supported but that they can run jobs as a domain user by configuring their Deadline queue.InstallerFailedException
exceptions will no longer output stack traces, but instead nicely formatted error messages.How was this change tested?
Was this change documented?
Code comments were added and behavior was changed to improve an error message.
Is this a breaking change?
No
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.