Skip to content

Flaky ELIFECYCLE/3221225477 exit error with win10/nodejs@14 #2660

Description

@dr-js
  • Version: v14.0.0 and v14.1.0
  • Platform: Windows 10
  • Subsystem:

What steps will reproduce the bug?

I got flaky ELIFECYCLE/3221225477 exit error from both:

  • GitHub Actions (win10/nodejs@14.1.0/npm@6.14.4)
    • win32 - 10.0.17763 [x64] from (Log CI info)
  • local machine (win10/nodejs@14.0.0/npm@6.14.3)
    • 10.0.18363 from node -p "os.release()"

The exited process is babel, under bootstrap JS script and multiple npm run. the layer is like:

  • cmd.exe
    • npm test
      • npm run script-pack-test
        • node -r @babel/register ./script verbose pack test
          • npm run build-library
            • babel ./source --out-dir ./output-gitignore/library

The main error output from GitHub Actions:

> @dr-js/dev@0.3.0-dev.9 build-library D:\a\dr-dev\dr-dev
> babel ./source --out-dir ./output-gitignore/library

npm ERR! code ELIFECYCLE
npm ERR! errno 3221225477
npm ERR! @dr-js/dev@0.3.0-dev.9 build-library: `babel ./source --out-dir ./output-gitignore/library`
npm ERR! Exit status 3221225477
npm ERR! 
npm ERR! Failed at the @dr-js/dev@0.3.0-dev.9 build-library 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!     C:\npm\cache\_logs\2020-04-30T03_38_16_411Z-debug.log
Error: Command failed: npm run build-library
    at checkExecSyncError (child_process.js:611:11)

    at execSync (child_process.js:647:15)
## error after 3.71s: Error: Command failed: npm run build-library  [verbose+pack+test|3.71s]
    at execShell (D:\a\dr-dev\dr-dev\script\/index.js:19:32)
    at buildOutput (D:\a\dr-dev\dr-dev\script\/index.js:25:3)
    at D:\a\dr-dev\dr-dev\script\/index.js:85:9 {
  status: 3221225477,
  signal: null,
  output: [ null, null, null ],
  pid: 6504,
  stdout: null,
  stderr: null
}
npm ERR! code ELIFECYCLE
npm ERR! errno 4294967295
npm ERR! @dr-js/dev@0.3.0-dev.9 script-pack-test: `node -r @babel/register ./script verbose pack test`
npm ERR! Exit status 4294967295
npm ERR! 
npm ERR! Failed at the @dr-js/dev@0.3.0-dev.9 script-pack-test 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!     C:\npm\cache\_logs\2020-04-30T03_38_16_552Z-debug.log
npm ERR! Test failed.  See above for more details.
##[error]Process completed with exit code 1.

How often does it reproduce? Is there a required condition?

Flaky, same build may pass on second run

What is the expected behavior?

Not exit

What do you see instead?

Related CI runs:

And some npm error log from my local build:

Additional information

Possible related issue about status 3221225477: nodejs/node#25512

