Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Bug Install Unity with Gitlab-Runner through Powershell failing with Error Code 2

Discussion in 'Testing & Automation' started by Kinggrass, Feb 7, 2023.

  1. Kinggrass

    Kinggrass

    Joined:
    Jun 7, 2016
    Posts:
    73
    Hi everyone and the Unity-Team,

    like the titel is saying I am trying to install the Unity Editor through the Powershell with the Gitlab-Runner and using the Tool from Microsoft for this:
    https://github.com/microsoft/unitysetup.powershell

    and it does crash during the process in line 927 and the error code is handled in line 930:

    upload_2023-2-7_11-2-15.png

    It returns with Error Code 2 what is the meaning of this?
    The PowerShell is running with Admin rights, this can't be a permission issue?

    The Log of the run can be seen here:

    upload_2023-2-7_11-5-2.png

    What I also tried was to run the script myself on the runner machiene and it worked with the only difference that in my powershell environment the noninteractive mode is disabled and I had to accept the installation myself. But thats not a option here.

    Anyone who could help or could point me in some directions to find the issue?

    Best Regards
     
  2. Kinggrass

    Kinggrass

    Joined:
    Jun 7, 2016
    Posts:
    73
    Hello @martin-unity,

    I am sorry to bother you again.
    Recently we where in a dialog about my issue here: https://forum.unity.com/threads/uni...ne-machine-despite-activated-license.1388163/

    And like I said I wanted to get back to you after I have automated our Unity-Setup for our pipeline runners.
    Unfortunatly I am stuck again and I could need some internal help from you again to proceed.

    You can see my issue above but especially I am interested what the ExitCode 2 of the UnitySetup64-2021.3.16f1.exe means with what the installer returns after starting it.

    If I run it myself with the Powershell I get a dialog if I want to install it and the rest of the script runs through.
    But if run via the Gitlab-Runner which also uses the Powershell but in noninteractive mode this ErrorCode is returned instead.
    Thats done on the same machine.

    Could you have some advice what I could check?