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::crypto::TLSWrap::DoWrite Assertion `!current_write_' failed. #47963

Closed
mackelito opened this issue May 11, 2023 · 8 comments
Closed

node::crypto::TLSWrap::DoWrite Assertion `!current_write_' failed. #47963

mackelito opened this issue May 11, 2023 · 8 comments
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs.

Comments

@mackelito
Copy link

mackelito commented May 11, 2023

Version

18.16.0

Platform

Darwin Markus-MacBook-Pro-15-inch-2018.local 22.4.0 Darwin Kernel Version 22.4.0: Mon Mar 6 21:00:17 PST 2023; root:xnu-8796.101.5~3/RELEASE_X86_64 x86_64

Subsystem

No response

What steps will reproduce the bug?

I just run npm install for any project I have...
I have not been able to reproduce this on another mac.

The projects install fine on other computers

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

No response

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

Should just install

What do you see instead?

npm i[80088]: ../src/crypto/crypto_tls.cc:947:virtual int node::crypto::TLSWrap::DoWrite(node::WriteWrap , uv_buf_t , size_t, uv_stream_t ): Assertion `!current_write_' failed.
1: 0x107e01eb5 node::Abort() (.cold.1) [/Users/markus/.nvm/versions/node/v18.16.0/bin/node]
2: 0x106877a69 node::Abort() [/Users/markus/.nvm/versions/node/v18.16.0/bin/node]
3: 0x106877811 node::Assert(node::AssertionInfo const&) [/Users/markus/.nvm/versions/node/v18.16.0/bin/node]
4: 0x1069cc038 node::crypto::TLSWrap::DoWrite(node::WriteWrap
, uv_buf_t
, unsigned long, uv_stream_s
) [/Users/markus/.nvm/versions/node/v18.16.0/bin/node]
5: 0x1068a4892 node::StreamBase::Write(uv_buf_t*, unsigned long, uv_stream_s*, v8::Localv8::Object, bool) [/Users/markus/.nvm/versions/node/v18.16.0/bin/node]
6: 0x1069ca8fc node::crypto::TLSWrap::EncOut() [/Users/markus/.nvm/versions/node/v18.16.0/bin/node]
7: 0x106a6f368 v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) [/Users/markus/.nvm/versions/node/v18.16.0/bin/node]
8: 0x106a6ee3b v8::internal::MaybeHandlev8::internal::Object v8::internal::(anonymous namespace)::HandleApiCallHelper(v8::internal::Isolate*, v8::internal::Handlev8::internal::HeapObject, v8::internal::Handlev8::internal::HeapObject, v8::internal::Handlev8::internal::FunctionTemplateInfo, v8::internal::Handlev8::internal::Object, v8::internal::BuiltinArguments) [/Users/markus/.nvm/versions/node/v18.16.0/bin/node]
9: 0x106a6e54f v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [/Users/markus/.nvm/versions/node/v18.16.0/bin/node]
10: 0x1073cb8f9 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit [/Users/markus/.nvm/versions/node/v18.16.0/bin/node]

Additional information

This was working just fine yesterday and I'm not sure what could have done this..
Things I know I did yesterday was:

  • xcode command line tools software update
  • brew upgrade

I have uninstalled nvm, node, npm and reinstalled it
I have tried other node versions
I have installed using brew, clean nvm and even downloading the dmg file from website

problem still persists

@bnoordhuis
Copy link
Member

Probably a duplicate of #30896.

@mackelito
Copy link
Author

Ah.. could be.. but no activity for over a month :(

@bnoordhuis
Copy link
Member

It's one of those "happens on my machine" bugs without a clear cause and no way to reproduce.

I'll close this out as a duplicate. If you have more information, please post it in the other issue.

@bnoordhuis bnoordhuis closed this as not planned Won't fix, can't repro, duplicate, stale May 12, 2023
@bnoordhuis bnoordhuis added the duplicate Issues and PRs that are duplicates of other issues or PRs. label May 12, 2023
@mackelito
Copy link
Author

Sure thing.. but It would still be nice with some kind of guidance to try and figure this out.. as I have removed and then reinstalled node and also tried out several other versions.. it makes me think is due to some external that node uses but I dont even know where to start looking :(

@mackelito
Copy link
Author

so this just happed again.. on a different repo.. brand new clone

@anetbnd
Copy link

anetbnd commented Jun 15, 2023

It also happens to me. I wanted to migrate from node16 to node18 in a Dockerfile and when running npm install during buildah build I get this error. This is, what I see, when I enable NODE_DEBUG_NATIVE=tls. The system, where this docker build is running on is redhat linux for OpenShift.

TLSWrap client (37567) DoWrite()
TLSWrap client (37567) Writing 547 bytes, written = -1
TLSWrap client (37567) Saving data for later write
TLSWrap client (37567) Trying to write encrypted output
TLSWrap client (37567) Returning from EncOut(), write currently in progress
TLSWrap client (17311) Read -1 bytes of cleartext output
TLSWrap client (17311) Trying to write encrypted output
TLSWrap client (17311) Returning from EncOut(), write currently in progress
TLSWrap client (17191) Read 132 bytes from underlying stream
TLSWrap client (17191) Trying to write cleartext input
TLSWrap client (17191) Returning from ClearIn(), no pending data
TLSWrap client (17191) Trying to read cleartext output
TLSWrap client (17191) Read 103 bytes of cleartext output
TLSWrap client (37578) Created new TLSWrap
TLSWrap client (37578) Trying to read cleartext output
TLSWrap client (37578) SSLInfoCallback(SSL_CB_HANDSHAKE_START);
TLSWrap client (37578) Read -1 bytes of cleartext output
TLSWrap client (37578) Trying to write encrypted output
TLSWrap client (37578) Writing 1 buffers to the underlying stream
TLSWrap client (17191) DoWrite()
TLSWrap client (17191) Writing 328 bytes, written = 328
TLSWrap client (17191) Trying to write encrypted output
TLSWrap client (17191) EncOut() write is scheduled
TLSWrap client (17191) Writing 1 buffers to the underlying stream
TLSWrap client (17191) Write finished synchronously
TLSWrap client (37578) DoWrite()
TLSWrap client (37578) Writing 509 bytes, written = -1
TLSWrap client (37578) Saving data for later write
TLSWrap client (37578) Trying to write encrypted output
TLSWrap client (37578) Returning from EncOut(), write currently in progress
TLSWrap client (17191) Read -1 bytes of cleartext output
TLSWrap client (17191) Trying to write encrypted output
TLSWrap client (17191) Returning from EncOut(), write currently in progress
TLSWrap client (20864) Read 132 bytes from underlying stream
TLSWrap client (20864) Trying to write cleartext input
TLSWrap client (20864) Returning from ClearIn(), no pending data
TLSWrap client (20864) Trying to read cleartext output
TLSWrap client (20864) Read 103 bytes of cleartext output
TLSWrap client (37589) Created new TLSWrap
TLSWrap client (37589) Trying to read cleartext output
TLSWrap client (37589) SSLInfoCallback(SSL_CB_HANDSHAKE_START);
TLSWrap client (37589) Read -1 bytes of cleartext output
TLSWrap client (37589) Trying to write encrypted output
TLSWrap client (37589) Writing 1 buffers to the underlying stream
TLSWrap client (20864) DoWrite()
npm install[697]: ../src/crypto/crypto_tls.cc:947:virtual int node::crypto::TLSWrap::DoWrite(node::WriteWrap*, uv_buf_t*, size_t, uv_stream_t*): Assertion `!current_write_' failed.
 1: 0x5615487269f4 node::Abort() [npm install]
 2: 0x561548726d31 node::Assert(node::AssertionInfo const&) [npm install]
 3: 0x5615488f3dd4 node::crypto::TLSWrap::DoWrite(node::WriteWrap*, uv_buf_t*, unsigned long, uv_stream_s*) [npm install]
 4: 0x561548770038 node::StreamBase::Write(uv_buf_t*, unsigned long, uv_stream_s*, v8::Local<v8::Object>, bool) [npm install]
 5: 0x5615488f44e7 node::crypto::TLSWrap::EncOut() [npm install]
 6: 0x56154899360e  [npm install]
 7: 0x5615489944ab v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [npm install]
 8: 0x561549280db9  [npm install]

It is node v18.14.2 and npm 9.5.0.

@bnoordhuis
Copy link
Member

Try upgrading to the latest v18, v18.6.0 at the time of writing. No guarantee it fixes the issue but you'll always want to make sure you're using the most up-to-date version when reporting bugs.

@anetbnd
Copy link

anetbnd commented Jun 16, 2023

Hi @bnoordhuis

Thanks for the advice, I just took the one from the latest node.js image from the redhat registry. But you are right, I will search for another image an try again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs.
Projects
None yet
Development

No branches or pull requests

3 participants