Activity

  1. transferred this issue fromnodejs/nodeon Apr 30, 2020
  2. Hakerh400 commented on Apr 30, 2020

    @Hakerh400

    Error 3221225477 stands for Access violation on Windows. Does your script (or any of your dependencies) uses any native modules (.node files) that are compiled from C++ source? If you are using only JavaScript files, it may be a bug in V8 engine, or maybe a stack overflow if you have too deep recursion and V8 miscalculated stack size.

    I cloned your repo and experienced the same error on first run, but I cannot reproduce it again (tried more than 200 times).

  3. dr-js commented on Apr 30, 2020

    @dr-js
    Author

    True it's harder to hit locally, on the GitHub CI it's like 1 exit in 4 runs.

    I doubt it may be relate to fresh install, babel do keep cache under ./node_modules/.cache,
    but deleting it locally or using npm ci don't seem to trigger the exit.

  4. dr-js commented on Apr 30, 2020

    @dr-js
    Author

    And one wired thing is I only got the exit in dr-js/dr-dev.
    My other repo use similar setup do not hit the exit, locally or on GitHub CI, like: dr-js/dr-js and dr-js/dr-node

    The difference I can think of may be:

    • the 1 level deeper nested npm run
    • the source code is reused to build itself:
      • imported from the ./script/index.js with
        "script-pack-test": "node -r @babel/register ./script verbose pack test"
      • later build by babel with
        "build-library": "babel ./source --out-dir ./output-gitignore/library"
  5. added a commit that references this issue on Apr 30, 2020
  6. dr-js commented on Apr 30, 2020

    @dr-js
    Author

    And I only see exit on win10 + nodejs@14 so far:

    I'll add more detail if I manage to get the exit again,
    and I think to reproduce the CI exit you can fork dr-js/dr-dev and push some change to trigger the CI

    I also created a branch for CI to test win10 + nodejs@12|13|14: test-3221225477-exit and got the same nodejs@14 fail on first run: https://github.com/dr-js/dr-dev/actions/runs/91997364

  7. dr-js commented on May 1, 2020

    @dr-js
    Author

    Some update:

    Tried reduce the script layer to 1 level of npm, and got 1 exit in 4 CI runs:

    Then Run directly with node, and got a powershell error:

    • https://github.com/dr-js/dr-dev/actions/runs/92731124
      > node ./node_modules/@dr-js/dev/bin/index.js --EE BABEL_ENV=module -E -- node ./node_modules/@babel/cli/bin/babel.js ./source --out-dir ./output-gitignore/module
      shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
      ##[error]Process completed with exit code 1.
      

    So change to cmd and got 1 exit in 4 runs:

    2 error happens on the command with 1 more layers of spawn, but the one with cmd is not

  8. dr-js commented on May 1, 2020

    @dr-js
    Author

    Update:

    Currently reduced test case to:
    https://github.com/dr-js/dr-dev/actions/runs/92784081

    But compared to previous test case with more files, the fail rate seems lower (1 fail vs 2 early fail):
    https://github.com/dr-js/dr-dev/actions/runs/92775421

    Maybe related to the reduce file count to resolve and parse?
    Still not sure if both plugin is need to trigger the exit, will continue reduce test later.

  9. dr-js commented on May 1, 2020

    @dr-js
    Author

    Update:

    Enabled more debug log and found the exit happens before the @babel/env plugin gets load:

    {TIMESTAMP} babel:config:loading:files:configuration Found configuration 'd:\\a\\dr-dev\\dr-dev\\babel.config.js' from 'd:\\a\\dr-dev\\dr-dev'.
    {TIMESTAMP} babel:config:loading:files:plugins Loaded plugin 'minify-replace' from 'd:\\a\\dr-dev\\dr-dev'.
    {TIMESTAMP} babel:config:loading:files:plugins Loaded plugin 'module-resolver' from 'd:\\a\\dr-dev\\dr-dev'.
    <-- may exit with exit code -1073741819 -->
    {TIMESTAMP} babel:config:loading:files:plugins Loaded preset '@babel/env' from 'd:\\a\\dr-dev\\dr-dev'.
    source\babel.js -> output-gitignore\library\babel.js
    {TIMESTAMP} babel:config:loading:files:configuration Found configuration 'd:\\a\\dr-dev\\dr-dev\\babel.config.js' from 'd:\\a\\dr-dev\\dr-dev'.
    {TIMESTAMP} babel:config:loading:files:configuration Found configuration 'd:\\a\\dr-dev\\dr-dev\\babel.config.js' from 'd:\\a\\dr-dev\\dr-dev'.
    source\common\dev.js -> output-gitignore\library\common\dev.js
    

    Related CI run: https://github.com/dr-js/dr-dev/actions/runs/92845322

  10. added a commit that references this issue on May 6, 2020
  11. yperson commented on Jun 4, 2020

    @yperson

    Did you find a workaround or the rootcause?
    I'm experiencing the same kind of issue with a simple 'npm test' on a Windows Server 2016 + Node@14 setup when it's scheduled through the Windows Task Scheduler: flaky failures with 3221225477 error code.
    Running 'npm test' in a terminal works 100% of the time though.

  12. dr-js commented on Jun 4, 2020

    @dr-js
    Author

    Not yet, for me the error is hard to trigger on my local win10 laptop (1 in 50), but very often on GitHub Action (1 in 3).

    With the above added test, my current guess is the problem maybe win10 plus:

    • the platform is under virtualization (CI)
    • not work well with too many CPU/RAM
    • heavy fs IO on some fs/disk/device
  13. yperson commented on Jun 4, 2020

    @yperson

    I can confirm the platform is also virtualized on my side (VM)

  14. added 2 commits that reference this issue on Jul 11, 2020
  15. dr-js commented on Jul 11, 2020

    @dr-js
    Author

    Update:

    just did a few test with nodejs@14.4.0 and the problem seems gone.
    also verify again with nodejs@14.1.0 still error with: exit code -1073741819

    Related CI run:

  16. added a commit that references this issue on Oct 12, 2020
  17. usersina commented on Mar 26, 2021

    @usersina

    I have the exact same error when executing an oracledb query with nodejs@14.15.3
    Here's the github issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions