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. Dismiss Notice

Batch mode async timeout on our build machine

Discussion in 'Editor & General Support' started by ohthepain, Jun 17, 2021.

  1. ohthepain

    ohthepain

    Joined:
    May 31, 2017
    Posts:
    100
    I am getting a crash on our build machine when I try to build the project from the command line for iOS. Android works fine.

    Batch mode async timeout on our build machine.
    Timeout after 300 seconds while waiting async operations to finish. executeMethod BuildCommand.BuildIOSDevelopment

    Command line:
    /Applications/Unity/Hub/Editor/2020.3.8f1/Unity.app/Contents/MacOS/Unity -projectPath . -executeMethod BuildCommand.BuildIOSDevelopment -buildTarget ios -logFile /Users/teamviewer/builds/wMXd-Rzw/0/thisco/<ourproject>/Build/buildLog.txt -batchmode -quit -nographics --gameVersion 1.0 --buildNumber 80

    Crash occurs regardless of whether I have deleted the Library/ folder or not. Our Library/ folder is not under source control.

    I can't find any log files and can't find a way to generated any debug output that I can see from the command line. So any tips on how to debug this would be much appreciated.

    I have attached the crash log.
     

    Attached Files:

    Petr777 likes this.
  2. ohthepain

    ohthepain

    Joined:
    May 31, 2017
    Posts:
    100
    bump. anybody?
     
  3. ohthepain

    ohthepain

    Joined:
    May 31, 2017
    Posts:
    100
    Is there seriously no way to debug this? There is no log file and no error message. I would appreciate any advice here.
     
  4. ohthepain

    ohthepain

    Joined:
    May 31, 2017
    Posts:
    100
  5. ohthepain

    ohthepain

    Joined:
    May 31, 2017
    Posts:
    100
    Bump again!
     
  6. ohthepain

    ohthepain

    Joined:
    May 31, 2017
    Posts:
    100
    Bump again. We are still suffering.

    I did a unity bug report over a week ago btw and have not heard back.
     
  7. DoalCG

    DoalCG

    Joined:
    Jul 6, 2012
    Posts:
    2
    have the same error on ios and android buids.


    Timeout after 300 seconds while waiting async operations to finish. executeMethod 'ContinuousIntegration.BuildIos'
    Aborting batchmode due to failure:
    Timeout after 300 seconds while waiting async operations to finish. executeMethod 'ContinuousIntegration.BuildIos'


    UNITY_VERSION=2021.1.10f1
    COMMAND LINE ARGUMENTS:
    /opt/unity/Editor/Unity
    -batchmode
    -nographics
    -logFile
    /dev/stdout
    -quit
    OperatingSystem: Linux 5.4 Ubuntu 18.04 64bit
     
  8. ohthepain

    ohthepain

    Joined:
    May 31, 2017
    Posts:
    100
    LMK if you figure this out! I have found no way to diagnose. No log file, no error message, no response from Unity to my crash report. And we are trying to soft launch.

    This is really crap, Unity.
     
  9. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,992
  10. ohthepain

    ohthepain

    Joined:
    May 31, 2017
    Posts:
    100
    Petr777 and futurlab_peterh like this.
  11. ohthepain

    ohthepain

    Joined:
    May 31, 2017
    Posts:
    100
    Same thing. Seems to be in IsArtifactStillRelevant called from GarbageCollection.

    Is it still possible to select asset database pipeline v1? I don't see that option anymore.



    Process: Unity [69883]
    Path: /Applications/Unity/*/Unity.app/Contents/MacOS/Unity
    Identifier: com.unity3d.UnityEditor5.x
    Version: Unity version 2020.3.8f1 (2020.3.8f1)
    Code Type: X86-64 (Translated)
    Parent Process: java [60351]
    Responsible: gitlab-runner [56767]
    User ID: 502Date/Time: 2021-06-29 15:24:34.793 +0200
    OS Version: macOS 11.3.1 (20E241)
    Report Version: 12
    Anonymous UUID: DF9114C6-F25D-38FC-8C10-748841C561A2Sleep/Wake UUID: DC08C46B-0319-4075-82DF-114E25009481Time Awake Since Boot: 3700000 seconds
    Time Since Wake: 15000 secondsSystem Integrity Protection: enabledCrashed Thread: 0 Dispatch queue: com.apple.main-threadException Type: EXC_BAD_ACCESS (SIGSEGV)
    Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000020
    Exception Note: EXC_CORPSE_NOTIFYTermination Signal: Segmentation fault: 11
    Termination Reason: Namespace SIGNAL, Code 0xb
    Terminating Process: exc handler [69883]VM Regions Near 0x20:
    -->
    __TEXT 102d20000-10a0dc000 [115.7M] r-x/r-x SM=COW /Applications/Unity/*/Unity.app/Contents/MacOS/UnityThread 0 Crashed:: Dispatch queue: com.apple.main-thread
    0 com.unity3d.UnityEditor5.x 0x00000001062a1fd9 IsArtifactStillRelevant(ArtifactDBReadTxn const&, SourceAssetDBReadTxn const&, ArtifactDependencies const*) + 41
    1 com.unity3d.UnityEditor5.x 0x00000001062a2697 GarbageCollectArtifacts() + 935
    2 com.unity3d.UnityEditor5.x 0x000000010621f5f6 InitializeAssetDatabaseV2(bool, bool, bool, int*) + 5334
    3 com.unity3d.UnityEditor5.x 0x000000010617d67a AssetDatabase::InitializeAssetDatabase(bool, bool, bool, int*) + 58
    4 com.unity3d.UnityEditor5.x 0x000000010552c9f1 Application::InitializeProject() + 5649
    5 com.unity3d.UnityEditor5.x 0x000000010777ef5c NoGraphicsMain() + 60
    6 com.unity3d.UnityEditor5.x 0x000000010777f258 EditorMain(int, char const**) + 664
    7 com.unity3d.UnityEditor5.x 0x000000010777f499 main + 9
    8 libdyld.dylib 0x00007fff20359f3d start + 1
     
  12. DoalCG

    DoalCG

    Joined:
    Jul 6, 2012
    Posts:
    2
    we found a solution. at the end of the build method add:
    Code (CSharp):
    1. EditorApplication.Exit(0);
     
    cdr9042 likes this.
  13. ohthepain

    ohthepain

    Joined:
    May 31, 2017
    Posts:
    100
    Thanks for your reply. This is our iOS build method that times out:

    Code (CSharp):
    1.     public static void BuildIOSCommand(bool development)
    2.     {
    3.         string[] scenes = GetBuildScenes();
    4.         string path = GetBuildPath("iPhone");
    5.         if (scenes == null || scenes.Length == 0 || path == null)
    6.         {
    7.             return;
    8.         }
    9.  
    10.         ApplyIOSBuildSettings(development);
    11.         BuildPipeline.BuildPlayer(scenes, path, BuildTarget.iOS, BuildOptions.None);
    12.         EditorApplication.Exit(0);
    13.     }
     
  14. Dar_tech

    Dar_tech

    Joined:
    Jan 20, 2021
    Posts:
    2
    Have the same issue with building android/webgl/ios. Anybody have a solve this problem?
     
  15. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,505
    Has anyone reported a bug on this?
     
  16. Sam0waR

    Sam0waR

    Joined:
    Nov 30, 2015
    Posts:
    26
    Happens to me to in 2021.3.4f1.

    [B]00:17:14.136[/B] Unloading 3493 Unused Serialized files (Serialized files now loaded: 0)

    [B]00:17:14.137[/B] Unloading 9867 unused Assets / (41.3 MB). Loaded Objects now: 10217.
    [B]00:17:14.137[/B] Memory consumption went from 3.29 GB to 3.25 GB.
    [B]00:17:14.137[/B] Total: 172.041789 ms (FindLiveObjects: 3.671067 ms CreateObjectMapping: 2.023264 ms MarkObjects: 125.328326 ms DeleteObjects: 41.016549 ms)
    [B]00:17:14.137
    00:17:14.138[/B] Build Finished, Result: Success.
    [B]00:17:14.138[/B] Unloading 0 Unused Serialized files (Serialized files now loaded: 0)
    [B]00:17:14.138[/B] Loaded scene 'Temp/__Backupscenes/0.backup'
    [B]00:17:14.138[/B] Deserialize: 2.837 ms
    [B]00:17:14.138[/B] Integration: 89.112 ms
    [B]00:17:14.138[/B] Integration of assets: 0.003 ms
    [B]00:17:14.138[/B] Thread Wait Time: 0.103 ms
    [B]00:17:14.138[/B] Total Operation Time: 92.054 ms
    [B]00:17:14.139[/B] Unloading 0 unused Assets / (1.3 KB). Loaded Objects now: 10217.
    [B]00:17:14.139[/B] Memory consumption went from 3.00 GB to 3.00 GB.
    [B]00:17:14.139[/B] Total: 63.663365 ms (FindLiveObjects: 1.645270 ms CreateObjectMapping: 0.944650 ms MarkObjects: 61.033065 ms DeleteObjects: 0.038118 ms)
    [B]00:17:14.139
    00:17:14.139[/B] Timeout after 120 seconds while waiting async operations to finish. executeMethod 'BatchBuilder.Build'
    [B]00:17:14.139
    00:17:14.139[/B] Aborting batchmode due to failure:
    [B]00:17:14.139[/B] Timeout after 120 seconds while waiting async operations to finish. executeMethod 'BatchBuilder.Build'
    [B]00:17:14.139
    00:17:14.300[/B] [Package Manager] Server::Kill -- Server was shutdown
    [B]00:17:14.304[/B] AcceleratorClientConnectionCallback - disconnected - 127.0.0.1:10080
    [B]00:17:14.313
    00:17:14.313[/B] =================================================================
    [B]00:17:14.313[/B] Native Crash Reporting
    [B]00:17:14.313[/B] =================================================================
    [B]00:17:14.313[/B] Got a segv while executing native code. This usually indicates
    [B]00:17:14.313[/B] a fatal error in the mono runtime or one of the native libraries
    [B]00:17:14.313[/B] used by your application.
    [B]00:17:14.313[/B] =================================================================
    [B]00:17:14.313
    00:17:14.313[/B] =================================================================
    [B]00:17:14.313[/B] Native stacktrace:
    [B]00:17:14.313[/B] =================================================================
    [B]00:17:14.314[/B] 0x19f4aa6c2 - /Applications/Unity/Hub/Editor/2021.3.4f1/Unity.app/Contents/Frameworks/MonoBleedingEdge/MonoEmbedRuntime/osx/libmonobdwgc-2.0.dylib : mono_dump_native_crash_info
    [B]00:17:14.314[/B] 0x19f450978 - /Applications/Unity/Hub/Editor/2021.3.4f1/Unity.app/Contents/Frameworks/MonoBleedingEdge/MonoEmbedRuntime/osx/libmonobdwgc-2.0.dylib : mono_handle_native_crash
    [B]00:17:14.315[/B] 0x19f3ccd65 - /Applications/Unity/Hub/Editor/2021.3.4f1/Unity.app/Contents/Frameworks/MonoBleedingEdge/MonoEmbedRuntime/osx/libmonobdwgc-2.0.dylib : mono_sigsegv_signal_handler_debug
     
  17. JeffersonFerreira

    JeffersonFerreira

    Joined:
    May 11, 2020
    Posts:
    5
    Hey guys.
    I was struggling with a similar problem and found out I had some API calls using the `TaskCompletionSource` class to convert regular callbacks into awaitables.

    The editor does not process the method correctly in batch mode and simply timeouts.

    This is the code I had before (works fines but not in batch mode)
    Code (CSharp):
    1. public static async Task<T> ToAsync<T>(this T operation) where T : AsyncOperation
    2. {
    3.     var completionSource = new TaskCompletionSource<T>();
    4.     operation.completed += op => completionSource.SetResult(operation);
    5.     return await completionSource.Task;
    6. }
    And now
    Code (CSharp):
    1. public static async Task<T> ToAsync<T>(this T operation) where T : AsyncOperation
    2. {
    3.     while (!operation.isDone)
    4.         await Task.Yield();
    5.  
    6.     return operation;
    7. }
     
  18. FracEdd

    FracEdd

    Joined:
    Aug 25, 2017
    Posts:
    3
    We had the same problem with the build timing out and the workaround was to use EditorApplication.Exit(0); and remove -quit from the command line.

    I think adding the -quit caused Unity to start monitoring your function. The method they a using to monitor the activity of your function obviously can't handle async/await pattern and thinks that the app is stalled and eventually timeouts.

    I think that makes sense as to why @JeffersonFerreira's workaround works because you're spinning in a loop it makes Unity think that the main function is active.
     
    JeffersonFerreira likes this.
  19. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,877
    This is happening for us on cloud build builds