Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Unity Hub exit codes incorrect

Discussion in 'Unity Hub' started by jamiebrynes, Mar 27, 2020.

  1. jamiebrynes

    jamiebrynes

    Joined:
    Sep 12, 2017
    Posts:
    18
    Hi there,

    I'm having a problem trying to run the Unity Hub in an automated and headless fashion. Many commands are returning non-zero exit codes where they appear to succeed.

    This means that I cannot assert against command failures in my scripts and must parse the standard out to try and determine whether the command succeeded or not. This is less than ideal.

    For example (ran in Git Bash):

    Code (CSharp):
    1.  
    2. /c/Program\ Files/Unity\ Hub/Unity\ Hub.exe -- --headless install-path --set "E:/Unity"
    3.  
    4. (node:22344) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
    5. All Unity Editors will be installed to E:/Unity
    6.  
    This command appears to succeed (ignoring the deprecation warning), but if I check the exit code (echo $?), the exit code is 1.

    I've observed this happening for installing Unity versions over the CLI too:

    Code (CSharp):
    1. /c/Program\ Files/Unity\ Hub/Unity\ Hub.exe -- --headless install --version 2019.3.7f1 --changeset
    2. 6437fd74d35d
    displays the same behaviour.

    I'm using Unity Hub version 2.3.0.
     
  2. sprice_nct

    sprice_nct

    Joined:
    Sep 16, 2019
    Posts:
    5
    Hey Jamie

    I too see this in uses of the CLI arguments for the Unity Hub on the saem version as well. Have you had any luck with it up to this point:

    @bradunity would you be able to see if this is something the Hub team are aware of or could investigate?
     
    nih_ likes this.
  3. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,015
    Same problem here using latest version 2.4.2...
     
  4. xrtk-build-bot

    xrtk-build-bot

    Joined:
    Jul 17, 2019
    Posts:
    4
    This has been a problem for a long time. I was told that is was the correct behaviour and the bug issue was closed.
     
    bdovaz likes this.
  5. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,015
    o_O:eek:

    I think it's more, "this is the mess we've made and you have to live with it."
     
  6. BenjiM_Unity

    BenjiM_Unity

    Unity Technologies

    Joined:
    Aug 8, 2017
    Posts:
    165
    Thank you so much for the details, I’ve gone ahead and documented the conversation and shared it with the team. I’ll pass along any insight or updates they may have!
     
    xrtk-build-bot likes this.
  7. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,015
  8. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,015
  9. JonnyPatonSI

    JonnyPatonSI

    Joined:
    Jun 24, 2021
    Posts:
    1
    Yeah this is bonkers - if it's by design, then what's the intended way to tell whether a Unity Hub CLI command succeeded or not?