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

Node 22 node-gyp build fails "Text file busy" #53051

Open
kode54 opened this issue May 18, 2024 · 16 comments
Open

Node 22 node-gyp build fails "Text file busy" #53051

kode54 opened this issue May 18, 2024 · 16 comments
Labels
libuv Issues and PRs related to the libuv dependency or the uv binding.

Comments

@kode54
Copy link

kode54 commented May 18, 2024

Version

v22.0.0

Platform

Linux laharl 6.9.1-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 17 May 2024 16:56:38 +0000 x86_64 GNU/Linux

Subsystem

node-gyp

What steps will reproduce the bug?

  1. Attempted to build thelounge from AUR package
  2. sqlite3 submodule fails with two "/usr/bin/env: 'node': Text file busy" errors

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

It happens every time. It appears to be a race condition with io_uring with kernel 6.9.x on x86_64.

What is the expected behavior? Why is that the expected behavior?

The packages should build properly.

What do you see instead?

Two of the node-gyp build steps fail:

/usr/bin/env: 'node': Text file busy
/usr/bin/env: 'node': Text file busy

Additional information

I am re-reporting this issue because it does not involve use of Docker. Currently, thelounge package has added a workaround to disable io_uring in libuv to allow the build to pass.

Edit 1:
Related bug reports have suggested this is only a problem because Arch builds nodejs against the system libuv, which it configures with the defaults, which enable io_uring support.

A kernel fix is slated for 6.9.2 that will likely work around the errors, but will not work around Arch or other distributions which have not disabled io_uring support in libuv like node has for security reasons. However, I am not sure how much of a threat model the io_uring support is, considering it's probably not that wise to be running node suid/sgid in the first place.

@RedYetiDev RedYetiDev added the gyp Issues and PRs related to the GYP tool and .gyp build files label May 18, 2024
@iTecAI
Copy link

iTecAI commented May 19, 2024

Also having this issue (running node through yarn on arch, kernel version 6.9.1), since a kernel upgrade yesterday.

@victormamede
Copy link

Same problem on arch after upgrading the kernel, any type of yarn run triggers the error

@7Z0nE
Copy link

7Z0nE commented May 19, 2024

On my system any execution of yarn triggers this error with node v22.0.0

@Kocicak
Copy link

Kocicak commented May 20, 2024

Hello, after downgrading kernel to 6.8.9, the problem went away.

@santigimeno
Copy link
Member

Can you please open an issue in https://github.com/libuv/libuv/issues with the specific kernel version/s so we can blacklist them? Thanks

@santigimeno santigimeno added libuv Issues and PRs related to the libuv dependency or the uv binding. and removed gyp Issues and PRs related to the GYP tool and .gyp build files labels May 20, 2024
@kvaster
Copy link

kvaster commented May 21, 2024

I've made kernel bisect.

the last good commit: 2708af1adc11700c6c3ce4109e3b133079a36a78
the first bad commit: af5d68f8892f8ee8f137648b79ceb2abc153a19b

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=af5d68f8892f8ee8f137648b79ceb2abc153a19b

@Tatsh
Copy link

Tatsh commented May 21, 2024

Also confirming it is definitely af5d68f8892f8ee8f137648b79ceb2abc153a19b after bisecting myself.

@Tatsh
Copy link

Tatsh commented May 21, 2024

There is a kernel patch for those interested. Otherwise this will probably be fixed in 6.9.2.

@naskya
Copy link

naskya commented May 22, 2024

The same issue happens with Node v18 and v20.

$ node --version
v18.20.3

$ npm --version
10.8.0

$ uname --all
Linux localhost 6.9.1-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 17 May 2024 16:56:38 +0000 x86_64 GNU/Linux

$ npm install bufferutil
npm error code 126
npm error path /home/naskya/node_modules/bufferutil
npm error command failed
npm error command sh -c node-gyp-build
npm error sh: /home/naskya/node_modules/.bin/node-gyp-build: /usr/bin/env: bad interpreter: Text file busy
npm error A complete log of this run can be found in: /home/naskya/.npm/_logs/2024-05-22T08_46_40_033Z-debug-0.log

zen-kernel is unaffected.

$ node --version            
v18.20.3

$ npm --version             
10.8.0

$ uname --all
Linux localhost 6.9.1-zen1-1-zen #1 ZEN SMP PREEMPT_DYNAMIC Fri, 17 May 2024 16:56:18 +0000 x86_64 GNU/Linux

$ npm install bufferutil  

added 2 packages in 1s

@kode54
Copy link
Author

kode54 commented May 22, 2024

I have updated the main bug comment with some extra information, indicated with an "Edit" marker above the text. Mainly to hopefully be seen by anyone just arriving at the bug.

@ivan770
Copy link

ivan770 commented May 22, 2024

As a temporary workaround it's also possible to use the UV_USE_IO_URING environment variable to disable io_uring support in libuv: UV_USE_IO_URING=0 yarn add bufferutil

@Gabriel-Grechuk
Copy link

I don't know if this will help someone, but I'm able to run with no problems after downgrading the node to the version 21.7.3 with the kernel 6.9.1-arch1-1. Don't know if it works for every application though

KosmX added a commit to KosmX/incus-ui-canonical-arch that referenced this issue May 24, 2024
@WasathTheekshana
Copy link

Same issue :(

Kernel Version = 6.9.1
Node Version = 21.0.0

screenshot_26052024_011257

@WasathTheekshana
Copy link

I don't know if this will help someone, but I'm able to run with no problems after downgrading the node to the version 21.7.3 with the kernel 6.9.1-arch1-1. Don't know if it works for every application though

This solved my problem. Thanks <3

@MartinX3
Copy link

Still an issue with kernel 6.9.2.

@Garubieru
Copy link

kernel 6.9.3 seems to fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libuv Issues and PRs related to the libuv dependency or the uv binding.
Projects
None yet
Development

No branches or pull requests