unity-azure-pipelines-tasks icon indicating copy to clipboard operation
unity-azure-pipelines-tasks copied to clipboard

UnityBuildV3: Infinite build process

Open axtox opened this issue 4 years ago • 7 comments

After 3.1.0 release Unity Build task doesn't end at all. We've faced this weird problem some time ago - but there was a workaround. To be able to build with Unity Task we were building our projects manually on the server for the first time, and then it will work as it should until server restart (sound like some kind of a temp files are generated on the very first run that couldn't be handled by Unity Pipeline Task). This trick doesn't after Unity Pipeline Task 3.1 release.

However, if we use hard-coded Command Line task to build the project - it will works just fine.

image

For Android we use: $(UnityEditorPath) -batchmode -buildTarget Android -projectPath $(Build.SourcesDirectory) -logfile Editor.log -executeMethod AutomatedBuild.Build For PC we use: $(UnityEditorPath) -batchmode -buildTarget Win -projectPath $(Build.SourcesDirectory) -logfile Editor.log -executeMethod AutomatedBuild.Build

What I noticed as well is that when Unity Pipeline Task starts it definitely runs the Editor on the background and project starts building. But at some point after build has finished and output files are generated Unity Task still running image Do you have any ideas? Maybe I can find Unity Pipeline .log files somewhere? Nothing useful were printed in the TFS console.

axtox avatar Apr 24 '20 13:04 axtox

The build task should with the latest update be streaming live build logs to the Azure DevOps console. Anything weird going on there? I understand you are building on a custom agent?

I'll look into this. Thanks.

FejZa avatar Apr 25 '20 08:04 FejZa

We are building on Custom Build Agent install downloaded from TFS official site with some Environment Variables specified for Android SDK

Nothing useful were printed in the TFS console.

Well, there's something actually! It depends from project to project, but here's some logs from our definitions. This one ran for 5hrs and was automatically cancelled based on 'Maximum build time' definition setting:

2020-04-27T05:03:44.3816474Z ==============================================================================
2020-04-27T05:03:44.3816529Z Task         : Unity Build
2020-04-27T05:03:44.3816550Z Description  : Build a Unity project and get the exported output files.
2020-04-27T05:03:44.3816578Z Version      : 3.1.1
2020-04-27T05:03:44.3816599Z Author       : Dinomite Studios
2020-04-27T05:03:44.3816618Z Help         : Builds a Unity project to supported build target platforms. [More Information](https://github.com/Dinomite-Studios/unity-azure-pipelines-tasks)
2020-04-27T05:03:44.3816643Z ==============================================================================
2020-04-27T05:03:45.8875976Z Determining Unity editor version for project at D:\programs\VSTS Agent\_work\16\s
2020-04-27T05:03:45.8900264Z Success, Unity editor version found 2018.4.14f1, alpha=false, beta=false
2020-04-27T05:03:45.9121561Z [command]D:\UnityEditors\2018.4.14f1\Editor\Unity.exe -batchmode -buildTarget Android -projectPath "D:\programs\VSTS Agent\_work\16\s" -logfile "D:\programs\VSTS Agent\_work\16\s\Logs\UnityBuildLog_2020-04-27-07-03-45.log" -logfile Editor.log -executeMethod AutomatedBuild.Build
2020-04-27T05:04:23.1300185Z [16112:1308:20200427,070423.125:ERROR crash_report_database_win.cc:569] CreateDirectory : The system cannot find the path specified. (3)
2020-04-27T05:21:04.8966140Z 
2020-04-27T10:00:47.5491192Z ##[error]The operation was canceled.
2020-04-27T10:00:47.5499885Z ##[section]Finishing: Unity Android Build 

And this one run with Unity Pipeline Task 3.1.0 and with Editors Path environment variable set. It was cancelled by me after 1.5hrs of running:

2020-04-23T12:38:19.7664102Z ##[section]Starting: Unity Android Build 
2020-04-23T12:38:19.7827428Z ==============================================================================
2020-04-23T12:38:19.7827480Z Task         : Unity Build
2020-04-23T12:38:19.7827501Z Description  : Build a Unity project and get the exported output files.
2020-04-23T12:38:19.7827526Z Version      : 3.1.0
2020-04-23T12:38:19.7827549Z Author       : Dinomite Studios
2020-04-23T12:38:19.7827567Z Help         : Builds a Unity project to supported build target platforms. [More Information](https://github.com/Dinomite-Studios/unity-azure-pipelines-tasks)
2020-04-23T12:38:19.7827587Z ==============================================================================
2020-04-23T12:38:20.8592740Z Determining Unity editor version for project at D:\programs\VSTS Agent\_work\22\s
2020-04-23T12:38:20.8824341Z Success, Unity editor version found 2018.4.14f1, alpha=false, beta=false
2020-04-23T12:38:20.9076498Z [command]D:\UnityEditors\2018.4.14f1\Editor\Unity.exe -batchmode -buildTarget Android -projectPath "D:\programs\VSTS Agent\_work\22\s" -logfile "D:\programs\VSTS Agent\_work\22\s\Logs\UnityBuildLog_2020-04-23-14-38-20.log" -executeMethod AutomatedBuild.Build
2020-04-23T12:38:24.2441175Z 
2020-04-23T14:09:49.6328567Z ##[error]The operation was canceled.
2020-04-23T14:09:49.6339081Z ##[section]Finishing: Unity Android Build 

And that one ran with 3.1.0 as well with Editors Variable set, it has some Oculus VR relative issues for unknown reasons, but it is working fine when we build it with Console Taks (as I described above):

2020-04-23T14:39:34.5662350Z ==============================================================================
2020-04-23T14:39:34.5662399Z Task         : Unity Build
2020-04-23T14:39:34.5662421Z Description  : Build a Unity project and get the exported output files.
2020-04-23T14:39:34.5662447Z Version      : 3.1.0
2020-04-23T14:39:34.5662466Z Author       : Dinomite Studios
2020-04-23T14:39:34.5662485Z Help         : Builds a Unity project to supported build target platforms. [More Information](https://github.com/Dinomite-Studios/unity-azure-pipelines-tasks)
2020-04-23T14:39:34.5662933Z ==============================================================================
2020-04-23T14:39:35.4568157Z Determining Unity editor version for project at D:\programs\VSTS Agent\_work\22\s
2020-04-23T14:39:35.4814732Z Success, Unity editor version found 2018.4.14f1, alpha=false, beta=false
2020-04-23T14:39:35.5157452Z [command]D:\UnityEditors\2018.4.14f1\Editor\Unity.exe -batchmode -buildTarget Android -projectPath "D:\programs\VSTS Agent\_work\22\s" -logfile "D:\programs\VSTS Agent\_work\22\s\Logs\UnityBuildLog_2020-04-23-16-39-35.log" -executeMethod AutomatedBuild.Build
2020-04-23T14:39:39.1276720Z [OVRPlugin][ERROR] ovr_Initialize failed: Unable to connect to service: AccessFailure: Client doesn't have the required rights
2020-04-23T14:51:01.7854995Z  (c:\cygwin\data\sandcastle\boxes\trunk-hg-ovrsource-full\software\oculussdk\integrations\ovrplugin\main\src\util\compositorcapi.cpp:79)debugger-agent: Unable to listen on 3736
2020-04-23T14:51:01.8295149Z [OVRPlugin][INFO] OVRInterface plugin library location: D:\Oculus\Support\oculus-runtime\client-plugins\x64[OVRPlugin][INFO] OVRInterface plugin libraries:
2020-04-23T14:51:01.8295372Z <none>[OVRPlugin][INFO] OVRInterface classes and interfaces:
2020-04-23T14:51:01.8295470Z     Class Id: 792827050195102385, class Name: OVRExtensionAddition
2020-04-23T14:51:01.8296303Z       Interface Id: 792827049859634464
2020-04-23T14:51:01.8296411Z     Class Id: 12685232797847161537, class Name: OpenXRExtensionAddition
2020-04-23T14:51:01.8296446Z       Interface Id: 12685232797847161536
2020-04-23T14:51:02.2182606Z [OVRPlugin][INFO] LibOVR module is located at D:\Oculus\Support\oculus-runtime\LibOVRRT64_1.dll
2020-04-23T15:27:00.0938423Z ##[error]The operation was canceled.
2020-04-23T15:27:00.0946839Z ##[section]Finishing: Unity Android Build 

axtox avatar Apr 27 '20 14:04 axtox

We're seeing the same issue on version 2.5.1. Times out after the max set allowed, 600 minutes, or about 10 hours

It's also worth noting, this was working the day before on 2.4.6. The day it updated to 2.5.1 it started to stall.

2020-04-23T00:04:37.0065118Z ##[section]Starting: Unity Build UWP
2020-04-23T00:04:37.0201782Z ==============================================================================
2020-04-23T00:04:37.0201875Z Task         : Unity Build
2020-04-23T00:04:37.0201912Z Description  : Build a Unity project and get the exported output files.
2020-04-23T00:04:37.0201950Z Version      : 2.5.1
2020-04-23T00:04:37.0202012Z Author       : Dinomite Studios
2020-04-23T00:04:37.0202048Z Help         : Builds a Unity project to supported build target platforms. [More Information](https://github.com/Dinomite-Studios/unity-azure-pipelines-tasks)
2020-04-23T00:04:37.0202086Z ==============================================================================
2020-04-23T00:04:37.6615028Z Determining Unity editor version for project at C:\Azure DevOps W10 Agent\_work\8\s\XR Runtime
2020-04-23T00:04:37.6615222Z Success, Unity editor version found 2018.4.6f1, alpha=false, beta=false
2020-04-23T00:04:37.6747576Z [command]"C:\Program Files\Unity\Hub\Editor\2018.4.6f1\Editor\Unity.exe" -batchmode -buildTarget WindowsStoreApps -projectPath "C:\Azure DevOps W10 Agent\_work\8\s\XR Runtime" -logfile "C:\Azure DevOps W10 Agent\_work\8\s\Logs\UnityBuildLog_2020-04-22-20-04-37.log" -executeMethod AzureDevOps.PerformBuild
2020-04-23T00:34:05.4045869Z debugger-agent: Unable to listen on 2316
2020-04-23T00:34:05.9144236Z 
2020-04-23T10:00:22.3418737Z ##[error]The operation was canceled.
2020-04-23T10:00:22.3435074Z ##[section]Finishing: Unity Build UWP

DI-ZachLHelms avatar Apr 27 '20 20:04 DI-ZachLHelms

I am still investigating here, I hope to get back to you soon.

FejZa avatar Apr 30 '20 14:04 FejZa

If you need more information about projects, settings that we use or anything - just ask

axtox avatar May 07 '20 11:05 axtox

Hi there, any news on this issue?

axtox avatar Jun 03 '20 22:06 axtox

I just tried the suggested method in #137 issue - no luck. I've added the '-quit' flag into the Unity Build Pipeline Task attachments section. We will use custom command line task for now, still looking forward for the fix.

axtox avatar Jun 05 '20 06:06 axtox