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

20.0.8 Maximum call stack size exceeded on run-many #28788

Closed
1 of 4 tasks
yharaskrik opened this issue Nov 4, 2024 · 9 comments · Fixed by #28793
Closed
1 of 4 tasks

20.0.8 Maximum call stack size exceeded on run-many #28788

yharaskrik opened this issue Nov 4, 2024 · 9 comments · Fixed by #28793
Assignees
Labels
scope: core core nx functionality type: bug

Comments

@yharaskrik
Copy link
Contributor

Current Behavior

I recently upgraded to 20.0.7 but then realized there was an issue with dependent projects, but then 20.0.8 was released the fix for that, just tried it this morning but now I am getting

$ nx run-many -t generate-schema --parallel

 NX   Maximum call stack size exceeded

Pass --verbose to see the stacktrace.

error: script "nx" exited with code 1

Exited with code exit status 1

I successfully ran another command prior to this in CI though so its not all commands (nx run-many -t generate-prisma-client --parallel).

Note: this ran find on 20.0.7 so the issue was introduced in 20.0.8

Expected Behavior

Run-many works correctly.

GitHub Repo

No response

Steps to Reproduce

Unsure, would assume it has to do with the graph and possibly a circular dependency.

Nx Report

 NX   Report complete - copy this into the issue template

Node           : 22.8.0
OS             : darwin-arm64
Native Target  : aarch64-macos
yarn           : 1.22.17

nx                      : 20.0.8
@nx/js                  : 20.0.8
@nrwl/js                : 19.8.3
@nx/jest                : 20.0.8
@nrwl/jest              : 19.8.3
@nx/linter              : 19.8.3
@nx/eslint              : 20.0.8
@nx/workspace           : 20.0.8
@nrwl/workspace         : 19.8.3
@nx/angular             : 20.0.8
@nrwl/angular           : 19.8.3
@nx/cypress             : 20.0.8
@nrwl/cypress           : 19.8.3
@nx/devkit              : 20.0.8
@nrwl/devkit            : 19.6.5
@nx/esbuild             : 20.0.8
@nrwl/esbuild           : 19.8.3
@nx/eslint-plugin       : 20.0.8
@nrwl/eslint-plugin-nx  : 19.8.3
@nx/express             : 20.0.8
@nrwl/express           : 19.8.3
@nx/nest                : 20.0.8
@nrwl/nest              : 19.8.3
@nx/node                : 20.0.8
@nrwl/node              : 19.8.3
@nx/plugin              : 20.0.8
@nrwl/nx-plugin         : 19.8.3
@nx/rspack              : 20.0.8
@nrwl/rspack            : 19.8.0
@nx/storybook           : 20.0.8
@nrwl/storybook         : 19.8.3
@nrwl/tao               : 19.6.5
@nx/vite                : 20.0.8
@nrwl/vite              : 19.8.3
@nx/web                 : 20.0.8
@nrwl/web               : 19.8.3
@nx/webpack             : 20.0.8
@nrwl/webpack           : 19.8.3
typescript              : 5.5.4
---------------------------------------
Registered Plugins:
./plugins/ci-test-targets.ts
./plugins/compile-css.plugin.ts
./plugins/dotenv-vault.plugin.ts
./plugins/fly.plugin.ts
---------------------------------------
Community plugins:
@ngneat/spectator        : 18.0.2
@ngrx/component          : 18.1.1
@ngrx/component-store    : 18.1.1
@ngrx/data               : 18.1.1
@ngrx/effects            : 18.1.1
@ngrx/entity             : 18.1.1
@ngrx/operators          : 18.1.1
@ngrx/router-store       : 18.1.1
@ngrx/store              : 18.1.1
@ngrx/store-devtools     : 18.1.1
@skyux/i18n              : 10.23.0
@skyux/packages          : 10.23.0
@storybook/angular       : 8.3.3
@testing-library/angular : 17.3.1
angular-calendar         : 0.31.0
apollo-angular           : 7.1.2
ngxtension               : 4.0.0
---------------------------------------
Local workspace plugins:
         @trellis/plugins/apollo-graphql
         @trellis/plugins/nest-graphql
         @trellis/plugins/aws-deploy
         @trellis/plugins/repository
         @trellis/plugins/angular
         @trellis/plugins/docker
         @trellis/plugins/dotenv
         @trellis/plugins/prisma
         @trellis/plugins/jest
         @trellis/plugins/node
         @trellis/plugins/fly
