node icon indicating copy to clipboard operation
node copied to clipboard

Getting the error "Assertion failed (wrap->ssl_) != (nullptr), file src\tls_wrap.cc, line 320" while module installation by npm

Open SergeKornilov opened this issue 11 years ago • 47 comments

I get the error "Assertion failed (wrap->ssl_) != (nullptr), file src\tls_wrap.cc, line 320" trying to install any module by npm via proxy, for example, request or cheerio:

npm config set proxy http://username:[email protected]:8080 npm config set https-proxy https://username:[email protected]:8080

npm install cheerio

//

Thus, request module is not installed at all, and cheerio module is installed without dependencies.

//

npm --version 2.14.3

node --version v4.1.0

OS: windows xp sp3

SergeKornilov avatar Sep 21 '15 10:09 SergeKornilov

cc @indutny

ChALkeR avatar Sep 21 '15 10:09 ChALkeR

/cc @nodejs/crypto, @nodejs/platform-windows (windows xp sp3 sets off red flags for me)

rvagg avatar Sep 21 '15 12:09 rvagg

Npm folks might also be interested. cc @othiym23 @zkat @iarna

thefourtheye avatar Sep 21 '15 12:09 thefourtheye

Will look at it today...

indutny avatar Sep 21 '15 17:09 indutny

I think it may be related to the Windows XP indeed. Checking the libuv code with this regards.

indutny avatar Sep 21 '15 18:09 indutny

Hm... looks like I was wrong about it, the order of callbacks should be correct even on XP. Continuing the search.

indutny avatar Sep 21 '15 18:09 indutny

I think it may be a windows-specific thing. May I ask you to give a try to the following patch:

diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js
index 1bff757..fc9696f 100644
--- a/lib/_tls_wrap.js
+++ b/lib/_tls_wrap.js
@@ -296,7 +296,11 @@ proxiedMethods.forEach(function(name) {

 tls_wrap.TLSWrap.prototype.close = function closeProxy(cb) {
   if (this._parentWrap && this._parentWrap._handle === this._parent) {
-    setImmediate(cb);
+    if (this._parentWrap._handle)
+      this._parentWrap.once('close', cb);
+    else
+      setImmediate(cb);
+
     return this._parentWrap.destroy();
   }
   return this._parent.close(cb);

Hopefully, it will fix the problem


@saghul a question about Windows and uv_close(). There is lots of endgames and everything for cancelling the request. Could it be the case that the uv_close_cb is not invoked on next libuv tick on Windows?

indutny avatar Sep 21 '15 23:09 indutny

Relevant PR: https://github.com/nodejs/node/pull/2991

indutny avatar Sep 21 '15 23:09 indutny

a question about Windows and uv_close(). There is lots of endgames and everything for cancelling the request. Could it be the case that the uv_close_cb is not invoked on next libuv tick on Windows?

Yes, AFAIK cancellation could take a bit, so the uv_close callback is not guaranteed to run exactly on the next tick.

saghul avatar Sep 22 '15 07:09 saghul

@SergeKornilov may I ask you to test this patch? I have really good expectations from it. Let me know if you need some help with building this thing.

indutny avatar Sep 24 '15 19:09 indutny

@indutny It something goes wrong when I try to build node.js. I follow installation guide:

  1. Start "Visual Studio Command prompt (2010)"
  2. Execute "set path=c:\python27;c:\python27\lib;%path%"
  3. Execute "python --version" to check and get the result "Python 2.7.10"
  4. Then execute "vcbuild.bat release x86" and get nothing.

What's wrong here? obsolet version of VS?

SergeKornilov avatar Sep 25 '15 06:09 SergeKornilov

cc @nodejs/release how do we do builds for Windows?

indutny avatar Sep 25 '15 06:09 indutny

@nodejs/build ^^

Fishrock123 avatar Sep 25 '15 06:09 Fishrock123

I always do it from cmd.exe, give it a shot. On Sep 25, 2015 8:20 AM, "SergeKornilov" [email protected] wrote:

@indutny https://github.com/indutny It something goes wrong when I try to build node.js. I follow installation guide:

  1. Start "Visual Studio Command prompt (2010)"
  2. Execute "set path=c:\python27;c:\python27\lib;%path%"
  3. Execute "python --version" to check and get the result "Python 2.7.10"
  4. Then execute "vcbuild.bat release x86" and get nothing.

What's wrong here? obsolet version of VS?

— Reply to this email directly or view it on GitHub https://github.com/nodejs/node/issues/2979#issuecomment-143139330.

saghul avatar Sep 25 '15 07:09 saghul

screenshot

What can I do to clearify the situation and get more verbous output from vcbuild?

SergeKornilov avatar Sep 25 '15 07:09 SergeKornilov

VS 2010 support was dropped a long time ago. You need at least VS 2013.

seishun avatar Sep 25 '15 12:09 seishun

What is about Windows SDK 7.1?

SergeKornilov avatar Sep 25 '15 12:09 SergeKornilov

Unless Windows SDK includes a compiler, its version is not relevant.

seishun avatar Sep 25 '15 12:09 seishun

VS 2010 support was dropped a long time ago. You need at least VS 2013.

In Node? When?

Unless Windows SDK includes a compiler, its version is not relevant.

Windows SDk 7 and 7.1 do include a compiler.

saghul avatar Sep 25 '15 12:09 saghul

In Node? When?

In 370e82142456cbfced954c7d73360660b7fd81cb.

Windows SDk 7 and 7.1 do include a compiler.

That's interesting. Is it an alternative to VS then? Anyway, I'm not sure how or if node would work with it, as vcbuild.bat looks for environment variables set by VS.

seishun avatar Sep 25 '15 13:09 seishun