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

Failed to reset the Nx workspace due to lock #2341

Open
siiron opened this issue Dec 4, 2024 · 2 comments
Open

Failed to reset the Nx workspace due to lock #2341

siiron opened this issue Dec 4, 2024 · 2 comments
Labels
type: bug Something isn't working

Comments

@siiron
Copy link

siiron commented Dec 4, 2024

Current Behavior

When running nx reset the plugin prevents this due to lock on the nx cache db.

Expected Behavior

The nx reset should be able to complete

Steps to Reproduce

Install IntelliJ

IntelliJ IDEA 2024.3 (Ultimate Edition)
Build #IU-243.21565.193, built on November 13, 2024

Install latest NX Console plugin 1.33.0

Run nx reset on a monorepo workspace

Failure Logs / Images / Videos

Failed to reset the Nx workspace.
Failed to clean up the workspace data directory.
Error: EBUSY: resource busy or locked, unlink 'C:\Projects\path-to-project\.nx\workspace-data\54bcfc73-8e5b-493f-bfc2-a6f8e81a6bda.db'
node:fs:2368
return binding.writeFileUtf8(
^

Error: ENOENT: no such file or directory, open 'C:\Projects\path-to-project\.nx\cache\terminalOutputs\4925364787582055960'
at writeFileSync (node:fs:2368:20)
at ForkedProcessTaskRunner.writeTerminalOutput (C:\Projects\path-to-project\node_modules\nx\src\tasks-runner\forked-process-task-runner.js:311:32)
at ChildProcess. (C:\Projects\path-to-project\node_modules\nx\src\tasks-runner\forked-process-task-runner.js:239:26)
at ChildProcess.emit (node:events:519:28)
at ChildProcess._handle.onexit (node:internal/child_process:294:12) {
errno: -4058,
code: 'ENOENT',
syscall: 'open',
path: 'C:\Projects\path-to-project\.nx\cache\terminalOutputs\4925364787582055960'
}

Node.js v20.16.0

Environment

  • Nx Console version: 1.33.0
  • IntelliJ IDEA 2024.3 (Ultimate Edition)
  • Windows 11
@siiron siiron added the type: bug Something isn't working label Dec 4, 2024
@siiron siiron changed the title Failed to reset the Nx workspace Failed to reset the Nx workspace due to lock Dec 4, 2024
@MaxKless
Copy link
Collaborator

MaxKless commented Dec 5, 2024

Hey :) Thanks for the report. Could you please provide your nx report results?
This sounds like an issue with nx itself more than Nx Console, right? You're running nx reset via the CLI?

@siiron
Copy link
Author

siiron commented Dec 5, 2024

I use the NX Console, and runs tasks through it in IntelliJ. Here is a typical workflow:

1. Perform a clean build using NX Console = SUCCESS

Image

2. Try nx reset from Windows terminal using CLI = SUCCESS

Image

3. Perform another clean build using NX Console = SUCCESS, then try to do nx reset via NX Console = FAIL

Image

4. Try nx reset from Windows Terminal using CLI = SUCCESS.

Image

Please note that if I disable NX Console plugin in IntelliJ I still can perform the reset via IntelliJs terminal. The error only appears when running the task from the plugin.

Herer is results of NX report:

NX Report complete - copy this into the issue template

Node : 20.16.0
OS : win32-x64
Native Target : x86_64-windows
npm : 10.8.1

nx : 20.1.4
@nx/js : 20.1.4
@nx/jest : 20.1.4
@nx/eslint : 20.1.4
@nx/workspace : 20.1.4
@nx/cypress : 20.1.4
@nx/devkit : 20.1.4
@nx/eslint-plugin : 20.1.4
@nx/next : 20.1.4
@nx/playwright : 20.1.4
@nx/react : 20.1.4
@nx/storybook : 20.1.4
@nx/vite : 20.1.4
@nx/web : 20.1.4
@nx/webpack : 20.1.4
typescript : 5.7.2

Community plugins:
@jscutlery/semver : 5.3.1
nx-stylelint : 18.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants