Hello, after I open Unity with Jenkins, I will always be stuck in Starting Server.., then I will pop up the box. the logs is: 17:20:53 [Package Manager] Server::Start -- Port 62432 was selected 17:20:53 Launching external process: /Applications/Unity/Hub/Editor/2020.1.0a5/Unity.app/Contents/Resources/PackageManager/Server/UnityPackageManager 17:20:53 17:20:53 COMMAND LINE ARGUMENTS: 17:20:53 /Applications/Unity/Hub/Editor/2020.1.0a5/Unity.app/Contents/MacOS/Unity 17:20:53 -projectPath 17:20:53 /var/root/.jenkins/workspace/iOS-XProj/Client 17:20:53 -executeMethod 17:20:53 PostBuildCommonProject.Build 17:20:53 -logFile 17:20:53 /var/root/.jenkins/workspace/iOS-XProj/editor.log 17:20:53 Platform-iOS 17:20:53 Successfully changed project path to: /var/root/.jenkins/workspace/iOS-XProj/Client 17:20:53 /private/var/root/.jenkins/workspace/iOS-XProj/Client 17:20:53 Using Asset Import Pipeline V2. 17:20:54 path.js:28 17:20:54 throw new TypeError('Path must be a string. Received ' + inspect(path)); 17:20:54 ^ 17:20:54 17:20:54 TypeError: Path must be a string. Received undefined 17:20:54 at assertPath (path.js:28:11) 17:20:54 at Object.join (path.js:1236:7) 17:20:54 at getLogFolder (/snapshot/upm/packages/server/logging.js:0:0) 17:20:54 at Object.enableLogging (/snapshot/upm/packages/server/logging.js:0:0) 17:20:54 at Object.<anonymous> (/snapshot/upm/packages/server/app.js:0:0) 17:20:54 at Module._compile (pkg/prelude/bootstrap.js:1252:22) 17:20:54 at Object.Module._extensions..js (module.js:661:10) 17:20:54 at Module.load (module.js:563:32) 17:20:54 at tryModuleLoad (module.js:503:12) 17:20:54 at Function.Module._load (module.js:495:3) 17:20:54 at Function.Module.runMain (pkg/prelude/bootstrap.js:1307:12) 17:20:54 at startup (bootstrap_node.js:227:16) 17:20:54 at bootstrap_node.js:648:3 17:20:54 [Package Manager] Server::CheckExitCode -- Server stopped with exit code `1` 17:20:54 [Package Manager] PackageManager Server::Start -- Process restart attempt #2 17:20:54 17:20:54 [Package Manager] Server::Start -- Port 54502 was selected 17:20:54 Launching external process: /Applications/Unity/Hub/Editor/2020.1.0a5/Unity.app/Contents/Resources/PackageManager/Server/UnityPackageManager 17:20:54 [Package Manager] Cannot connect to Unity Package Manager local server 17:20:54 path.js:28 17:20:54 throw new TypeError('Path must be a string. Received ' + inspect(path)); 17:20:54 ^ 17:20:54 17:20:54 TypeError: Path must be a string. Received undefined 17:20:54 at assertPath (path.js:28:11) 17:20:54 at Object.join (path.js:1236:7) 17:20:54 at getLogFolder (/snapshot/upm/packages/server/logging.js:0:0) 17:20:54 at Object.enableLogging (/snapshot/upm/packages/server/logging.js:0:0) 17:20:54 at Object.<anonymous> (/snapshot/upm/packages/server/app.js:0:0) 17:20:54 at Module._compile (pkg/prelude/bootstrap.js:1252:22) 17:20:54 at Object.Module._extensions..js (module.js:661:10) 17:20:54 at Module.load (module.js:563:32) 17:20:54 at tryModuleLoad (module.js:503:12) 17:20:54 at Function.Module._load (module.js:495:3) 17:20:54 at Function.Module.runMain (pkg/prelude/bootstrap.js:1307:12) 17:20:54 at startup (bootstrap_node.js:227:16) 17:20:54 at bootstrap_node.js:648:3 17:20:54 [Package Manager] Server::CheckExitCode -- Server stopped with exit code `1` 17:20:54 [Package Manager] PackageManager Server::Start -- Process restart attempt #3 the jenkins command line is : -projectPath ${workspace}/Client -executeMethod PostBuildCommonProject.Build -logFile ${workspace}/editor.log Platform-$Platform my os is macos10.14.6 unity version is: 2020.1.0a5 and 2019.3.0b4, they all have problems. then I press diagnose.
@Yijiankeji, We identified the issues you're running into and added them to our bug tracker. The HOME environment variable doesn't seem to be set, which could be explained by the fact that you're using an account that doesn't have a HOME directory. I also noted we do not properly take the location of -logFile into consideration, which causes the package manager log file to be created in a default location which may not be desirable. The following steps should let you work around these issues. All can be added to your build script fairly easily: - Create a temporary directory with the following subfolder hierarchy: Library/Logs - Create a directory symlink inside the Logs directory created above. Name it Unity and point it to ${workspace} (e.g. so /<temp-directory-path>/Library/Logs/Unity is a directory symlink to ${workspace}) - When launching Unity, prefix the command-line with HOME=/<temp-directory-path>
@maximeb_unity Hello, I used the latest update Unity2020.1.a7 and packaged it again. First time I did not open the Log, the parameters are as follows HOME=${WORKSPACE}/UnityBug/ -projectPath ${workspace}/Client -executeMethod PostBuildCommonProject.Build Platform-$Platform Then Jenkins prints: 11:11:36 [iOS-XProj] $ /bin/sh /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/jenkins8891722453600123408.sh 11:11:36 /Users/yijiankeji/Jenkins/Home/workspace/iOS-XProj 11:11:36 /Users/yijiankeji/Jenkins/Home/workspace/iOS-XProj/UnityBug/Library/Logs 11:11:36 ERROR: Build step failed with exception 11:11:36 java.lang.NullPointerException 11:11:36 at java.io.File.<init>(File.java:277) 11:11:36 at org.jenkinsci.plugins.unity3d.Unity3dInstallation.getEditorLogFile(Unity3dInstallation.java:176) 11:11:36 at org.jenkinsci.plugins.unity3d.Unity3dInstallation.access$200(Unity3dInstallation.java:36) 11:11:36 at org.jenkinsci.plugins.unity3d.Unity3dInstallation$3.call(Unity3dInstallation.java:149) 11:11:36 at org.jenkinsci.plugins.unity3d.Unity3dInstallation$3.call(Unity3dInstallation.java:147) 11:11:36 at hudson.remoting.LocalChannel.call(LocalChannel.java:45) 11:11:36 at org.jenkinsci.plugins.unity3d.Unity3dInstallation.getEditorLogPath(Unity3dInstallation.java:147) 11:11:36 at org.jenkinsci.plugins.unity3d.Unity3dBuilder._perform(Unity3dBuilder.java:146) 11:11:36 at org.jenkinsci.plugins.unity3d.Unity3dBuilder.perform(Unity3dBuilder.java:121) 11:11:36 at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) 11:11:36 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741) 11:11:36 at hudson.model.Build$BuildExecution.build(Build.java:206) 11:11:36 at hudson.model.Build$BuildExecution.doRun(Build.java:163) 11:11:36 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504) 11:11:36 at hudson.model.Run.execute(Run.java:1838) 11:11:36 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) 11:11:36 at hudson.model.ResourceController.execute(ResourceController.java:97) 11:11:36 at hudson.model.Executor.run(Executor.java:429) 11:11:36 Build step 'Invoke Unity3d Editor' marked build as failure 11:11:36 Finished: FAILURE The second time, I added logFile: HOME=${WORKSPACE}/UnityBug/ -projectPath ${workspace}/Client -executeMethod PostBuildCommonProject.Build -logFile ${workspace}/editor.log Platform-$Platform Before executing the Invoke Editor, I executed the Shell: The Log print: 11:16:43 [iOS-XProj] $ /bin/sh /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/jenkins5623525953161007696.sh 11:16:43 /Users/yijiankeji/Jenkins/Home/workspace/iOS-XProj 11:16:43 /Users/yijiankeji/Jenkins/Home/workspace/iOS-XProj/UnityBug/Library/Logs 11:16:43 Piping unity Editor.log from /Users/yijiankeji/Jenkins/Home/workspace/iOS-XProj/editor.log 11:16:43 [iOS-XProj] $ /Applications/Unity/Hub/Editor/2020.1.0a7/Unity.app/Contents/MacOS/Unity HOME=/Users/yijiankeji/Jenkins/Home/workspace/iOS-XProj/UnityBug/ -projectPath /Users/yijiankeji/Jenkins/Home/workspace/iOS-XProj/Client -executeMethod PostBuildCommonProject.Build -logFile /Users/yijiankeji/Jenkins/Home/workspace/iOS-XProj/editor.log Platform-iOS 11:16:43 [Licensing::Module] Channel doesn't exist: "LicenseClient-root" 11:16:43 Launching external process: /Applications/Unity/Hub/Editor/2020.1.0a7/Unity.app/Contents/Frameworks/UnityLicensingClient.app/Contents/Resources/Unity.Licensing.Client 11:16:43 [Licensing::Module] Successfully launched the LicensingClient (PId: 1154) 11:16:45 [Licensing::Module] Successfully connected to LicensingClient on channel: "LicenseClient-root" 11:16:45 Entitlement-based licensing initiated 11:16:45 [LicensingClient] Licenses updated successfully 11:16:45 [Licensing::Module] Serial number assigned to: "XXX" 11:16:45 [Package Manager] Server::Start -- Port 63492 was selected 11:16:45 Launching external process: /Applications/Unity/Hub/Editor/2020.1.0a7/Unity.app/Contents/Resources/PackageManager/Server/UnityPackageManager 11:16:45 11:16:45 COMMAND LINE ARGUMENTS: 11:16:45 /Applications/Unity/Hub/Editor/2020.1.0a7/Unity.app/Contents/MacOS/Unity 11:16:45 HOME=/Users/yijiankeji/Jenkins/Home/workspace/iOS-XProj/UnityBug/ 11:16:45 -projectPath 11:16:45 /Users/yijiankeji/Jenkins/Home/workspace/iOS-XProj/Client 11:16:45 -executeMethod 11:16:45 PostBuildCommonProject.Build 11:16:45 -logFile 11:16:45 /Users/yijiankeji/Jenkins/Home/workspace/iOS-XProj/editor.log 11:16:45 Platform-iOS 11:16:45 Successfully changed project path to: /Users/yijiankeji/Jenkins/Home/workspace/iOS-XProj/Client 11:16:45 /Users/yijiankeji/Jenkins/Home/workspace/iOS-XProj/Client 11:16:45 Using Asset Import Pipeline V2. 11:16:46 path.js:28 11:16:46 throw new TypeError('Path must be a string. Received ' + inspect(path)); 11:16:46 ^ 11:16:46 11:16:46 TypeError: Path must be a string. Received undefined 11:16:46 at assertPath (path.js:28:11) 11:16:46 at Object.join (path.js:1236:7) 11:16:46 at getLogFolder (/snapshot/upm/packages/server/logging.js:0:0) 11:16:46 at Object.enableLogging (/snapshot/upm/packages/server/logging.js:0:0) 11:16:46 at Object.<anonymous> (/snapshot/upm/packages/server/app.js:0:0) 11:16:46 at Module._compile (pkg/prelude/bootstrap.js:1252:22) 11:16:46 at Object.Module._extensions..js (module.js:661:10) 11:16:46 at Module.load (module.js:563:32) 11:16:46 at tryModuleLoad (module.js:503:12) 11:16:46 at Function.Module._load (module.js:495:3) 11:16:46 at Function.Module.runMain (pkg/prelude/bootstrap.js:1307:12) 11:16:46 at startup (bootstrap_node.js:227:16) 11:16:46 at bootstrap_node.js:648:3 11:16:46 [Package Manager] Server::CheckExitCode -- Server stopped with exit code `1` 11:16:46 [Package Manager] PackageManager Server::Start -- Process restart attempt #2 11:16:46 11:16:46 [Package Manager] Server::Start -- Port 57836 was selected 11:16:46 Launching external process: /Applications/Unity/Hub/Editor/2020.1.0a7/Unity.app/Contents/Resources/PackageManager/Server/UnityPackageManager 11:16:46 [Package Manager] Cannot connect to Unity Package Manager local server 11:16:46 path.js:28 11:16:46 throw new TypeError('Path must be a string. Received ' + inspect(path)); 11:16:46 ^ Am I doing the right here?
Yes, you seem to be running into roughly the same issue. On Windows, you can use the same approach as what I suggested, but use junctions to set up the directory symlink (using mklink /J Link Target), and in your build script, set the environment variable using SET LOCALAPPDATA=<temp folder>. HOME is for MacOS/Linux.
Unfortunately no, and I cannot provide any estimate on when it will be fixed. When it gets fixed, it will be mentioned in the Unity Release Notes.