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

Getting "Error: EBUSY: resource busy or locked, access '\\.\pipe\nitro\worker-24144-2.sock' | Nuxt" #2729

Open
rpandyaescribe opened this issue Sep 11, 2024 · 12 comments
Labels
bug Something isn't working windows

Comments

@rpandyaescribe
Copy link

Environment

Nuxt - v3.7.4
Nitro - v2.6.3

Reproduction

I don't have a proper link to reproduce but using the specified version of nuxt in an app where you have multiple endpoints being called within the same timeframe will cause this error.

Describe the bug

When building the nuxt project, getting Error: EBUSY: resource busy or locked, access '\\.\pipe\nitro\worker-24144-2.sock' | Nuxt errors for random endpoints.

Additional context

No response

Logs

No response

@alisherabdimuminov
Copy link

@alisherabdimuminov
Copy link

please fix this. my all projects does not works

@kdydesign
Copy link

I am experiencing the same issue. Due to this problem, I am unable to proceed with parallel processing. This is a critical issue that needs to be resolved quickly.

@pi0
Copy link
Member

pi0 commented Nov 8, 2024

The best way to solve this issue is to help making reproduction steps we cannot solve it without.

@hefty
Copy link

hefty commented Dec 12, 2024

I am experiencing the same issue. My system is Windows10
https://github.com/hefty/nitro-app.git may help

@franciscohermida
Copy link

Having the same issue Windows 11, calling many endpoints at the same time (3).

@pi0
Copy link
Member

pi0 commented Jan 21, 2025

Can you please try nightly channel? We had recently some stability improvements.

@franciscohermida
Copy link

Same issue using the nightly channel, I used the repro created by @hefty as I don't know exactly how to test a specific version of nitro in my nuxt 3 app.

@hefty
Copy link

hefty commented Jan 22, 2025

The code at src/core/dev-server/server.ts

const getWorkerAddress = () => { const address = currentWorker?.address; if (!address) { return; } if (address.socketPath) { try { accessSync(address.socketPath); } catch (error) { if (!lastError) { lastError = error; } console.log(error); if (error.message.includes('locked')) { return address; } return; } } return address; };

The server will check user's permission at each request coming, due to fs.accessSync not working properly (nodejs/node#2949 ), caused this issue.

@lihbr
Copy link

lihbr commented Jan 24, 2025

Managed to reproduce with Nightly and trimmed down the reproduction here: nitro_2729_repro.zip (hopefully I got it right)

Instructions to reproduce in the README

@userquin
Copy link

userquin commented Jan 24, 2025

I guess you cannot access that file, it is a virtual file, node should resolve the real path in accessSync (if possible).

I have it working using local ip address instead localhost, nitro getting some internal error without adding ECONNRESET (check screenshot bellow):

  • change the localhost with
  • apply patch
  • run netstat -an and get local ip v4 address
  • run `pnpm nitro dev --host
  • run the test
// node_modules/.pnpm/[email protected][email protected]/node_modules/nitropack-nightly/dist/core/index.mjs
// L2449
        if (!address.socketPath.startsWith("\\\\") && error.code === "ENOENT") {
          if (!lastError) {
            lastError = error;
          }
          return;
        }

I can also run the test using localhost with this:

// node_modules/.pnpm/[email protected][email protected]/node_modules/nitropack-nightly/dist/core/index.mjs
// L2449
        if (!address.socketPath.startsWith("\\\\") && (error.code === "ENOENT" || "ECONNRESET")) {
          if (!lastError) {
            lastError = error;
          }
          return;
        }

Image
test ouput with ip iddress

Image
error using localhost without last patch

@sczat
Copy link

sczat commented Jan 24, 2025

I'm experiencing same error when multiple components fetch data simultaneously during page load. This happens even with only a few components.

After a 503 error, the requests automatically retry fetching. I'm looking for insights into what's causing this and how to resolve it. Currently, I'm adding random delays to the fetch requests to stagger them and avoid simultaneous fetching, but I would like to know if there's a better solution.

Image

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

No branches or pull requests

10 participants