nx icon indicating copy to clipboard operation
nx copied to clipboard

[Windows] Failed to process project graph. Run "nx reset" to fix this. Please report the issue if you keep seeing it.

Open matmill5 opened this issue 1 year ago • 2 comments
trafficstars

Current Behavior

When runing pnpm scripts like "pnpm nx run

NX Failed to process project graph. Run "nx reset" to fix this. Please report the issue if you keep seeing it.

Pass --verbose to see the stacktraces.

 ELIFECYCLE  Command failed with exit code 1.

Sometimes running "nx reset" will resolve the issue, but other times the .nx/workspace-data/d/daemon.log file will be locked by some process (node/vscode), and the "nx reset" command will fail with an exception.

I am reporting this issue as the nx CLI is suggesting that's the best path if the "nx reset" issue keeps reoccuring.

In any case, I have been able to resolve it manually by running "nx reset" and killing node/vscode processes manually if the daemon.log file is locked.

Please advise.

Expected Behavior

Would expect that I could rerun pnpm nx run

GitHub Repo

No response

Steps to Reproduce

  1. Use a windows machine
  2. Run pnpm nx run
  3. Intermittently experience failure message that indicates the project graph failed to process, and use "nx reset"

Nx Report

NX   Report complete - copy this into the issue template

Node           : 18.18.0
OS             : win32-x64
Native Target  : x86_64-windows
pnpm           : 9.8.0

nx                 : 19.6.2
@nx/js             : 19.6.2
@nx/linter         : 19.6.2
@nx/eslint         : 19.6.2
@nx/workspace      : 19.6.2
@nx/devkit         : 19.6.2
@nx/eslint-plugin  : 19.6.2
@nx/next           : 19.6.2
@nx/react          : 19.6.2
@nrwl/tao          : 19.6.2
@nx/web            : 19.6.2
@nx/webpack        : 19.6.2
typescript         : 5.5.4
---------------------------------------
Registered Plugins:
@nx/next/plugin

Failure Logs

No response

Package Manager Version

pnpm 9.8.0

Operating System

  • [ ] macOS
  • [ ] Linux
  • [X] Windows
  • [ ] Other (Please specify)

Additional Information

No response

matmill5 avatar Aug 25 '24 19:08 matmill5

i have the same issue.

My current work around is for the nx reset thing is


rm -rf .nx 
# most of the time this is not working ... some open file handles are present this can be resolved via

# Sometimes its the extension
taskkill.exe /IM code.exe /F 

# sometimes zombie process -_-
taskkill.exe /IM node.exe /F

zerocity avatar Aug 26 '24 06:08 zerocity

Ahh that's what is going on. Following as I'm having the same issue.

lppedd avatar Aug 27 '24 10:08 lppedd

same issue for me run build the project, any ideas?

vochitan90 avatar Aug 28 '24 14:08 vochitan90

same issue here.

a-essawy avatar Aug 29 '24 11:08 a-essawy

I experience the same on Windows, I have colleagues experiencing this also on Mac, so it may not be restricted only to a single OS.

ValentinGurkov avatar Aug 29 '24 12:08 ValentinGurkov

I've experienced the same thing.

  1. Attempt to run an nx command such as removing an app
  2. Get told Failed to process project graph. Run "nx reset" to fix this. Please report the issue if you keep seeing it.
  3. Run nx reset
  4. Two things will happen
  • NX EPERM: operation not permitted, open 'C:\Users\USER\PATH\TO\FOLDER\root_app\.nx\workspace-data\d\daemon.log'
  • NX Cleaning up temporary files created by Nx Cloud.

I have to completely kill VS Code to keep having to try again until it lets me run a command.

  • nx: 19.6.5
  • node: 20.9.0
  • windows 11 OS
  • vscode (latest) v1.93
  • nx console extension v18.26.0

BadCodesGG avatar Sep 09 '24 00:09 BadCodesGG

For me sometime i have to remove 'things' in the migrations.json file created by NX and it resolve the problem.

vochitan90 avatar Sep 09 '24 02:09 vochitan90

I can confirm that this is also very frequently showing up with Mac so it's not operating system related. Here is my report:

Node           : 22.9.0
OS             : darwin-arm64
Native Target  : aarch64-macos
pnpm           : 9.10.0

nx                 : 19.8.2
@nx/js             : 19.8.2
@nx/jest           : 19.8.2
@nx/linter         : 19.8.2
@nx/eslint         : 19.8.2
@nx/workspace      : 19.8.2
@nx/cypress        : 19.8.2
@nx/devkit         : 19.8.2
@nx/esbuild        : 19.8.2
@nx/eslint-plugin  : 19.8.2
@nx/node           : 19.8.2
@nx/playwright     : 19.8.2
@nx/plugin         : 19.8.2
@nx/react          : 19.8.2
@nx/storybook      : 19.8.2
@nrwl/tao          : 19.8.2
@nx/vite           : 19.8.2
@nx/web            : 19.8.2
@nx/webpack        : 19.8.2
typescript         : 5.6.2
---------------------------------------
Registered Plugins:
@nx/eslint/plugin
@nx/vite/plugin
@nx/vite/plugin
---------------------------------------
Community plugins:
@nx-tools/nx-prisma : 6.1.0
@nxazure/func       : 1.1.5
---------------------------------------

diginikkari avatar Sep 28 '24 12:09 diginikkari

Hey! Are all of you using nx console? Is the behaviour different when using nx console vs not using it?

We had a similar issue to this regarding leftover plugin workers but it should be fixed on the latest nx version.

MaxKless avatar Sep 30 '24 11:09 MaxKless

Were leftover workers seen as multiple node.exe processes under Windows?

lppedd avatar Sep 30 '24 12:09 lppedd

yes exactly, more specifically those keeping daemon.log locked. But not as vscode processes, actual orphaned node processes

MaxKless avatar Sep 30 '24 12:09 MaxKless

Thanks, and yup I see A LOT of them sporadically.

I'll bump to 19.8.2+ this week and report back.

lppedd avatar Sep 30 '24 12:09 lppedd

yes exactly, more specifically those keeping daemon.log locked.

But not as vscode processes, actual orphaned node processes

I can confirm, once migrated to latest version of Nx, I'm not seeing this issue anymore.

Windows 11 with Nx console on Jetbrains.

a-essawy avatar Sep 30 '24 14:09 a-essawy

Also make sure to kill all processes or restart the pc after an upgrade, they might be left over from a while back if they're orphaned.

MaxKless avatar Oct 01 '24 12:10 MaxKless

In my case it was an error: The following implicitDependencies point to non-existent project(s): , which appears due to a directory being left after the branch switching. So if you work with a project that does not exist in a branch you going to switch on, the error presents on this branch

constantant avatar Oct 03 '24 15:10 constantant

This error do also happen we you do not have a project.json file in any one of the application. (It could be worth having a better error)

rbalet avatar Oct 07 '24 07:10 rbalet

We are experiencing this pretty heavily in our monorepo as well. Mixture of Mac and Windows, though appears to happen more with Windows. Typically just need to close vscode or wipe orphaned NodeJS processes.

Going to upgrade to latest v20.x and see if it helps us at all. I have removed the nx console recommendation though (we don't use it much anyways).

zjkipping avatar Nov 12 '24 18:11 zjkipping

I'll close this for now, let me know if you still run into it on latest @zjkipping. I'd also be interested in your experience with Nx Console, any specific reasons you don't use it a lot? Any value you're hoping for that it's not giving you? Feel free to send me an email [email protected]

MaxKless avatar Nov 13 '24 10:11 MaxKless

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

github-actions[bot] avatar Dec 15 '24 00:12 github-actions[bot]