Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ngcc crashing on every CI build #36278

Closed
paustint opened this issue Mar 27, 2020 · 20 comments
Closed

ngcc crashing on every CI build #36278

paustint opened this issue Mar 27, 2020 · 20 comments

Comments

@paustint
Copy link

paustint commented Mar 27, 2020

🐞 bug report

Affected Package

The issue is caused by package @angular/compiler-cli - specifically `ngcc`

Is this a regression?

Yes, the previous version in which this bug was not present was: 9.0 (or maybe 8.2)

Description

when ngcc runs on circle-ci it fails every time, but if I SSH into the container and run ngcc it completes successfully.

🔬 Minimal Reproduction

https://github.com/paustint/test-ivy-app

Example failing builds:
https://app.circleci.com/pipelines/github/paustint/test-ivy-app/1/workflows/e3719bbe-f02c-40c0-8f6f-40c7e61f09ef/jobs/1

https://app.circleci.com/pipelines/github/paustint/test-ivy-app/1/workflows/e3719bbe-f02c-40c0-8f6f-40c7e61f09ef/jobs/2

Note This fails 100% of the time, but fails while compiling seemingly different packages (e.x. it is not consistently failing while compiling any specific package.

🔥 Exception or Error


Debug: Forking unlocker child-process
Debug: Attemping to write lock-file at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__ with PID 192
Debug: Written lock-file at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__ with PID 192
Debug: Running ngcc on ClusterExecutor (using 8 worker processes).
Debug: Analyzing entry-points...
Debug: No manifest found for /home/circleci/app/node_modules so walking the directories for entry-points.
Debug: Starting unlocker at process 199 on behalf of process 192
Debug: The lock-file path is /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__
Debug: Walking directories took 0.5s.
Debug: Invalid entry-point /home/circleci/app/node_modules/@angular/common/upgrade. It is missing required dependencies:
 - @angular/upgrade/static
Debug: Invalid entry-point /home/circleci/app/node_modules/@angular/router/upgrade. It is missing required dependencies:
 - @angular/upgrade/static
Debug: Analyzed 51 entry-points in 2.1s. (Total tasks: 255)
Debug: Processing tasks...
Debug: Spawning another worker process as there is more work to be done.
Debug: Spawning another worker process as there is more work to be done.
Debug: Spawning another worker process as there is more work to be done.
Debug: Spawning another worker process as there is more work to be done.
Debug: Spawning another worker process as there is more work to be done.
Debug: No assignments for 1 idle (out of 6 total) workers. Busy workers: 1, 2, 3, 4, 5
Debug: Forking unlocker child-process
Debug: [Worker #1] Processing task: {entryPoint: @angular/core, formatProperty: fesm2015, processDts: true}
Debug: Forking unlocker child-process
Debug: [Worker #2] Processing task: {entryPoint: @angular/animations, formatProperty: fesm2015, processDts: true}
Debug: Forking unlocker child-process
Debug: [Worker #3] Processing task: {entryPoint: @angular/cdk/keycodes, formatProperty: fesm2015, processDts: true}
Debug: Forking unlocker child-process
Debug: [Worker #4] Processing task: {entryPoint: @angular/compiler/testing, formatProperty: fesm2015, processDts: true}
Debug: Forking unlocker child-process
Debug: Forking unlocker child-process
Debug: [Worker #5] Processing task: {entryPoint: @angular/service-worker/config, formatProperty: fesm2015, processDts: true}
Debug: Starting unlocker at process 248 on behalf of process 206
Debug: The lock-file path is /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__
Debug: Starting unlocker at process 255 on behalf of process 213
Debug: The lock-file path is /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__
Debug: Starting unlocker at process 262 on behalf of process 220
Debug: The lock-file path is /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__
Debug: Starting unlocker at process 269 on behalf of process 227
Debug: The lock-file path is /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__
Debug: Starting unlocker at process 277 on behalf of process 234
Debug: The lock-file path is /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__
Debug: Starting unlocker at process 276 on behalf of process 241
Debug: The lock-file path is /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__
Compiling @angular/cdk/keycodes : fesm2015 as esm2015
Compiling @angular/animations : fesm2015 as esm2015
Debug:   Successfully compiled @angular/cdk/keycodes : fesm2015
Debug: Spawning another worker process as there is more work to be done.
Debug: [Worker #3] Processing task: {entryPoint: @angular/cdk/keycodes, formatProperty: fesm5, processDts: false}
Debug: [Worker #6] Processing task: {entryPoint: @angular/cdk/keycodes, formatProperty: esm2015, processDts: false}
Debug: Spawning another worker process as there is more work to be done.
Compiling @angular/service-worker/config : fesm2015 as esm2015
Debug:   Successfully compiled @angular/animations : fesm2015
Debug: Spawning another worker process as there is more work to be done.
Debug: [Worker #2] Processing task: {entryPoint: @angular/animations, formatProperty: fesm5, processDts: false}
Debug: All 8 workers are currently busy and cannot take on more work.
Debug:   Successfully compiled @angular/service-worker/config : fesm2015
Debug: All 8 workers are currently busy and cannot take on more work.
Debug: [Worker #5] Processing task: {entryPoint: @angular/animations, formatProperty: esm5, processDts: false}
Debug: All 9 workers are currently busy and cannot take on more work.
Compiling @angular/cdk/keycodes : fesm5 as esm5
Compiling @angular/compiler/testing : fesm2015 as esm2015
Debug:   Successfully compiled @angular/cdk/keycodes : fesm5
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #3] Processing task: {entryPoint: @angular/cdk/keycodes, formatProperty: main, processDts: false}
Compiling @angular/animations : fesm5 as esm5
Debug:   Successfully compiled @angular/compiler/testing : fesm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #4] Processing task: {entryPoint: @angular/compiler/testing, formatProperty: fesm5, processDts: false}
Debug:   Successfully compiled @angular/animations : fesm5
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #2] Processing task: {entryPoint: @angular/compiler/testing, formatProperty: esm2015, processDts: false}
Compiling @angular/animations : esm5 as esm5
Debug:   Successfully compiled @angular/animations : esm5
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #5] Processing task: {entryPoint: @angular/compiler/testing, formatProperty: esm5, processDts: false}
Debug: Forking unlocker child-process
Debug: [Worker #7] Processing task: {entryPoint: @angular/cdk/keycodes, formatProperty: esm5, processDts: false}
Compiling @angular/cdk/keycodes : esm2015 as esm2015
Debug: Forking unlocker child-process
Debug: Forking unlocker child-process
Compiling @angular/cdk/keycodes : main as umd
Debug: [Worker #8] Processing task: {entryPoint: @angular/animations, formatProperty: esm2015, processDts: false}
Debug: [Worker #9] Processing task: {entryPoint: @angular/animations, formatProperty: main, processDts: false}
Debug:   Successfully compiled @angular/cdk/keycodes : esm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #6] Processing task: {entryPoint: @angular/compiler/testing, formatProperty: main, processDts: false}
Debug:   Successfully compiled @angular/cdk/keycodes : main
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #3] Processing task: {entryPoint: @angular/service-worker/config, formatProperty: fesm5, processDts: false}
Debug: Starting unlocker at process 316 on behalf of process 295
Debug: The lock-file path is /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__
Compiling @angular/compiler/testing : fesm5 as esm5
Debug: Starting unlocker at process 323 on behalf of process 302
Debug: The lock-file path is /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__
Debug:   Successfully compiled @angular/compiler/testing : fesm5
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #4] Processing task: {entryPoint: @angular/service-worker/config, formatProperty: esm2015, processDts: false}
Debug: Starting unlocker at process 324 on behalf of process 309
Debug: The lock-file path is /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__
Compiling @angular/service-worker/config : fesm5 as esm5
Debug:   Successfully compiled @angular/service-worker/config : fesm5
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #3] Processing task: {entryPoint: @angular/service-worker/config, formatProperty: esm5, processDts: false}
Compiling @angular/cdk/keycodes : esm5 as esm5
Compiling @angular/service-worker/config : esm2015 as esm2015
Debug:   Successfully compiled @angular/service-worker/config : esm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #4] Processing task: {entryPoint: @angular/service-worker/config, formatProperty: main, processDts: false}
Debug:   Successfully compiled @angular/cdk/keycodes : esm5
Debug: No assignments for 1 idle (out of 9 total) workers. Busy workers: 1, 2, 3, 4, 5, 6, 8, 9
Compiling @angular/animations : main as umd
Compiling @angular/animations : esm2015 as esm2015
Compiling @angular/compiler/testing : main as umd
Compiling @angular/service-worker/config : esm5 as esm5
Debug:   Successfully compiled @angular/service-worker/config : esm5
Debug: No assignments for 2 idle (out of 9 total) workers. Busy workers: 1, 2, 4, 5, 6, 8, 9
Debug:   Successfully compiled @angular/animations : esm2015
Debug: No assignments for 3 idle (out of 9 total) workers. Busy workers: 1, 2, 4, 5, 6, 9
Debug:   Successfully compiled @angular/animations : main
Debug: No assignments for 4 idle (out of 9 total) workers. Busy workers: 1, 2, 4, 5, 6
Debug:   Successfully compiled @angular/compiler/testing : main
Debug: No assignments for 5 idle (out of 9 total) workers. Busy workers: 1, 2, 4, 5
Compiling @angular/core : fesm2015 as esm2015
Compiling @angular/compiler/testing : esm2015 as esm2015
Debug:   Successfully compiled @angular/compiler/testing : esm2015
Debug: No assignments for 6 idle (out of 9 total) workers. Busy workers: 1, 4, 5
Compiling @angular/service-worker/config : main as umd
Compiling @angular/compiler/testing : esm5 as esm5
Debug:   Successfully compiled @angular/compiler/testing : esm5
Debug: No assignments for 7 idle (out of 9 total) workers. Busy workers: 1, 4
Debug:   Successfully compiled @angular/service-worker/config : main
Debug: No assignments for 8 idle (out of 9 total) workers. Busy workers: 1
Debug:   Successfully compiled @angular/core : fesm2015
Debug: [Worker #1] Processing task: {entryPoint: @angular/common, formatProperty: fesm2015, processDts: true}
Debug: [Worker #2] Processing task: {entryPoint: @angular/cdk/collections, formatProperty: fesm2015, processDts: true}
Debug: [Worker #4] Processing task: {entryPoint: @angular/animations/browser, formatProperty: fesm2015, processDts: true}
Debug: [Worker #6] Processing task: {entryPoint: @angular/core/testing, formatProperty: fesm2015, processDts: true}
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #5] Processing task: {entryPoint: @angular/cdk/observers, formatProperty: fesm2015, processDts: true}
Debug: [Worker #3] Processing task: {entryPoint: @ngrx/store, formatProperty: fesm2015, processDts: true}
Debug: [Worker #7] Processing task: {entryPoint: ngx-window-token, formatProperty: fesm2015, processDts: true}
Debug: [Worker #8] Processing task: {entryPoint: @angular/core, formatProperty: fesm5, processDts: false}
Debug: [Worker #9] Processing task: {entryPoint: @angular/core, formatProperty: esm2015, processDts: false}
Compiling @angular/cdk/collections : fesm2015 as esm2015
Compiling @angular/common : fesm2015 as esm2015
Debug:   Successfully compiled @angular/cdk/collections : fesm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #2] Processing task: {entryPoint: @angular/cdk/accordion, formatProperty: fesm2015, processDts: true}
Compiling @angular/animations/browser : fesm2015 as esm2015
Compiling ngx-window-token : fesm2015 as esm2015
Debug:   Successfully compiled ngx-window-token : fesm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #7] Processing task: {entryPoint: @angular/core, formatProperty: esm5, processDts: false}
Debug:   Successfully compiled @angular/common : fesm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #1] Processing task: {entryPoint: @angular/cdk/platform, formatProperty: fesm2015, processDts: true}
Compiling @ngrx/store : fesm2015 as esm2015
Compiling @angular/cdk/observers : fesm2015 as esm2015
Debug:   Successfully compiled @angular/animations/browser : fesm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #4] Processing task: {entryPoint: @angular/cdk/bidi, formatProperty: fesm2015, processDts: true}
Compiling @angular/core/testing : fesm2015 as esm2015
Compiling @angular/core : fesm5 as esm5
Debug:   Successfully compiled @angular/cdk/observers : fesm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #5] Processing task: {entryPoint: @angular/platform-browser, formatProperty: fesm2015, processDts: true}
Debug:   Successfully compiled @ngrx/store : fesm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #3] Processing task: {entryPoint: @angular/common/http, formatProperty: fesm2015, processDts: true}
Debug:   Successfully compiled @angular/core/testing : fesm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #6] Processing task: {entryPoint: @angular/forms, formatProperty: fesm2015, processDts: true}
Compiling @angular/cdk/accordion : fesm2015 as esm2015
Compiling @angular/cdk/platform : fesm2015 as esm2015
Debug:   Successfully compiled @angular/cdk/platform : fesm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #1] Processing task: {entryPoint: @angular/cdk/a11y, formatProperty: fesm2015, processDts: true}
Debug:   Successfully compiled @angular/cdk/accordion : fesm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #2] Processing task: {entryPoint: @angular/cdk/portal, formatProperty: fesm2015, processDts: true}
Debug:   Successfully compiled @angular/core : fesm5
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #8] Processing task: {entryPoint: @angular/common/testing, formatProperty: fesm2015, processDts: true}
Compiling @angular/core : esm2015 as esm2015
Compiling @angular/cdk/bidi : fesm2015 as esm2015
Debug:   Successfully compiled @angular/cdk/bidi : fesm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #4] Processing task: {entryPoint: @angular/cdk/scrolling, formatProperty: fesm2015, processDts: true}
Compiling @angular/platform-browser : fesm2015 as esm2015
Debug:   Successfully compiled @angular/core : esm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #9] Processing task: {entryPoint: @angular/router, formatProperty: fesm2015, processDts: true}
Compiling @angular/common/http : fesm2015 as esm2015
Compiling @angular/forms : fesm2015 as esm2015
Debug:   Successfully compiled @angular/common/http : fesm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #3] Processing task: {entryPoint: @ngrx/effects, formatProperty: fesm2015, processDts: true}
Debug:   Successfully compiled @angular/platform-browser : fesm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #5] Processing task: {entryPoint: @angular/platform-browser-dynamic, formatProperty: fesm2015, processDts: true}
Compiling @angular/cdk/portal : fesm2015 as esm2015
Debug:   Successfully compiled @angular/forms : fesm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #6] Processing task: {entryPoint: @angular/platform-browser/testing, formatProperty: fesm2015, processDts: true}
Debug:   Successfully compiled @angular/cdk/portal : fesm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #2] Processing task: {entryPoint: @angular/platform-browser/animations, formatProperty: fesm2015, processDts: true}
Compiling @angular/core : esm5 as esm5
Compiling @angular/cdk/a11y : fesm2015 as esm2015
Debug:   Successfully compiled @angular/core : esm5
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #7] Processing task: {entryPoint: @angular/animations/browser/testing, formatProperty: fesm2015, processDts: true}
Debug:   Successfully compiled @angular/cdk/a11y : fesm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #1] Processing task: {entryPoint: @angular/cdk/clipboard, formatProperty: fesm2015, processDts: true}
Compiling @angular/common/testing : fesm2015 as esm2015
Debug:   Successfully compiled @angular/common/testing : fesm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #8] Processing task: {entryPoint: @angular/cdk/layout, formatProperty: fesm2015, processDts: true}
Compiling @angular/cdk/scrolling : fesm2015 as esm2015
Debug:   Successfully compiled @angular/cdk/scrolling : fesm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #4] Processing task: {entryPoint: @angular/cdk/drag-drop, formatProperty: fesm2015, processDts: true}
Compiling @ngrx/effects : fesm2015 as esm2015
Debug:   Successfully compiled @ngrx/effects : fesm2015
Debug: All 9 workers are currently busy and cannot take on more work.
Debug: [Worker #3] Processing task: {entryPoint: @angular/cdk/overlay, formatProperty: fesm2015, processDts: true}
Warning: Worker #1 exited unexpectedly (code: null | signal: SIGKILL).
  Current assignment: {entryPoint: @angular/cdk/clipboard, formatProperty: fesm2015, processDts: true}
Debug: Stopping 8 workers...
Debug: Attempting to remove lock-file at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__.
Debug: PIDs match (192), so removing /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__.
Error: Process unexpectedly crashed, while processing format property fesm2015 for entry-point '/home/circleci/app/node_modules/@angular/cdk/clipboard'.
    at ClusterMaster.onWorkerExit (/home/circleci/app/node_modules/@angular/compiler-cli/ngcc/src/execution/cluster/master.js:153:23)
    at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/src/execution/cluster/master.js:51:101
    at ClusterMaster. (/home/circleci/app/node_modules/@angular/compiler-cli/ngcc/src/execution/cluster/master.js:246:57)
    at step (/home/circleci/app/node_modules/tslib/tslib.js:136:27)
    at Object.next (/home/circleci/app/node_modules/tslib/tslib.js:117:57)
    at /home/circleci/app/node_modules/tslib/tslib.js:110:75
    at new Promise ()
    at Object.__awaiter (/home/circleci/app/node_modules/tslib/tslib.js:106:16)
    at EventEmitter. (/home/circleci/app/node_modules/@angular/compiler-cli/ngcc/src/execution/cluster/master.js:240:32)
    at EventEmitter.emit (events.js:200:13)
Debug: Attempting to remove lock-file at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__.
Debug: The lock-file at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__ was already removed.
Compiling @angular/platform-browser-dynamic : fesm2015 as esm2015
Debug:   Successfully compiled @angular/platform-browser-dynamic : fesm2015
Compiling @angular/platform-browser/testing : fesm2015 as esm2015
Debug: Attempting to remove lock-file at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__.
Debug: The lock-file at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__ was already removed.
Debug:   Successfully compiled @angular/platform-browser/testing : fesm2015
Debug: Attempting to remove lock-file at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__.
Debug: The lock-file at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__ was already removed.
Compiling @angular/router : fesm2015 as esm2015
Compiling @angular/platform-browser/animations : fesm2015 as esm2015
Debug:   Successfully compiled @angular/platform-browser/animations : fesm2015
Debug: Attempting to remove lock-file at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__.
Debug: The lock-file at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__ was already removed.
Debug:   Successfully compiled @angular/router : fesm2015
Debug: Attempting to remove lock-file at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__.
Debug: The lock-file at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__ was already removed.
Compiling @angular/animations/browser/testing : fesm2015 as esm2015
Debug:   Successfully compiled @angular/animations/browser/testing : fesm2015
Debug: Attempting to remove lock-file at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__.
Debug: The lock-file at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__ was already removed.
Compiling @angular/cdk/layout : fesm2015 as esm2015
Debug:   Successfully compiled @angular/cdk/layout : fesm2015
Debug: Attempting to remove lock-file at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__.
Debug: The lock-file at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__ was already removed.
Compiling @angular/cdk/drag-drop : fesm2015 as esm2015
Debug:   Successfully compiled @angular/cdk/drag-drop : fesm2015
Debug: Attempting to remove lock-file at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__.
Debug: The lock-file at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__ was already removed.
Compiling @angular/cdk/overlay : fesm2015 as esm2015
Debug:   Successfully compiled @angular/cdk/overlay : fesm2015
Debug: Attempting to remove lock-file at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__.
Debug: The lock-file at /home/circleci/app/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__ was already removed.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! test-ivy-app@0.0.0 ngcc: `ngcc --loglevel debug`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the test-ivy-app@0.0.0 ngcc script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/circleci/.npm/_logs/2020-03-27T15_41_27_725Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! test-ivy-app@0.0.0 postinstall: `npm run ngcc`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the test-ivy-app@0.0.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/circleci/.npm/_logs/2020-03-27T15_41_27_795Z-debug.log

🌍 Your Environment

Angular Version:


     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 9.1.0
Node: 12.3.1
OS: linux x64

Angular: 9.1.0
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser
... platform-browser-dynamic, platform-server, router
... service-worker
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.901.0
@angular-devkit/build-angular     0.901.0
@angular-devkit/build-optimizer   0.901.0
@angular-devkit/build-webpack     0.901.0
@angular-devkit/core              9.1.0
@angular-devkit/schematics        9.1.0
@angular/cdk                      9.2.0
@ngtools/webpack                  9.1.0
@schematics/angular               9.1.0
@schematics/update                0.901.0
rxjs                              6.5.3
typescript                        3.8.3
webpack                           4.42.0

Anything else relevant?

  1. If I ssh into the circle-ci container and run ngcc manually it completes successfully
  2. If I run ngcc locally it works
  3. When ngcc is kicked off from a post install step it fails, or even in circle ci with a stand-alone step it also fails
@paustint paustint changed the title ngcc crash ngcc crashing on every build Mar 27, 2020
@paustint paustint reopened this Mar 27, 2020
@petebacondarwin
Copy link
Member

We have seen this on our own CI builds and @gkalpak is currently investigating. We believe it might be that ngcc is creating a lot of workers to do the parallel processing, and Docker is complaining that it is using too much memory and arbitrarily killing processes. This might be due to ngcc reading that the current machine has more CPUs than the Docker instance is actually allocating.

@ngbot ngbot bot modified the milestone: needsTriage Mar 27, 2020
@petebacondarwin petebacondarwin changed the title ngcc crashing on every build ngcc crashing on every CI build Mar 27, 2020
@paustint
Copy link
Author

@petebacondarwin @gkalpak - when I set --async false, the build passed successfully, which supports the existing theory.

gkalpak added a commit to gkalpak/angular that referenced this issue Mar 27, 2020
When running in parallel mode, ngcc spawns multiple worker processed to
process the various entry-points. The number of max allowed processes is
determined by the number of CPU cores available to the OS. There is also
currently an [upper limit of 8][1]. The number of active workers is in
turn inferred by the number of [task assignments][2].

In the past, counting the entries of `ClusterMaster#taskAssignments` was
enough, because worker processes were spawned eagerly at the beginning
and corresponding entries were created in `taskAssignments`.
Since angular#35719 however, worker processes are spawned lazily on an as
needed basis. Because there is some delay between
[spawning a process][3] and [inserting it][4] into `taskAssignments`,
there is a short period of time when `taskAssignment.size` does not
actually represent the number of spawned processes. This can result in
spawning more than `ClusterMaster#workerCount` processes.

An example of this can be seen in angular#36278, where the debug logs indicate
9 worker processes had been spawned (`All 9 workers are currently busy`)
despite the hard limit of 8.

This commit fixes this by using `cluster.workers` to compute the number
of spawned worker processes. `cluster.workers` is updated synchronously
with `cluster.fork()` and thus reflects the number of spawned workers
accurately at all times.

[1]: https://github.com/angular/angular/blob/b8e9a30d3b6/packages/compiler-cli/ngcc/src/main.ts#L429
[2]: https://github.com/angular/angular/blob/b8e9a30d3b6/packages/compiler-cli/ngcc/src/execution/cluster/master.ts#L108
[3]: https://github.com/angular/angular/blob/b8e9a30d3b6/packages/compiler-cli/ngcc/src/execution/cluster/master.ts#L110
[4]: https://github.com/angular/angular/blob/b8e9a30d3b6/packages/compiler-cli/ngcc/src/execution/cluster/master.ts#L199
@petebacondarwin
Copy link
Member

Yes that is the current workaround.

alxhub pushed a commit that referenced this issue Mar 27, 2020
…#36280)

When running in parallel mode, ngcc spawns multiple worker processed to
process the various entry-points. The number of max allowed processes is
determined by the number of CPU cores available to the OS. There is also
currently an [upper limit of 8][1]. The number of active workers is in
turn inferred by the number of [task assignments][2].

In the past, counting the entries of `ClusterMaster#taskAssignments` was
enough, because worker processes were spawned eagerly at the beginning
and corresponding entries were created in `taskAssignments`.
Since #35719 however, worker processes are spawned lazily on an as
needed basis. Because there is some delay between
[spawning a process][3] and [inserting it][4] into `taskAssignments`,
there is a short period of time when `taskAssignment.size` does not
actually represent the number of spawned processes. This can result in
spawning more than `ClusterMaster#workerCount` processes.

An example of this can be seen in #36278, where the debug logs indicate
9 worker processes had been spawned (`All 9 workers are currently busy`)
despite the hard limit of 8.

This commit fixes this by using `cluster.workers` to compute the number
of spawned worker processes. `cluster.workers` is updated synchronously
with `cluster.fork()` and thus reflects the number of spawned workers
accurately at all times.

[1]: https://github.com/angular/angular/blob/b8e9a30d3b6/packages/compiler-cli/ngcc/src/main.ts#L429
[2]: https://github.com/angular/angular/blob/b8e9a30d3b6/packages/compiler-cli/ngcc/src/execution/cluster/master.ts#L108
[3]: https://github.com/angular/angular/blob/b8e9a30d3b6/packages/compiler-cli/ngcc/src/execution/cluster/master.ts#L110
[4]: https://github.com/angular/angular/blob/b8e9a30d3b6/packages/compiler-cli/ngcc/src/execution/cluster/master.ts#L199

PR Close #36280
alxhub pushed a commit that referenced this issue Mar 27, 2020
…#36280)

When running in parallel mode, ngcc spawns multiple worker processed to
process the various entry-points. The number of max allowed processes is
determined by the number of CPU cores available to the OS. There is also
currently an [upper limit of 8][1]. The number of active workers is in
turn inferred by the number of [task assignments][2].

In the past, counting the entries of `ClusterMaster#taskAssignments` was
enough, because worker processes were spawned eagerly at the beginning
and corresponding entries were created in `taskAssignments`.
Since #35719 however, worker processes are spawned lazily on an as
needed basis. Because there is some delay between
[spawning a process][3] and [inserting it][4] into `taskAssignments`,
there is a short period of time when `taskAssignment.size` does not
actually represent the number of spawned processes. This can result in
spawning more than `ClusterMaster#workerCount` processes.

An example of this can be seen in #36278, where the debug logs indicate
9 worker processes had been spawned (`All 9 workers are currently busy`)
despite the hard limit of 8.

This commit fixes this by using `cluster.workers` to compute the number
of spawned worker processes. `cluster.workers` is updated synchronously
with `cluster.fork()` and thus reflects the number of spawned workers
accurately at all times.

[1]: https://github.com/angular/angular/blob/b8e9a30d3b6/packages/compiler-cli/ngcc/src/main.ts#L429
[2]: https://github.com/angular/angular/blob/b8e9a30d3b6/packages/compiler-cli/ngcc/src/execution/cluster/master.ts#L108
[3]: https://github.com/angular/angular/blob/b8e9a30d3b6/packages/compiler-cli/ngcc/src/execution/cluster/master.ts#L110
[4]: https://github.com/angular/angular/blob/b8e9a30d3b6/packages/compiler-cli/ngcc/src/execution/cluster/master.ts#L199

PR Close #36280
@poloagustin
Copy link

Hi, @paustint , I'm having (i think) the same problem in CircleCI.

I'm running this command ng build frontend --prod

And I'm getting

Warning: Worker #1 exited unexpectedly (code: null | signal: SIGKILL).
  Current assignment: {entryPoint: @angular/cdk/table, formatProperty: es2015, processDts: true}
Error: Process unexpectedly crashed, while processing format property es2015 for entry-point '/home/circleci/project/node_modules/@angular/cdk/table'.

Where should I add the --async false workaround?
I tried passing the argument to ng build but it's not recognized

Thanks in advance!

@petebacondarwin
Copy link
Member

Unfortunately you cannot tell CLI to run ngcc sync. But as a workaround you could run ngcc as a prebuild step on your CI directly from the command line where it can have the --no-async/--async=false option. This will process everything first and so the async call to ngcc from CLI will have no work to do and should not cause a crash.

@paustint
Copy link
Author

paustint commented Apr 1, 2020

@poloagustin - you will need to manually invoke ngcc as a step prior to building your application. The easiest way to do this by adding/upadting the postinstall script in your package.json.

Example:
"postinstall": "ngcc --properties es2015 browser module main --async false",

You could also do something like this and use npm run ngcc prior to running ng build
"ngcc": "ngcc --properties es2015 browser module main --async false",

The key factor is that you will want to pre-run ngcc so that it does not need to run again when you run ng build

@altenull
Copy link

altenull commented Apr 3, 2020

I've added "ngcc" script @paustint commented, then ngcc crashing on circleci doesn't happen for me.
Thanks a lot!

GregorBiswanger added a commit to GregorBiswanger/rxjs-fruits that referenced this issue Apr 13, 2020
GregorBiswanger added a commit to GregorBiswanger/rxjs-fruits that referenced this issue Apr 13, 2020
@trew
Copy link

trew commented Apr 14, 2020

FYI this is still happening for me in 9.1.1.

@meriturva
Copy link

And same here with 9.1.2 version.

gkalpak added a commit to gkalpak/angular that referenced this issue Apr 20, 2020
@maroy1986
Copy link

@poloagustin - you will need to manually invoke ngcc as a step prior to building your application. The easiest way to do this by adding/upadting the postinstall script in your package.json.

Example:
"postinstall": "ngcc --properties es2015 browser module main --async false",

You could also do something like this and use npm run ngcc prior to running ng build
"ngcc": "ngcc --properties es2015 browser module main --async false",

The key factor is that you will want to pre-run ngcc so that it does not need to run again when you run ng build

I would add something to this. If you're using CircleCI or any other CI utility that allows caching dependencies, you might want to skip the ngcc compile if the binaries are already available from the cache. To do so, change the postinstall script to this :

"postinstall": "ngcc --properties es2015 browser module main --async false --first-only",

This way, if binaries were restored from the cache, you'll save some precious time here. In our case on CircleCI that saved us around 5 mins...

@poloagustin
Copy link

Thanks for the comments!
I managed to make it build by changing my build job in CircleCI as following:

  build-frontend:
    executor: node-executor
    steps:
      - attach_workspace:
          at: .
      - run:
          name: Build Frontend w/ Production Configuration
          command: |
            npm run ngcc:sync
            NODE_OPTIONS="--max-old-space-size=4096"
            npm run build:frontend
      - persist_to_workspace:
          root: .
          paths:
            - dist/apps/frontend

in package.json scripts:

"ngcc:sync": "ngcc --async=false",
"build:frontend": "ng build frontend --prod",

Thanks for the help!

PS: I'll try changing the ngcc part to ngcc --properties es2015 browser module main --async false --first-only ;)

@maroy1986
Copy link

@poloagustin Looks like you use an older version of Node in your circle ci build. You shouldn't have to set the --max-old-space-size. Ensure you use at least the latest node 12.x image and you should be able to get rid of this. I'm using circleci/node:12.16.2 in our builds and doesn't need that. Before that we were using circleci/node:10.16.0 and we would have need to do this hack but there's no point since Angular 9 clearly specify that you should use at least node 12. :)

gkalpak added a commit to gkalpak/angular that referenced this issue Apr 22, 2020
Previously, when running in parallel mode and a worker process crashed
while processing a task, it was not possible for ngcc to continue
without risking ending up with a corrupted entry-point and therefore it
exited with an error. This, for example, could happen when a worker
process received a `SIGKILL` signal, which was frequently observed in CI
environments. This was probably the result of Docker killing processes
due to increased memory pressure.

One factor that amplifies the problem under Docker (which is often used
in CI) is that it is not possible to distinguish between the available
CPU cores on the host machine and the ones made available to Docker
containers, thus resulting in ngcc spawning too many worker processes.

This commit addresses these issues in the following ways:

1. We take advantage of the fact that files are written to disk only
   after an entry-point has been fully analyzed/compiled. The master
   process can now determine whether a worker process has not yet
   started writing files to disk (even if it was in the middle of
   processing a task) and just put the task back into the tasks queue if
   the worker process crashes.

2. The master process keeps track of the transformed files that a worker
   process will attempt to write to disk. If the worker process crashes
   while writing files, the master process can revert any changes and
   put the task back into the tasks queue (without risking corruption).

3. When a worker process crashes while processing a task (which can be a
   result of increased memory pressure or too many worker processes),
   the master process will not try to re-spawn it. This way the number
   or worker processes is gradually adjusted to a level that can be
   accomodated by the system's resources.

Examples of ngcc being able to recover after a worker process crashed:
- While idling: https://circleci.com/gh/angular/angular/682197
- While compiling: https://circleci.com/gh/angular/angular/682209
- While writing files: https://circleci.com/gh/angular/angular/682267

Jira issue: [FW-2008](https://angular-team.atlassian.net/browse/FW-2008)

Fixes angular#36278
gkalpak added a commit to gkalpak/angular that referenced this issue Apr 28, 2020
Previously, when running in parallel mode and a worker process crashed
while processing a task, it was not possible for ngcc to continue
without risking ending up with a corrupted entry-point and therefore it
exited with an error. This, for example, could happen when a worker
process received a `SIGKILL` signal, which was frequently observed in CI
environments. This was probably the result of Docker killing processes
due to increased memory pressure.

One factor that amplifies the problem under Docker (which is often used
in CI) is that it is not possible to distinguish between the available
CPU cores on the host machine and the ones made available to Docker
containers, thus resulting in ngcc spawning too many worker processes.

This commit addresses these issues in the following ways:

1. We take advantage of the fact that files are written to disk only
   after an entry-point has been fully analyzed/compiled. The master
   process can now determine whether a worker process has not yet
   started writing files to disk (even if it was in the middle of
   processing a task) and just put the task back into the tasks queue if
   the worker process crashes.

2. The master process keeps track of the transformed files that a worker
   process will attempt to write to disk. If the worker process crashes
   while writing files, the master process can revert any changes and
   put the task back into the tasks queue (without risking corruption).

3. When a worker process crashes while processing a task (which can be a
   result of increased memory pressure or too many worker processes),
   the master process will not try to re-spawn it. This way the number
   or worker processes is gradually adjusted to a level that can be
   accomodated by the system's resources.

Examples of ngcc being able to recover after a worker process crashed:
- While idling: https://circleci.com/gh/angular/angular/682197
- While compiling: https://circleci.com/gh/angular/angular/682209
- While writing files: https://circleci.com/gh/angular/angular/682267

Jira issue: [FW-2008](https://angular-team.atlassian.net/browse/FW-2008)

Fixes angular#36278
gkalpak added a commit to gkalpak/angular that referenced this issue Apr 29, 2020
Previously, when running in parallel mode and a worker process crashed
while processing a task, it was not possible for ngcc to continue
without risking ending up with a corrupted entry-point and therefore it
exited with an error. This, for example, could happen when a worker
process received a `SIGKILL` signal, which was frequently observed in CI
environments. This was probably the result of Docker killing processes
due to increased memory pressure.

One factor that amplifies the problem under Docker (which is often used
in CI) is that it is not possible to distinguish between the available
CPU cores on the host machine and the ones made available to Docker
containers, thus resulting in ngcc spawning too many worker processes.

This commit addresses these issues in the following ways:

1. We take advantage of the fact that files are written to disk only
   after an entry-point has been fully analyzed/compiled. The master
   process can now determine whether a worker process has not yet
   started writing files to disk (even if it was in the middle of
   processing a task) and just put the task back into the tasks queue if
   the worker process crashes.

2. The master process keeps track of the transformed files that a worker
   process will attempt to write to disk. If the worker process crashes
   while writing files, the master process can revert any changes and
   put the task back into the tasks queue (without risking corruption).

3. When a worker process crashes while processing a task (which can be a
   result of increased memory pressure or too many worker processes),
   the master process will not try to re-spawn it. This way the number
   or worker processes is gradually adjusted to a level that can be
   accomodated by the system's resources.

Examples of ngcc being able to recover after a worker process crashed:
- While idling: https://circleci.com/gh/angular/angular/682197
- While compiling: https://circleci.com/gh/angular/angular/682209
- While writing files: https://circleci.com/gh/angular/angular/682267

Jira issue: [FW-2008](https://angular-team.atlassian.net/browse/FW-2008)

Fixes angular#36278
AndrewKushnir pushed a commit that referenced this issue Apr 29, 2020
Previously, when running in parallel mode and a worker process crashed
while processing a task, it was not possible for ngcc to continue
without risking ending up with a corrupted entry-point and therefore it
exited with an error. This, for example, could happen when a worker
process received a `SIGKILL` signal, which was frequently observed in CI
environments. This was probably the result of Docker killing processes
due to increased memory pressure.

One factor that amplifies the problem under Docker (which is often used
in CI) is that it is not possible to distinguish between the available
CPU cores on the host machine and the ones made available to Docker
containers, thus resulting in ngcc spawning too many worker processes.

This commit addresses these issues in the following ways:

1. We take advantage of the fact that files are written to disk only
   after an entry-point has been fully analyzed/compiled. The master
   process can now determine whether a worker process has not yet
   started writing files to disk (even if it was in the middle of
   processing a task) and just put the task back into the tasks queue if
   the worker process crashes.

2. The master process keeps track of the transformed files that a worker
   process will attempt to write to disk. If the worker process crashes
   while writing files, the master process can revert any changes and
   put the task back into the tasks queue (without risking corruption).

3. When a worker process crashes while processing a task (which can be a
   result of increased memory pressure or too many worker processes),
   the master process will not try to re-spawn it. This way the number
   or worker processes is gradually adjusted to a level that can be
   accomodated by the system's resources.

Examples of ngcc being able to recover after a worker process crashed:
- While idling: https://circleci.com/gh/angular/angular/682197
- While compiling: https://circleci.com/gh/angular/angular/682209
- While writing files: https://circleci.com/gh/angular/angular/682267

Jira issue: [FW-2008](https://angular-team.atlassian.net/browse/FW-2008)

Fixes #36278

PR Close #36626
@mikeandtherest
Copy link

I see that this was closed some hours ago, but after taking 9.1.4 we still get the error on our CircleCI build pipeline (unless we use the ngcc async=false workaround).

Maybe the fix is not part of 9.1.4?

@petebacondarwin
Copy link
Member

petebacondarwin commented Apr 30, 2020

@mikeandtherest Can you provide details of your errors? Perhaps it would be cleanest to create a new issue with the detail and link to this one?

For the record the changes made in the linked PR should make ngcc resilient to worker processes being killed. It may still show processes crashing but the processing should proceed successfully.

@mikeandtherest
Copy link

I'd rather continue the discussion here, since I bet there are a lot of us already watching this thread.

Regarding the actual error, this is what we get in the CircleCI pipeline:

npx ng build --configuration staging
Warning: Entry point '@ngrx/core' contains deep imports into '/home/circleci/autowass-ui/node_modules/rxjs/Subscriber', '/home/circleci/autowass-ui/node_modules/rxjs/operator/pluck', '/home/circleci/autowass-ui/node_modules/rxjs/operator/map', '/home/circleci/autowass-ui/node_modules/rxjs/operator/distinctUntilChanged', '/home/circleci/autowass-ui/node_modules/rxjs/Operator', '/home/circleci/autowass-ui/node_modules/rxjs/Observable'. This is probably not a problem, but may cause the compilation of entry points to be out of order.
Warning: Entry point 'angular5-social-login' contains deep imports into '/home/circleci/autowass-ui/node_modules/rxjs/BehaviorSubject', '/home/circleci/autowass-ui/node_modules/rxjs/Observable'. This is probably not a problem, but may cause the compilation of entry points to be out of order.
Compiling primeng/dom : module as esm5
Compiling @angular/cdk/keycodes : module as esm5
Compiling @angular/animations : module as esm5
Compiling @angular/compiler/testing : module as esm5
Compiling @ngrx/core : module as esm5
Compiling @angular/core : module as esm5
Compiling @angular/common : module as esm5
Compiling @angular/animations/browser : module as esm5
Compiling @angular/cdk/collections : module as esm5
Compiling @angular/cdk/observers : module as esm5
Compiling @angular/core/testing : module as esm5
Compiling @ngrx/store : module as esm5
Compiling @ngx-translate/core : module as esm5
Compiling @angular/cdk/platform : module as esm5
Compiling angular2-focus : module as esm5
Compiling @angular/forms : module as esm5
Compiling @angular/cdk/bidi : module as esm5
Compiling @angular/platform-browser : module as esm5
Compiling @angular/cdk/portal : module as esm5
Compiling @angular/router : module as esm5
Compiling primeng/button : module as esm5
Compiling @angular/cdk/a11y : module as esm5
Compiling @angular/common/http : module as esm5
Compiling primeng/tooltip : module as esm5
Compiling @angular/cdk/scrolling : module as esm5
Compiling @angular/platform-browser/animations : module as esm5
Compiling @angular/cdk/layout : module as esm5
Compiling primeng/inputtext : module as esm5
Compiling primeng/api : module as esm5
Compiling primeng/progressbar : module as esm5
Compiling @angular/cdk/text-field : module as esm5
Compiling @angular/flex-layout/core : module as esm5
Compiling primeng/focustrap : module as esm5
Compiling primeng/utils : module as esm5
Compiling @angular/material/core : module as esm5
Compiling @angular/cdk/overlay : module as esm5
Compiling @angular/cdk/accordion : module as esm5
Compiling primeng/messages : module as esm5
Compiling @angular/cdk/stepper : module as esm5
Compiling @angular/flex-layout/extended : module as esm5
Compiling primeng/dropdown : module as esm5
Compiling @angular/flex-layout/flex : module as esm5
Compiling @angular/flex-layout/grid : module as esm5
Compiling @angular/cdk/table : module as esm5
Compiling @angular/material/form-field : module as esm5
Compiling @angular/material/button : module as esm5
Compiling @angular/material/icon : module as esm5
Compiling @angular/material/divider : module as esm5
Compiling primeng/paginator : module as esm5
Compiling @angular/material/sort : module as esm5
Compiling @angular/material/dialog : module as esm5
Compiling @angular/material/tooltip : module as esm5
Compiling @angular/material/select : module as esm5
Compiling @angular/material/input : module as esm5
Compiling @angular/cdk/tree : module as esm5
Compiling @angular/platform-browser/testing : module as esm5
Compiling @angular/common/testing : module as esm5
Compiling @angular/platform-browser-dynamic : module as esm5
Compiling primeng/accordion : module as esm5
Compiling @ngrx/effects : module as esm5
Compiling primeng/autocomplete : module as esm5
Compiling primeng/blockui : module as esm5
Compiling @angular/material/paginator : module as esm5
Compiling primeng/breadcrumb : module as esm5
Compiling primeng/calendar : module as esm5
Compiling primeng/captcha : module as esm5
Compiling primeng/card : module as esm5
Compiling primeng/carousel : module as esm5
Compiling primeng/checkbox : module as esm5
Warning: Worker #8 exited unexpectedly (code: null | signal: SIGKILL).
  Current assignment: {entryPoint: primeng/dataview, formatProperty: module, processDts: true}
Error: Process unexpectedly crashed, while processing format property module for entry-point '/home/circleci/autowass-ui/node_modules/primeng/dataview'.
    at ClusterMaster.onWorkerExit (/home/circleci/autowass-ui/node_modules/@angular/compiler-cli/ngcc/src/execution/cluster/master.js:155:23)
    at /home/circleci/autowass-ui/node_modules/@angular/compiler-cli/ngcc/src/execution/cluster/master.js:53:101
    at ClusterMaster.<anonymous> (/home/circleci/autowass-ui/node_modules/@angular/compiler-cli/ngcc/src/execution/cluster/master.js:248:57)
    at step (/home/circleci/autowass-ui/node_modules/tslib/tslib.js:139:27)
    at Object.next (/home/circleci/autowass-ui/node_modules/tslib/tslib.js:120:57)
    at /home/circleci/autowass-ui/node_modules/tslib/tslib.js:113:75
    at new Promise (<anonymous>)
    at Object.__awaiter (/home/circleci/autowass-ui/node_modules/tslib/tslib.js:109:16)
    at EventEmitter.<anonymous> (/home/circleci/autowass-ui/node_modules/@angular/compiler-cli/ngcc/src/execution/cluster/master.js:242:32)
    at EventEmitter.emit (events.js:315:20)
An unhandled exception occurred: NGCC failed.
See "/tmp/ng-AdDj8w/angular-errors.log" for further details.

Exited with code exit status 127

If I put back the workaround with ngcc --properties es2015 browser module main --async false before running ng build, the error is gone.

@petebacondarwin
Copy link
Member

Oh sorry! I just noticed that this PR was merged after 9.1.4 was released. See https://github.com/angular/angular/commits/9.1.x

@mikeandtherest
Copy link

Hmm, weird. Because it says that all these were merged into master 16h ago, while the actual release happened 10h ago. But by looking at that link you posted above, it seems that indeed they came after the release.

@petebacondarwin
Copy link
Member

There may have been a delay between merging to master and merging to patch.

@smuellener
Copy link

9.1.5 then?

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jun 4, 2020
profanis pushed a commit to profanis/angular that referenced this issue Sep 5, 2020
…36626)

Previously, when running in parallel mode and a worker process crashed
while processing a task, it was not possible for ngcc to continue
without risking ending up with a corrupted entry-point and therefore it
exited with an error. This, for example, could happen when a worker
process received a `SIGKILL` signal, which was frequently observed in CI
environments. This was probably the result of Docker killing processes
due to increased memory pressure.

One factor that amplifies the problem under Docker (which is often used
in CI) is that it is not possible to distinguish between the available
CPU cores on the host machine and the ones made available to Docker
containers, thus resulting in ngcc spawning too many worker processes.

This commit addresses these issues in the following ways:

1. We take advantage of the fact that files are written to disk only
   after an entry-point has been fully analyzed/compiled. The master
   process can now determine whether a worker process has not yet
   started writing files to disk (even if it was in the middle of
   processing a task) and just put the task back into the tasks queue if
   the worker process crashes.

2. The master process keeps track of the transformed files that a worker
   process will attempt to write to disk. If the worker process crashes
   while writing files, the master process can revert any changes and
   put the task back into the tasks queue (without risking corruption).

3. When a worker process crashes while processing a task (which can be a
   result of increased memory pressure or too many worker processes),
   the master process will not try to re-spawn it. This way the number
   or worker processes is gradually adjusted to a level that can be
   accomodated by the system's resources.

Examples of ngcc being able to recover after a worker process crashed:
- While idling: https://circleci.com/gh/angular/angular/682197
- While compiling: https://circleci.com/gh/angular/angular/682209
- While writing files: https://circleci.com/gh/angular/angular/682267

Jira issue: [FW-2008](https://angular-team.atlassian.net/browse/FW-2008)

Fixes angular#36278

PR Close angular#36626
torsten-simon pushed a commit to edu-sharing/edu-sharing-community-repository that referenced this issue Dec 15, 2022
torsten-simon pushed a commit to edu-sharing/edu-sharing-community-repository that referenced this issue Dec 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.