-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
createWriteStream has problems in a CIFS mount path with node 20.x.x and node 18.18.0 #50061
Comments
Sounds like a duplicate of #49911. Bug fix is pending release. If you agree it's a dup, then go ahead and close this. |
Thank you for your answer. |
Further testing under Node 20 has shown that up to version 20.2.0 the error does not occur.
|
Right, then it's almost certainly the same bug; CIFS in particular is a file system where partial writes are more likely to pop up than most other file systems. I'll take the liberty of closing this. It's fixed in the next (upcoming) v18.x release. |
v18.18.1 fix the Problem... |
While release 18.18.1 resolved the problem, it definitely still exists in 20.7.0 and up. In #49911 i read in one of the comments that applied fix (88ba79b and a4928b0) is already in 20.7.0 and up. I am wondering if reopening of this issue here is needed |
as stated above, #49911 seemed to be a similar bug but only solved the here mentioned issue in release 18.18.1, not in 20.7.0 and later. so, can this issue get reopened please? |
Only if there's a reproducer or something like strace logs that show the issue. Right now it isn't an actionable bug report. |
We carried out tests under Node 20. The error occurs from Node v20.3.0. To reproduce, try writing a file via writestream on a Fritzbox NAS with a CIFS mount. The file cannot be written and writestream exits without errors. You can reproduce it with a writestream attempt on a cifs of the Fritzbox. The fact that we are talking about the same error here shows that v18.18.1, in which the libuv update was reversed, is running smoothly again, right? |
Okay, easy way to test: what happens when you set |
According to my test with node 20.8.0 and the Env "UV_USE_IO_URING=0" the file is created with writestream on a CIFS mount without error. Without this env the error occurs and no file can be created on the CIFS mount using writestream. |
Can't confirm. My system still freaks out with nodejs 20.8.0 and the ENV set. |
Conflicting signals... I'll reopen but @simatec you'll have to investigate yourself, you're quite possibly looking at a kernel bug, and @Grothesk242 you should probably file a separate issue. |
if that is a kernel bug, why did LTS 18.18.1 solve this issue but in 20.7.0 and up this issue still exists. Also, both systems (linux server and smb server) are the very same with the exception of node versions which have been up- and downgraded for the several tests. We have tried strace but that was overwhelming... SMB server is a closed system with no access to the os at all but with newest firmware installed. Any further advice is highly appreciated |
@winnyschuster did you try the As an aside: multiple people reporting sorta-similar-but-maybe-not bugs in the same issue doesn't really help move things along, it just muddies the discussion. Unless you're really sure it's the exact same issue, you're better off opening a new bug report. |
It is the same error, because we are all talking about the very same
system. My system.
We were analysing the system as a 'joint venture team'
Ben Noordhuis ***@***.***> schrieb am Fr., 13. Okt. 2023,
11:20:
… @winnyschuster <https://github.com/winnyschuster> did you try the
UV_USE_IO_URING=0 thing?
As an aside: multiple people reporting sorta-similar-but-maybe-not bugs in
the same issue doesn't really help move things along, it just muddies the
discussion. Unless you're really sure it's the exact same issue, you're
better off opening a new bug report.
—
Reply to this email directly, view it on GitHub
<#50061 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANVE56JRJAS3U4QVCQRKYPTX7EBUHAVCNFSM6AAAAAA5VQOC5GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONRRGE4TKNRQGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Right. It would definitely have helped if you'd stated that upfront. And now knowing that, how come @simatec says it works but you say it doesn't? Also, you should be aware I'm not inclined to sink too much time in this. If this befuddled bug reporting keeps on going, I'll just bow out and leave you to figure it out for yourself. |
This is due to the strangeness of the bug. He was testing just a part of the issue on a like system and this part of the code works on both systems now. But on my systems I use extended parts of the code (it is a backup suite for backing up several modules of smarthome system 'ioBroker') and these backup files are still corrupt. I know how 'befuddled' this bug reporting looks, but the issue is very hard to track down for the three (simatec, winnyschuster and myself) of us. |
@bnoordhuis I must apologize here.... I had only done a simple test and tested only a part of the backups. I can't yet understand what has changed from Node 20.2.0 to Node 20.3.0 that causes this error. From Node 20.3.0 this error exists until the current version Node 20.8.0. Our guess is libuv, because the error also occurred with the update of libuv in v18.18.0 and with undoing the libuv update in v18.18.1 everything is fine again. As @Grothesk242 wrote, it is extremely difficult to isolate the error and it currently affects only some NAS systems with CIFS. Especially the Fritzbox with its NAS makes problems here. |
Okay, duly noted. I'll take your word for it that The only suggestion I have at this point is to run If it's the libuv upgrade, splice in the libuv commits from v1.44.2 to v1.45.0 into deps/uv and bisect again. Some linux-only files got merged into a single file so there are a few commits with broken builds where you have to patch up deps/uv/uv.gyp, see the changes to that file in 9e68f94. |
The v1.45.0 release was a big one so knowing it was the libuv upgrade doesn't tell us much in itself. You've established it's not io_uring. There aren't otherwise many file system-related changes:
Of those, the last one may be the cause but that means you're either running a really old kernel or your libc has a bug. |
@bnoordhuis thank you so much for your reply and effort. It is about the ioT platform iobroker with about 81,000 users. Now users with Node 20 are increasingly reporting this problem and we as developers are looking for the cause. Currently we only know of cases where the user has a Fritzbox running as NAS and uses the CIFS mount there. The whole thing must have something to do with .pipe and/or fs.createWriteStream. In our tests we have always used absolutely current kernels and I myself have found it under Debian 12 as well as under Ubuntu 22.04. It is just a very difficult issue, because there are no error messages or the like. The ENV UV_USE_IO_URING=0 causes only partial success, because it does not work with all backup variants. I am currently at a loss as to what else we can test. |
Libuv made some system calls directly (bypassing libc) but now it goes through their libc wrappers. |
Attached are the logs of the backup process including mount command before backup and umount command after backup. In this example we try to write 2 backup files. I have created here the logs for smb2 and smb3.1.1 to have a possible comparison. The mount to the test Fritzbox looks like this:
|
Version
18.18.0 and 20.x.x
Platform
Linux iob-node20 6.2.16-5-pve #1 SMP PREEMPT_DYNAMIC PVE 6.2.16-6 (2023-07-25T15:33Z) x86_64 GNU/Linux
Subsystem
iobroker
What steps will reproduce the bug?
writestream into a cifs share
How often does it reproduce? Is there a required condition?
Error always occurs
What is the expected behavior? Why is that the expected behavior?
The file created with writestream should be written to the remote file system (CIFS share), but it is only 16Kb in size and corrupted
What do you see instead?
A corrupted file with 16Kb instead of about 5-10 Mb
Additional information
Hello all,
I hope you can help here... We use the package among other things for backups in the iobroker project and have with current node 20 versions and from node 18.18.0 problems with many users who write their backup directly with a CIFS mount on the Fritzbox NAS.
Currently, I am only aware of problems in connection with Fitzbox and CIFS.
It seems that all attempts since Node 18.18.0 have problems with "fs.createWriteStream" or with .pipe.
Locally on the system there are no problems. The error only occurs when the backup is to be written to the CIFS mount point.
Here is an excerpt of how the create of the backup is constructed.
The text was updated successfully, but these errors were encountered: