Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Upload symbols to Cloud Diagnostics when building from command line

Discussion in 'Unity Cloud Diagnostics' started by stopiccot_onthespot, Dec 29, 2018.

  1. stopiccot_onthespot

    stopiccot_onthespot

    Joined:
    Oct 1, 2016
    Posts:
    68
    On our CI server we build iOS build by running BuildPipeline.BuildPlayer() in Editor batch mode. Turns out that Xcode project that is exported that way has empty USYM_UPLOAD_AUTH_TOKEN and because of that process_symbols.sh step fails to upload symbols to Unity Cloud Diagnostics. Looks like editor do not log-in into unity cloud services when running in batch mode. I've checked that by calling UnityEditor.Connect.UnityConnect.instance.GetAccessToken() in post build step and it returned empty string. Is there any way to force Unity Editor to log-in to cloud services when running in batch mode? Or maybe I can obtain upload auth token by some REST api calls in by post build steps?
     
  2. johng_unity

    johng_unity

    Unity Technologies

    Joined:
    Nov 5, 2015
    Posts:
    158
    Unfortunately, symbol upload does not work in batch mode.
     
  3. benzo-turbo

    benzo-turbo

    Joined:
    Jan 28, 2015
    Posts:
    1
    Are there any plans to make it work in the future?
     
  4. johng_unity

    johng_unity

    Unity Technologies

    Joined:
    Nov 5, 2015
    Posts:
    158
    We are currently working on a change to support batch mode for symbol upload. We'll be able to provide more details on what versions of Unity the change will be available in a couple of weeks.
     
  5. maxthecat

    maxthecat

    Joined:
    May 26, 2014
    Posts:
    27
    Any updates on this?
     
  6. johng_unity

    johng_unity

    Unity Technologies

    Joined:
    Nov 5, 2015
    Posts:
    158
    We have made a change to support this in our mainline branch and we are now working on identifying which versions of Unity the change can be brought to.
     
  7. stopiccot_onthespot

    stopiccot_onthespot

    Joined:
    Oct 1, 2016
    Posts:
    68
    I really hope this will be backported to upcoming 2018.4 LTS
     
  8. rumaniel

    rumaniel

    Joined:
    Jun 3, 2015
    Posts:
    4
    Please inform to this thread which version applied. o_O
     
  9. ryanc-unity

    ryanc-unity

    Unity Technologies

    Joined:
    Mar 23, 2016
    Posts:
    1,204
    Sorry for the delay on this. This fix will be backported up to 2018.4. You should expect it in the latest patch, 2018.4.1, as well as in 2019.1.3f1.
     
    rumaniel likes this.
  10. stopiccot_onthespot

    stopiccot_onthespot

    Joined:
    Oct 1, 2016
    Posts:
    68
    In Unity 2019.1.3 patch notes there is a line:
    Services: Fixed symbol upload for Cloud Diagnostics not working in batch mode. (851655, 1140370)
    Can't find the same for 2018.4.1
     
  11. ilterbilguven

    ilterbilguven

    Joined:
    Feb 1, 2018
    Posts:
    4
    After upgrading from 2018.4.0f1 to 2018.4.1f1, I can't build ios projects with jenkins, it gives "Please provide an auth token with USYM_UPLOAD_AUTH_TOKEN environment variable" error. With 2018.4.0f1, everything is fine.
     
  12. fhickman

    fhickman

    Joined:
    Feb 10, 2016
    Posts:
    8
    I found that to be the case when upgrading from 2018.4.0f1 to 2018.4.1f1 as well. Adding the "-username" and "-password" options to the Unity command line arguments seemed to resolve it, however.
     
    ryanc-unity likes this.
  13. Zynek7

    Zynek7

    Joined:
    Mar 15, 2017
    Posts:
    3
    I have the same issue with USYM_UPLOAD_AUTH_TOKEN in Unity 2019.1.3f1. I tried to follow fhickman's advice and now i am getting this error:

    build 14-Jun-2019 17:00:23 [UnityConnectServicesConfig] config is NOT valid, switching to default
    error 14-Jun-2019 17:00:23 [warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
    error 14-Jun-2019 17:00:23 [warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
    error 14-Jun-2019 17:00:23 [warn] kq_init: detected broken kqueue; not using.: Undefined error: 0

    Anybody encountered that ?
     
  14. MildaGenius2

    MildaGenius2

    Joined:
    May 6, 2013
    Posts:
    13
    I have the same problem in 2018.4.3f1 :(

    First missing file usymtool.

    Code (CSharp):
    1. Users/mmalek/tests/Repro/YlandsClassID91/Builds/iOS/DEV_mobile/Dist/Ylands/process_symbols.sh: line 8: /Users/mmalek/tests/Repro/YlandsClassID91/Builds/iOS/DEV_mobile/Dist/Ylands/usymtool: No such file or directory
    After copy missing script from Unity app (Unity.app/Contents/Tools/macosx/) and rerun xCode build I got error.

    Code (CSharp):
    1. Please provide an auth token with USYM_UPLOAD_AUTH_TOKEN environment variable
     
    Last edited: Jul 8, 2019
  15. DarekRusin

    DarekRusin

    Joined:
    Nov 15, 2013
    Posts:
    27
    Also just got bitten by this USYM_UPLOAD_AUTH_TOKEN bug in 2018.4.2.

    @ryanc-unity any idea when the fix will be backported to the LTS branch? Is there any proper workaround while we're waiting? Thanks!
     
  16. ryanc-unity

    ryanc-unity

    Unity Technologies

    Joined:
    Mar 23, 2016
    Posts:
    1,204
    Hi @DarekRusin, I'm sorry for the late response. When using Cloud Diagnostics with -batchmode it's now required that you specify both the -username and -password arguments to avoid the USYM_UPLOAD_AUTH_TOKEN error message.

    We are currently looking into a known issue where using the -runTests argument throws this same error on iOS even after including both -username and -password. You can track our progress on that fix here.
     
    DarekRusin likes this.
  17. DarekRusin

    DarekRusin

    Joined:
    Nov 15, 2013
    Posts:
    27
    @ryanc-unity thanks so much! I did not now that specifying username and password is now required. Once I've added these, everything started working properly :)
     
    ryanc-unity likes this.
  18. Bonich

    Bonich

    Joined:
    Oct 25, 2012
    Posts:
    2
    In teamcity we fix it, by patching process_symbols.sh in xcode project.

    Just change strings with usymtool on something like there:

    #!/bin/sh

    # process_symbols
    #
    # Copyright (c) 2015 Unity Technologies. All rights reserved.

    if [ "${SYNCHRONOUS_SYMBOL_PROCESSING}" = "TRUE" ]; then

    echo test

    else
    nohup "$PROJECT_DIR/usymtool" -symbolPath "$DWARF_DSYM_FOLDER_PATH/$DWARF_DSYM_FILE_NAME" > /dev/null 2>&1 &
    disown
    fi