---------------------------------------
The following packages should match the installed version of nx
  - @nrwl/js@19.8.3
  - @nrwl/jest@19.8.3
  - @nx/linter@19.8.3
  - @nrwl/workspace@19.8.3
  - @nrwl/angular@19.8.3
  - @nrwl/cypress@19.8.3
  - @nrwl/devkit@19.6.5
  - @nrwl/esbuild@19.8.3
  - @nrwl/eslint-plugin-nx@19.8.3
  - @nrwl/express@19.8.3
  - @nrwl/nest@19.8.3
  - @nrwl/node@19.8.3
  - @nrwl/nx-plugin@19.8.3
  - @nrwl/rspack@19.8.0
  - @nrwl/storybook@19.8.3
  - @nrwl/tao@19.6.5
  - @nrwl/vite@19.8.3
  - @nrwl/web@19.8.3
  - @nrwl/webpack@19.8.3

To fix this, run `nx migrate nx@20.0.8`

Failure Logs

$ nx run-many -t generate-schema --parallel

 NX   Maximum call stack size exceeded

Pass --verbose to see the stacktrace.

error: script "nx" exited with code 1

Exited with code exit status 1

Package Manager Version

bun@latest

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

Was working on 20.0.7, broke on 20.0.8

@jaysoo
Copy link
Member

jaysoo commented Nov 4, 2024

Likely caused by #28669

@jaysoo jaysoo added the scope: core core nx functionality label Nov 4, 2024
@jaysoo
Copy link
Member

jaysoo commented Nov 4, 2024

@yharaskrik Also note that you can safely remove the @nrwl/ scoped packages as those have been replaced by @nx/ packages.

@yharaskrik
Copy link
Contributor Author

@yharaskrik Also note that you can safely remove the @nrwl/ scoped packages as those have been replaced by @nx/ packages.

Sounds good thanks, I don't actually have them in my package.json anymore, must still just exist in node_modules.

@xiongemi
Copy link
Collaborator

xiongemi commented Nov 4, 2024

@yharaskrik it is hard to debug without a repo. Could you generate a project graph or task graph for generate-schema using nx graph? does it also throw the error "Maximum call stack size exceeded" when you try to view the task graph for generate-schema?

@yharaskrik
Copy link
Contributor Author

@yharaskrik it is hard to debug without a repo. Could you generate a project graph or task graph for generate-schema using nx graph? does it also throw the error "Maximum call stack size exceeded" when you try to view the task graph for generate-schema?

Ya, sorry about that, I know repros are preferred.

I will check this out for you right now!

@yharaskrik
Copy link
Contributor Author

@yharaskrik it is hard to debug without a repo. Could you generate a project graph or task graph for generate-schema using nx graph? does it also throw the error "Maximum call stack size exceeded" when you try to view the task graph for generate-schema?

nx graph successfully opens the UI but when I go to tasks and filter by I get this error.

Image

I looked in the daemon.log but I didn't see anything in there, is there somewhere I could potentially pull a stack trace for you?

@xiongemi
Copy link
Collaborator

xiongemi commented Nov 5, 2024

i published a pr release 0.0.0-pr-28793-3c45083. could you help me to verify whether this issue is fixed in my pr?

@yharaskrik
Copy link
Contributor Author

i published a pr release 0.0.0-pr-28793-3c45083. could you help me to verify whether this issue is fixed in my pr?

All fixed! 🎉

FrozenPandaz pushed a commit that referenced this issue Nov 6, 2024
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
- getNonDummyDeps is a recursive function. we pass in cycle arg to this
function. currently we end the recursion when the task is in a cycle.
however, currently there is an error "Maximum call stack size". i
suspect this recursion is not being ended because the cycle is not
detected when there are multiple cycles.
- add a function to get all cycles of the graph
- also, change getNonDummyDeps to track a list of seen tasks, even with
no cycle detected, this function will not run into infinite recursion

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #28788

(cherry picked from commit 9c24566)
@DaSchTour
Copy link
Contributor

How can I still the pr release? I have the same issue an also would like to check if the changes help.

FrozenPandaz pushed a commit that referenced this issue Nov 12, 2024
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
- getNonDummyDeps is a recursive function. we pass in cycle arg to this
function. currently we end the recursion when the task is in a cycle.
however, currently there is an error "Maximum call stack size". i
suspect this recursion is not being ended because the cycle is not
detected when there are multiple cycles.
- add a function to get all cycles of the graph
- also, change getNonDummyDeps to track a list of seen tasks, even with
no cycle detected, this function will not run into infinite recursion

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #28788

(cherry picked from commit 9c24566)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: core core nx functionality type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants