CI build problem (2.0.7)

Hello there. I use TeamCity with Windows build agent for my project. Recently I switched from CocosCreator 1.10.2 to CocosCreator 2.0.7 and now this CI build fails.

Command line:
CocosCreator --path . --build platform=web-desktop;dest=build;debug=false

Error:

[7176] Error: Build Failed: TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at module.exports.getAssetUuids (c:\cc207\resources\app.asar\editor\core\build-results.js:1:461)
    at Gulp.<anonymous> (c:\cc207\resources\app.asar\editor\core\gulp-build.js:1:9691)
    at module.exports (c:\cc207\resources\app.asar\node_modules\orchestrator\lib\runTask.js:34:7)
    at Gulp.Orchestrator._runTask (c:\cc207\resources\app.asar\node_modules\orchestrator\index.js:273:3)
    at Gulp.Orchestrator._runStep (c:\cc207\resources\app.asar\node_modules\orchestrator\index.js:214:10)
    at c:\cc207\resources\app.asar\node_modules\orchestrator\index.js:279:18
    at finish (c:\cc207\resources\app.asar\node_modules\orchestrator\lib\runTask.js:21:8)
    at cb (c:\cc207\resources\app.asar\node_modules\orchestrator\lib\runTask.js:29:3)
    at BrowserWindow.<anonymous> (c:\cc207\resources\app.asar\editor\core\gulp-build.js:1:8784)
    at r.waterfall.r (c:\cc207\resources\app.asar\editor\lib\builder\index.js:1:3197)
    at c:\cc207\resources\app.asar\node_modules\async\lib\async.js:52:16
    at c:\cc207\resources\app.asar\node_modules\async\lib\async.js:696:30
    at c:\cc207\resources\app.asar\node_modules\async\lib\async.js:167:37
    at c:\cc207\resources\app.asar\node_modules\async\lib\async.js:1209:30
    at Gulp.doneCallback (c:\cc207\resources\app.asar\editor\core\gulp-build.js:1:24012)
    at Gulp.Orchestrator.stop (c:\cc207\resources\app.asar\node_modules\orchestrator\index.js:150:9)
    at c:\cc207\resources\app.asar\node_modules\orchestrator\index.js:277:22
    at finish (c:\cc207\resources\app.asar\node_modules\orchestrator\lib\runTask.js:21:8)

[7176] Error: TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at module.exports.getAssetUuids (c:\cc207\resources\app.asar\editor\core\build-results.js:1:461)
    at Gulp.<anonymous> (c:\cc207\resources\app.asar\editor\core\gulp-build.js:1:9691)
    at module.exports (c:\cc207\resources\app.asar\node_modules\orchestrator\lib\runTask.js:34:7)
    at Gulp.Orchestrator._runTask (c:\cc207\resources\app.asar\node_modules\orchestrator\index.js:273:3)
    at Gulp.Orchestrator._runStep (c:\cc207\resources\app.asar\node_modules\orchestrator\index.js:214:10)
    at c:\cc207\resources\app.asar\node_modules\orchestrator\index.js:279:18
    at finish (c:\cc207\resources\app.asar\node_modules\orchestrator\lib\runTask.js:21:8)
    at cb (c:\cc207\resources\app.asar\node_modules\orchestrator\lib\runTask.js:29:3)
    at BrowserWindow.<anonymous> (c:\cc207\resources\app.asar\editor\core\gulp-build.js:1:8784)
    at Editor.Builder.buildCommand.e (c:\cc207\resources\app.asar\editor\index.js:1:1677)
    at r.series.e (c:\cc207\resources\app.asar\editor\lib\builder\index.js:1:4517)
    at c:\cc207\resources\app.asar\node_modules\async\lib\async.js:726:13
    at c:\cc207\resources\app.asar\node_modules\async\lib\async.js:52:16
    at c:\cc207\resources\app.asar\node_modules\async\lib\async.js:264:21
    at c:\cc207\resources\app.asar\node_modules\async\lib\async.js:44:16
    at c:\cc207\resources\app.asar\node_modules\async\lib\async.js:723:17
    at c:\cc207\resources\app.asar\node_modules\async\lib\async.js:167:37
    at r.waterfall.r (c:\cc207\resources\app.asar\editor\lib\builder\index.js:1:3582)
Uncaught Exception: ReferenceError: error is not defined
c:\cc207\resources\app.asar\editor\init.js:1
    at Editor.Builder.buildCommand.e (c:\cc207\resources\app.asar\editor\index.js:1:1702)
    at r.series.e (c:\cc207\resources\app.asar\editor\lib\builder\index.js:1:4517)
    at c:\cc207\resources\app.asar\node_modules\async\lib\async.js:726:13
(function (exports, require, module, __filename, __dirname, process, global, Buffer) { return function (exports, require, module, __filename, __dirname) { "use strict";const e=require("electron").ipcMain,t=require("fire-fs"),i=(require("fire-path"),require("async")),r=require("../editor-framework/lib/share/ipc-listener");let o=e=>{process.send({channel:"editor-error",message:e.message,stack:e.stack})};process.on("uncaughtException",o),Editor.App.extend({runDashboard(){Editor.Window.main.close()},run(){if("string"!=typeof Editor._buildCommand&&"string"!=typeof Editor._compileCommand){Editor.run("app://editor/index.html",{title:"Cocos Creator",width:1280,height:720,minWidth:100,minHeight:100,show:!1,resizable:!0});var t=Editor.Window.main;t.nativeWin.on("close",function(){t.closing=!0}),e.on("app:is-main-window-attemp-to-close",e=>{e.returnValue=!!t.closing,t.closing=!1}),Editor.Metrics.setClientId(function(){Editor.Metrics.prepareUserIdentity(),Editor
    at c:\cc207\resources\app.asar\node_modules\async\lib\async.js:52:16

    at c:\cc207\resources\app.asar\node_modules\async\lib\async.js:264:21
TypeError: process.send is not a function
    at c:\cc207\resources\app.asar\node_modules\async\lib\async.js:44:16
    at process.o (c:\cc207\resources\app.asar\editor\init.js:1:342)
    at c:\cc207\resources\app.asar\node_modules\async\lib\async.js:723:17
    at emitOne (events.js:101:20)
    at c:\cc207\resources\app.asar\node_modules\async\lib\async.js:167:37
    at process.emit (events.js:191:7)
    at r.waterfall.r (c:\cc207\resources\app.asar\editor\lib\builder\index.js:1:3582)
    at process._fatalException (bootstrap_node.js:308:26)
    at c:\cc207\resources\app.asar\node_modules\async\lib\async.js:52:16
Process exited with code 7

Building the project from GUI and terminal works just fine but building it with CI system fails.

Unfortunately I cannot unpack app.asar to look what is going on - I guess it’s encrypted.

I found similar report on chinese forum https://forum.cocos.com/t/windows-jenkins/65950/7 but it’s not resolved yet.

Thank you.

If you scene.fire appear a null key for a child node, it may case this issue, you can open scene.fire file in txt mode and check.

Hello @huanxinyin
There’s no null children in my scenes and prefabs. Furthemore, the issue can be reproduced with new “Hello Typescript” project.

UPD
I tried using Jenkins instead of TeamCity and it seems to work on both template project and my app. That is strange. I hope you will discover something by looking into app.asar.

UPD2
I’ve installed TeamCity locally and it works as well. So there’s only a problem with particular TC instance though I’ve logged in to it with Remote Desktop and executed the same command successfully so it probably some subtle difference in environment between Remote Desktop session and build agent (system level user is the same). I would be gratefull if you’ll give me some insight based on scripts in app.asar and provided logs as I have no clue what that could be. From what I understand CocosCreator is self-sufficient i.e. it does not depend on installed nodejs or anything else outside of installation directory (except for native builds) and does not use environment variables. I’m out of ideas

The internal data of BuildResults was broken. I guess the build process was unfinished. Or maybe the error occurred¸in the worker process, so there is no more error message. Can you check the error message in debug mode?

Hello @jare
Command: CocosCreator --debug --internal --path . --build platform=web-desktop;dest=build;debug=true
Console output: https://www.dropbox.com/s/gutu3e219cb09eh/build_log.txt?dl=0
CocosCreator.log: https://www.dropbox.com/s/5cj098t1u3iy0wj/CocosCreator.log?dl=0
Project directory (after build attempt): https://www.dropbox.com/s/8f0t57vklfyk9o7/client_web.zip?dl=0

I am sorry, I have no idea about this error. I checked all related logic in the build process, the data is not possible to be undefined.

Ok. Thank you for your time anyway.

FYI I’ve reinstalled OS and software and now it works… Mystery…

1 Like

Ok. Thanks.

I have same problem and unfortunately I can not reinstall the OS. I have tried to reinstall CocosCreator but it did not help.

I am using v2.0.8 on windows 7

here is the error I got

[windows build] [6164] Error: Build Failed: TypeError: Cannot convert undefined or null to object
[windows build]     at Function.keys (<anonymous>)
[windows build]     at module.exports.getAssetUuids (c:\CocosCreator\resources\app.asar\editor\core\build-results.js:1:461)
[windows build]     at Gulp.<anonymous> (c:\CocosCreator\resources\app.asar\editor\core\gulp-build.js:1:9691)
[windows build]     at module.exports (c:\CocosCreator\resources\app.asar\node_modules\orchestrator\lib\runTask.js:34:7)
[windows build]     at Gulp.Orchestrator._runTask (c:\CocosCreator\resources\app.asar\node_modules\orchestrator\index.js:273:3)
[windows build]     at Gulp.Orchestrator._runStep (c:\CocosCreator\resources\app.asar\node_modules\orchestrator\index.js:214:10)
[windows build]     at c:\CocosCreator\resources\app.asar\node_modules\orchestrator\index.js:279:18
[windows build]     at finish (c:\CocosCreator\resources\app.asar\node_modules\orchestrator\lib\runTask.js:21:8)
[windows build]     at cb (c:\CocosCreator\resources\app.asar\node_modules\orchestrator\lib\runTask.js:29:3)
[windows build]     at BrowserWindow.<anonymous> (c:\CocosCreator\resources\app.asar\editor\core\gulp-build.js:1:8784)
[windows build]     at r.waterfall.r (c:\CocosCreator\resources\app.asar\editor\lib\builder\index.js:1:3393)
[windows build]     at c:\CocosCreator\resources\app.asar\node_modules\async\lib\async.js:52:16
[windows build]     at c:\CocosCreator\resources\app.asar\node_modules\async\lib\async.js:696:30
[windows build]     at c:\CocosCreator\resources\app.asar\node_modules\async\lib\async.js:167:37
[windows build]     at c:\CocosCreator\resources\app.asar\node_modules\async\lib\async.js:1209:30
[windows build]     at Gulp.doneCallback (c:\CocosCreator\resources\app.asar\editor\core\gulp-build.js:1:24012)
[windows build]     at Gulp.Orchestrator.stop (c:\CocosCreator\resources\app.asar\node_modules\orchestrator\index.js:150:9)
[windows build]     at c:\CocosCreator\resources\app.asar\node_modules\orchestrator\index.js:277:22
[windows build]     at finish (c:\CocosCreator\resources\app.asar\node_modules\orchestrator\lib\runTask.js:21:8)
[windows build] 
[windows build] [6164] Error: TypeError: Cannot convert undefined or null to object
[windows build]     at Function.keys (<anonymous>)
[windows build]     at module.exports.getAssetUuids (c:\CocosCreator\resources\app.asar\editor\core\build-results.js:1:461)
[windows build]     at Gulp.<anonymous> (c:\CocosCreator\resources\app.asar\editor\core\gulp-build.js:1:9691)
[windows build]     at module.exports (c:\CocosCreator\resources\app.asar\node_modules\orchestrator\lib\runTask.js:34:7)
[windows build]     at Gulp.Orchestrator._runTask (c:\CocosCreator\resources\app.asar\node_modules\orchestrator\index.js:273:3)
[windows build]     at Gulp.Orchestrator._runStep (c:\CocosCreator\resources\app.asar\node_modules\orchestrator\index.js:214:10)
[windows build]     at c:\CocosCreator\resources\app.asar\node_modules\orchestrator\index.js:279:18
[windows build]     at finish (c:\CocosCreator\resources\app.asar\node_modules\orchestrator\lib\runTask.js:21:8)
[windows build]     at cb (c:\CocosCreator\resources\app.asar\node_modules\orchestrator\lib\runTask.js:29:3)
[windows build]     at BrowserWindow.<anonymous> (c:\CocosCreator\resources\app.asar\editor\core\gulp-build.js:1:8784)
[windows build]     at Editor.Builder.buildCommand.e (c:\CocosCreator\resources\app.asar\editor\index.js:1:1677)
[windows build]     at r.series.e (c:\CocosCreator\resources\app.asar\editor\lib\builder\index.js:1:4713)
[windows build]     at c:\CocosCreator\resources\app.asar\node_modules\async\lib\async.js:726:13
[windows build]     at c:\CocosCreator\resources\app.asar\node_modules\async\lib\async.js:52:16
[windows build]     at c:\CocosCreator\resources\app.asar\node_modules\async\lib\async.js:264:21
[windows build]     at c:\CocosCreator\resources\app.asar\node_modules\async\lib\async.js:44:16
[windows build]     at c:\CocosCreator\resources\app.asar\node_modules\async\lib\async.js:723:17
[windows build]     at c:\CocosCreator\resources\app.asar\node_modules\async\lib\async.js:167:37
[windows build]     at r.waterfall.r (c:\CocosCreator\resources\app.asar\editor\lib\builder\index.js:1:3778)
[windows build] Uncaught Exception: ReferenceError: error is not defined
[windows build]     at Editor.Builder.buildCommand.e (c:\CocosCreator\resources\app.asar\editor\index.js:1:1702)
[windows build]     at r.series.e (c:\CocosCreator\resources\app.asar\editor\lib\builder\index.js:1:4713)
[windows build]     at c:\CocosCreator\resources\app.asar\node_modules\async\lib\async.js:726:13
[windows build]     at c:\CocosCreator\resources\app.asar\node_modules\async\lib\async.js:52:16
[windows build]     at c:\CocosCreator\resources\app.asar\node_modules\async\lib\async.js:264:21
[windows build]     at c:\CocosCreator\resources\app.asar\node_modules\async\lib\async.js:44:16
[windows build]     at c:\CocosCreator\resources\app.asar\node_modules\async\lib\async.js:723:17
[windows build]     at c:\CocosCreator\resources\app.asar\node_modules\async\lib\async.js:167:37
[windows build]     at r.waterfall.r (c:\CocosCreator\resources\app.asar\editor\lib\builder\index.js:1:3778)
[windows build]     at c:\CocosCreator\resources\app.asar\node_modules\async\lib\async.js:52:16
[windows build] c:\CocosCreator\resources\app.asar\editor\init.js:1
[windows build] (function (exports, require, module, __filename, __dirname, process, global, Buffer) { return function (exports, require, module, __filename, __dirname) { "use strict";const e=require("electron").ipcMain,t=require("fire-fs"),i=(require("fire-path"),require("async")),r=require("../editor-framework/lib/share/ipc-listener");let o=e=>{process.send({channel:"editor-error",message:e.message,stack:e.stack})};process.on("uncaughtException",o),Editor.App.extend({runDashboard(){Editor.Window.main.close()},run(){if("string"!=typeof Editor._buildCommand&&"string"!=typeof Editor._compileCommand){Editor.run("app://editor/index.html",{title:"Cocos Creator",width:1280,height:720,minWidth:100,minHeight:100,show:!1,resizable:!0});var t=Editor.Window.main;t.nativeWin.on("close",function(){t.closing=!0}),e.on("app:is-main-window-attemp-to-close",e=>{e.returnValue=!!t.closing,t.closing=!1}),Editor.Metrics.setClientId(function(){Editor.Metrics.prepareUserIdentity(),Editor.Metri
[windows build] 
[windows build] TypeError: process.send is not a function
[windows build]     at process.o (c:\CocosCreator\resources\app.asar\editor\init.js:1:342)
[windows build]     at emitOne (events.js:101:20)
[windows build]     at process.emit (events.js:191:7)
[windows build]     at process._fatalException (bootstrap_node.js:308:26)```

any idea?

@jare  @slackmoehrle

I am not sure, I need to defer to @jare to see the updated log you provided.

I tried to create a dummy project. But CocosCreator is not even be able to open the project. It says something is not there etc etc. I dont really understand why it is like this.

On my machine I deleted library folder and let Cocos create again. And everything went well. But on builder machine (windows 7) it did not helped. Still same problem.

I uninstall cocos and install again on Windows 7 64 bit. (CocosCreator v.2.0.8, Freshly downloaded)

Create a dummy project (project type does not matter. all of them gives me same result). it says

2019-02-20T08:53:43.961Z - error: Error: This browser does not support webGL. Try using the canvas renderer
    at WebGLRenderer._createContext (C:\CocosCreator\resources\app.asar\node_modules\pixi.js\src\core\renderers\webgl\WebGLRenderer.js:185:15)
    at new WebGLRenderer (C:\CocosCreator\resources\app.asar\node_modules\pixi.js\src\core\renderers\webgl\WebGLRenderer.js:148:10)
    at HTMLElement.connectedCallback (C:\CocosCreator\resources\app.asar\editor\builtin\scene\grid\index.js:1:1425)
    at HTMLElement.add (C:\CocosCreator\resources\app.asar\editor-framework\lib\renderer\ui\panel\panel.js:1:4748)
    at a.newFrame (C:\CocosCreator\resources\app.asar\editor-framework\lib\renderer\ui\utils\dock-utils.js:1:6916)
    at then.e (C:\CocosCreator\resources\app.asar\editor-framework\lib\renderer\ui\utils\polymer-utils.js:1:4736)
    at <anonymous>
2019-02-20T08:53:44.370Z - error: Error: This browser does not support webGL. Try using the canvas renderer
    at WebGLRenderer._createContext (C:\CocosCreator\resources\app.asar\node_modules\pixi.js\src\core\renderers\webgl\WebGLRenderer.js:185:15)
    at new WebGLRenderer (C:\CocosCreator\resources\app.asar\node_modules\pixi.js\src\core\renderers\webgl\WebGLRenderer.js:148:10)
    at HTMLElement.connectedCallback (C:\CocosCreator\resources\app.asar\editor\builtin\timeline\panel\grid\index.js:1:1442)
    at HTMLElement._apply (C:\CocosCreator\resources\app.asar\editor-framework\lib\renderer\ui\panel\frame.js:1:2714)
    at _loadProfiles.then.i (C:\CocosCreator\resources\app.asar\editor-framework\lib\renderer\ui\panel\frame.js:1:2029)
    at <anonymous>
2019-02-20T08:53:45.071Z - error: TypeError: Cannot read property 'getParameter' of null
    at Device._initCaps (C:\CocosCreator\resources\engine\bin\.cache\dev\cocos2d\core\renderer\render-engine.js:5051:46)
    at new Device (C:\CocosCreator\resources\engine\bin\.cache\dev\cocos2d\core\renderer\render-engine.js:5009:18)
    at Object.initWebGL (C:\CocosCreator\resources\engine\bin\.cache\dev\cocos2d\core\renderer\index.js:53:35)
    at Object._initRenderer (C:\CocosCreator\resources\engine\bin\.cache\dev\cocos2d\core\CCGame.js:361:30)
    at Object._initEngine (C:\CocosCreator\resources\engine\bin\.cache\dev\cocos2d\core\CCGame.js:112:22)
    at Object._prepareFinished (C:\CocosCreator\resources\engine\bin\.cache\dev\cocos2d\core\CCGame.js:123:22)
    at Object.prepare (C:\CocosCreator\resources\engine\bin\.cache\dev\cocos2d\core\CCGame.js:162:26)
    at Object.run (C:\CocosCreator\resources\engine\bin\.cache\dev\cocos2d\core\CCGame.js:168:22)
    at EditorEngine.createGame (C:\CocosCreator\resources\app.asar\editor\page\scene-utils\editor-engine\index.js:1:1787)
    at EditorEngine.init (C:\CocosCreator\resources\app.asar\editor\page\scene-utils\editor-engine\index.js:1:1356)
2019-02-20T08:54:46.970Z - error: TypeError: Cannot read property 'children' of null
    at t (C:\CocosCreator\resources\app.asar\editor\page\scene-utils\editor-engine\index.js:1:3544)
    at C:\CocosCreator\resources\app.asar\editor\page\scene-utils\editor-engine\index.js:1:3601
    at EditorEngine.getIntersectionList (C:\CocosCreator\resources\app.asar\editor\page\scene-utils\editor-engine\index.js:1:3618)
    at Object.hitTest (C:\CocosCreator\resources\app.asar\editor\page\scene-utils\index.js:1:8856)
    at HTMLElement._onMouseMove (file:///C:/CocosCreator/resources/app.asar/editor/builtin/scene/panel/scene-view.js:1:6463)
    at HTMLElement.handler (app://bower_components/polymer/polymer.html:471:17)```

When I move my mouse on Scene Panel it throws that error. Hope this would help you what’s going on. I look forward to getting an answer from you soon. @jare

    at t (C:\CocosCreator\resources\app.asar\editor\page\scene-utils\editor-engine\index.js:1)
    at C:\CocosCreator\resources\app.asar\editor\page\scene-utils\editor-engine\index.js:1
    at EditorEngine.getIntersectionList (C:\CocosCreator\resources\app.asar\editor\page\scene-utils\editor-engine\index.js:1)
    at Object.hitTest (C:\CocosCreator\resources\app.asar\editor\page\scene-utils\index.js:1)
    at HTMLElement._onMouseMove (scene-view.js:1)
    at HTMLElement.handler (polymer.html:471)
t	@	C:\CocosCreator\resources\app.asar\editor\page\scene-utils\editor-engine\index.js:1
(anonymous)	@	C:\CocosCreator\resources\app.asar\editor\page\scene-utils\editor-engine\index.js:1
getIntersectionList	@	C:\CocosCreator\resources\app.asar\editor\page\scene-utils\editor-engine\index.js:1
hitTest	@	C:\CocosCreator\resources\app.asar\editor\page\scene-utils\index.js:1
_onMouseMove	@	scene-view.js:1
handler	@	polymer.html:471```

I encountered a similar issue on a Mac using CLI. I’m pretty confident that these errors are GPU related in the sense that it encounters this issue if GPU support is not enabled.

Running the following CLI command…

/Applications/CocosCreator.app/Contents/MacOS/CocosCreator --disable-gpu --path . --build "platform=web-mobile"

… produces the error BUT running the command below…

/Applications/CocosCreator.app/Contents/MacOS/CocosCreator --path . --build "platform=web-mobile"

… does not.

The log output backs up this hypothesis as it’s failing during the game graphics asset creation step. There’s no ‘start build assets’ log output - it skips directly to the ‘Finish building assets’ log output.

What success looks like…

Builder: do custom process [build-start]
[37701] Building /Users/ckhoo/kff/robot-server/temp/SampleHelloWorld
[37701] Destination /Users/ckhoo/kff/robot-server/temp/deploy/web-mobile
[37701] Delete /Users/ckhoo/kff/robot-server/temp/deploy/web-mobile/subpackages/**/*,/Users/ckhoo/kff/robot-server/temp/deploy/web-mobile/**/*
[  compile [====                                    ] 10% 0.0s  ][37701] Start building assets
[  spawn-worker [============                            ] 30% 4.3s  ][37701] Start spawn build-worker
[37701] Finish spawn build-worker
[37701] Start init build-worker
[  init-worker [=============                           ] 32% 5.5s  ][37701] Cocos Services load base data!
[37701] Finish init build-worker
[37701] Start build-assets in worker
[  pack-assets [================================        ] 80% 1.7s  ][37701] Finish build-assets in worker
[37701] Finish building assets
queryAssets: 13.031ms
writeAssets: 0.598ms
...

And what failure looks like…

Builder: do custom process [build-start]
[37629] Building /Users/ckhoo/kff/robot-server/temp/SampleHelloWorld
[37629] Destination /Users/ckhoo/kff/robot-server/temp/deploy/web-mobile
[37629] Delete /Users/ckhoo/kff/robot-server/temp/deploy/web-mobile/subpackages/**/*,/Users/ckhoo/kff/robot-server/temp/deploy/web-mobile/**/*
[  cut-engine [                                        ] 0% 0.0s  ]Exclude modules: 
[37629] Cocos Services load base data!
[  compile [====                                    ] 10% 0.0s  ][37629] Load worker timeout, reload worker.
[37629] Load worker timeout, reload worker.
[37629] Start building assets
[  spawn-worker [============                            ] 30% 85.0s  ][37629] Start spawn build-worker
[37629] Load worker timeout, reload worker.
[37629] Finish spawn build-worker
[37629] Start init build-worker
[  init-worker [=============                           ] 32% 111.2s  ][37629] Finish building assets
[37629] Error: Build Failed: TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at module.exports.getAssetUuids (/Applications/CocosCreator.app/Contents/Resources/app.asar/editor/core/build-results.js:1:461)
    at Gulp.<anonymous> (/Applications/CocosCreator.app/Contents/Resources/app.asar/editor/core/gulp-build.js:1:9950)
    at module.exports (/Applications/CocosCreator.app/Contents/Resources/app.asar/node_modules/orchestrator/lib/runTask.js:34:7)
    at Gulp.Orchestrator._runTask (/Applications/CocosCreator.app/Contents/Resources/app.asar/node_modules/orchestrator/index.js:273:3)
    at Gulp.Orchestrator._runStep (/Applications/CocosCreator.app/Contents/Resources/app.asar/node_modules/orchestrator/index.js:214:10)
    at /Applications/CocosCreator.app/Contents/Resources/app.asar/node_modules/orchestrator/index.js:279:18
    at finish (/Applications/CocosCreator.app/Contents/Resources/app.asar/node_modules/orchestrator/lib/runTask.js:21:8)
    at cb (/Applications/CocosCreator.app/Contents/Resources/app.asar/node_modules/orchestrator/lib/runTask.js:29:3)
    at BrowserWindow.<anonymous> (/Applications/CocosCreator.app/Contents/Resources/app.asar/editor/core/gulp-build.js:1:9030)
    at r.waterfall.r (/Applications/CocosCreator.app/Contents/Resources/app.asar/editor/lib/builder/index.js:1:3393)
    at /Applications/CocosCreator.app/Contents/Resources/app.asar/node_modules/async/lib/async.js:52:16
    at /Applications/CocosCreator.app/Contents/Resources/app.asar/node_modules/async/lib/async.js:696:30
    at /Applications/CocosCreator.app/Contents/Resources/app.asar/node_modules/async/lib/async.js:167:37
    at /Applications/CocosCreator.app/Contents/Resources/app.asar/node_modules/async/lib/async.js:1209:30
    at Gulp.doneCallback (/Applications/CocosCreator.app/Contents/Resources/app.asar/editor/core/gulp-build.js:1:27675)
    at Gulp.Orchestrator.stop (/Applications/CocosCreator.app/Contents/Resources/app.asar/node_modules/orchestrator/index.js:150:9)
    at /Applications/CocosCreator.app/Contents/Resources/app.asar/node_modules/orchestrator/index.js:277:22
    at finish (/Applications/CocosCreator.app/Contents/Resources/app.asar/node_modules/orchestrator/lib/runTask.js:21:8)
[  error [========================================] 100% 0.0s  ]
...

I hope this helps.

Hello, I am trying to build a Cocos Creator 2.2.0 project in a virtual remote server (Windows Server 2019 Datacenter) using Jenkins. This process works for the same project in the same server on 2.0.8, but not for 2.2.0. I unfortunately cannot reinstall the OS. Any ideas would be greatly appreciated!

The Jenkinsfile runs this command:
C:/CocosCreator/CocosCreator.exe --path . --build "platform=web-desktop;debug=false;md5Cache=true;sourceMaps=false;buildPath=./release"

Note, this command runs successfully from my local machine or in the CLI after I remote into the virtual server.

The build gets stuck on the following error:

[9604] Start building assets

[9604] Start spawn build-worker

[9604] Finish spawn build-worker

[9604] Start init build-worker

[9604] Error: Build Failed: Error: TypeError: Cannot read property 'getParameter' of null
    at Device._initCaps (C:\CocosCreator\resources\engine\bin\.cache\dev\cocos2d\renderer\gfx\device.js:495:59)
    at new Device (C:\CocosCreator\resources\engine\bin\.cache\dev\cocos2d\renderer\gfx\device.js:447:22)
    at Object.initWebGL (C:\CocosCreator\resources\engine\bin\.cache\dev\cocos2d\core\renderer\index.js:72:35)
    at Object._initRenderer (C:\CocosCreator\resources\engine\bin\.cache\dev\cocos2d\core\CCGame.js:356:30)
    at Object._initEngine (C:\CocosCreator\resources\engine\bin\.cache\dev\cocos2d\core\CCGame.js:112:22)
    at Object._prepareFinished (C:\CocosCreator\resources\engine\bin\.cache\dev\cocos2d\core\CCGame.js:123:22)
    at Object.prepare (C:\CocosCreator\resources\engine\bin\.cache\dev\cocos2d\core\CCGame.js:165:26)
    at Object.run (C:\CocosCreator\resources\engine\bin\.cache\dev\cocos2d\core\CCGame.js:171:22)
    at C:\CocosCreator\resources\app.asar\editor\page\build\build-worker.js:1:1566
    at fn (C:\CocosCreator\resources\app.asar\node_modules\async\lib\async.js:746:34)
    at EventEmitter.i (C:\CocosCreator\resources\app.asar\editor\core\gulp-build.js:1:7762)
    at Object.onceWrapper (events.js:282:20)
    at EventEmitter.emit (events.js:194:13)
    at EventEmitter.emit (domain.js:469:20)
    at EventEmitter.<anonymous> (C:\CocosCreator\resources\app.asar\editor-framework\lib\main\ipc.js:1:3399)
    at EventEmitter.emit (events.js:194:13)
    at EventEmitter.emit (domain.js:469:20)
    at WebContents.<anonymous> (C:\CocosCreator\resources\electron.asar\browser\api\web-contents.js:390:13)
    at WebContents.emit (events.js:194:13)
    at WebContents.EventEmitter.emit (domain.js:469:20)
    at C:\CocosCreator\resources\app.asar\editor\lib\builder\index.js:1:3351
    at C:\CocosCreator\resources\app.asar\node_modules\async\lib\async.js:52:16
    at C:\CocosCreator\resources\app.asar\node_modules\async\lib\async.js:696:30
    at C:\CocosCreator\resources\app.asar\node_modules\async\lib\async.js:167:37
    at C:\CocosCreator\resources\app.asar\node_modules\async\lib\async.js:1209:30
    at D (C:\CocosCreator\resources\app.asar\editor\core\gulp-build.js:1:5649)
    at Gulp.<anonymous> (C:\CocosCreator\resources\app.asar\editor\core\gulp-build.js:1:22017)
    at Object.onceWrapper (events.js:282:20)
    at Gulp.emit (events.js:194:13)

So v2.0.8 works but v2.2.0 doesn’t. It’s most likely due to our upgrade of the material system.

Please ensure the GPU driver is installed correctly. And follow the instructions:

CocosCreator also need GUI environment when running in command line. If your Jenkins can not run CocosCreator in command line, a solution is running Jenkins on the agent mode, so it can visit the WindowServer. Details: https://stackoverflow.com/questions/13966595/build-unity-project-with-jenkins-failed

If your Jenkins can not compile under Windows, specify a local user for the Jenkins service in the Windows Control Panel -> Administrative Tools -> Service, and then restart the computer. You don’t need to set up a master-slave mode separately.

We SSH into the Windows remote server as a specific user in Jenkins agent mode, but this does not appear to have access to a GUI environment for 2.2.0 (for some reason it worked on 2.0.8). We found a workaround by using psexec and specifying the session of the user we log in as (found via qwinsta).

Jenkinsfile:

def session_id = sh(script: 'qwinsta | grep USERNAME | awk \'{gsub(", ", "", $2); print $2}\'', returnStdout: true).trim() as Integer

sh "C:/workspace/tools/PsExec.exe -i ${session_id} C:/CocosCreator/CocosCreator.exe --path ${project_dir} --build 'platform=web-desktop;debug=false;md5Cache=true;sourceMaps=false;buildPath=./release'"

Note that this doesn’t let you see the logs from the build process, so you have to redirect the output.

1 Like